diff options
Diffstat (limited to 'src/koopatlas/hud.cpp')
-rw-r--r-- | src/koopatlas/hud.cpp | 58 |
1 files changed, 52 insertions, 6 deletions
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp index 5fe8072..b7effce 100644 --- a/src/koopatlas/hud.cpp +++ b/src/koopatlas/hud.cpp @@ -55,20 +55,30 @@ int dWMHud_c::onCreate() { static const char *tbNames[2] = {"MenuButtonInfo", "ItemsButtonInfo"}; layout.setLangStrings(tbNames, (int[2]){12, 15}, 4, 2); - static const char *pictureNames[7] = { + static const char *paneNames[] = { + "N_IconPos1P_00", "N_IconPos2P_00", + "N_IconPos3P_00", "N_IconPos4P_00" + }; + layout.getPanes(paneNames, &N_IconPosXP_00[0], 4); + + static const char *pictureNames[] = { "Header_Centre", "Header_Right", "NormalExitFlag", "SecretExitFlag", - "StarCoinOn0", "StarCoinOn1", "StarCoinOn2" + "StarCoinOn0", "StarCoinOn1", "StarCoinOn2", + "P_marioFace_00", "P_luigiFace_00", + "P_BkinoFace_00", "P_YkinoFace_00" }; - layout.getPictures(pictureNames, &Header_Centre, 7); + layout.getPictures(pictureNames, &Header_Centre, 11); - static const char *textBoxNames[7] = { + static const char *textBoxNames[] = { "LevelName", "LevelNameS", "LevelNumber", "LevelNumberS", "WorldName", "WorldNameS", - "StarCoinCounter" + "StarCoinCounter", + "T_lifeNumber_00", "T_lifeNumber_01", + "T_lifeNumber_02", "T_lifeNumber_03" }; - layout.getTextBoxes(textBoxNames, &LevelName, 7); + layout.getTextBoxes(textBoxNames, &LevelName, 11); layoutLoaded = true; @@ -76,6 +86,8 @@ int dWMHud_c::onCreate() { if (!dScKoopatlas_c::instance->pathManager.isMoving) enteredNode(); + + setupLives(); } return true; @@ -232,4 +244,38 @@ void dWMHud_c::leftNode() { +void dWMHud_c::setupLives() { + static const int LogicalPlayerIDs[] = {0,1,3,2}; + + P_marioFace_00->SetVisible(false); + P_luigiFace_00->SetVisible(false); + P_BkinoFace_00->SetVisible(false); + P_YkinoFace_00->SetVisible(false); + + int playerCount = 0; + + for (int i = 0; i < 4; i++) { + // The part in setupLives() + int playerID = LogicalPlayerIDs[i]; + int slotID = SearchForIndexOfPlayerID(playerID); + int lives = Player_Lives[slotID]; + int length = 2; + + WriteNumberToTextBox(&lives, &length, T_lifeNumber[slotID], true); + + // The part in setupIconThings() + if (QueryPlayerAvailability(slotID)) { + playerCount++; + + nw4r::lyt::Pane *facePane = (&P_marioFace_00)[playerID]; + facePane->trans = N_IconPosXP_00[i]->trans; + facePane->SetVisible(true); + } + } + + for (int i = 0; i < 4; i++) + N_IconPosXP_00[i]->SetVisible(false); + N_IconPosXP_00[playerCount - 1]->SetVisible(true); +} + |