diff options
Diffstat (limited to 'src/koopatlas/hud.cpp')
-rw-r--r-- | src/koopatlas/hud.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp index 266c284..cd52beb 100644 --- a/src/koopatlas/hud.cpp +++ b/src/koopatlas/hud.cpp @@ -50,6 +50,7 @@ int dWMHud_c::onCreate() { layout.enableNonLoopAnim(SHOW_LIVES); layout.enableNonLoopAnim(SHOW_FOOTER); + layout.resetAnim(SHOW_HEADER); static const char *tbNames[2] = {"MenuButtonInfo", "ItemsButtonInfo"}; layout.setLangStrings(tbNames, (int[2]){12, 15}, 4, 2); @@ -72,6 +73,9 @@ int dWMHud_c::onCreate() { layoutLoaded = true; willShowHeader = false; + + if (!dScKoopatlas_c::instance->pathManager.isMoving) + enteredNode(); } return true; @@ -131,7 +135,7 @@ void dWMHud_c::loadHeaderInfo() { dLevelInfo_c *levelInfo = &dScKoopatlas_c::instance->levelInfo; dLevelInfo_c::entry_s *infEntry = levelInfo->search( - nodeForHeader->levelNumber[0], nodeForHeader->levelNumber[1]); + nodeForHeader->levelNumber[0]-1, nodeForHeader->levelNumber[1]-1); if (infEntry == 0) { LevelName->SetString(L"Unknown Level Name!"); @@ -191,14 +195,18 @@ void dWMHud_c::loadHeaderInfo() { tw.tagProcessor = LevelName->tagProc; float width = tw.CalcStringWidth(convertedLevelName, charCount); - Header_Centre->size.x = width + LevelName->trans.x - 20.0f; - Header_Right->trans.x = Header_Centre->size.x; + float totalWidth = width + LevelName->trans.x - 20.0f; + if (totalWidth < 270.0f) + totalWidth = 270.0f; + Header_Centre->size.x = totalWidth; + Header_Right->trans.x = totalWidth; } -void dWMHud_c::enteredNode() { - dKPNode_s *node = dScKoopatlas_c::instance->pathManager.currentNode; +void dWMHud_c::enteredNode(dKPNode_s *node) { + if (node == 0) + node = dScKoopatlas_c::instance->pathManager.currentNode; if (node->type == dKPNode_s::LEVEL) { willShowHeader = true; |