From 4bc93995778096106a3214fcd29dab7ff6e144c7 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 28 Sep 2012 03:09:54 +0200 Subject: HUD numbers are now working --- bugfixes.yaml | 7 +++++++ src/koopatlas/hud.cpp | 33 ++++++++++++++++++++++++--------- 2 files changed, 31 insertions(+), 9 deletions(-) diff --git a/bugfixes.yaml b/bugfixes.yaml index 336a524..3af6148 100644 --- a/bugfixes.yaml +++ b/bugfixes.yaml @@ -153,3 +153,10 @@ hooks: type: add_func_pointer src_addr_pal: 0x80B00234 target_func: 'ReturnNone' + + + - {name: AlwaysDrawPictureFontWhite1, type: patch, addr_pal: 0x800E596C, data: '3800FFFF'} + - {name: AlwaysDrawPictureFontWhite2, type: patch, addr_pal: 0x800E5974, data: '3800FFFF'} + - {name: AlwaysDrawPictureFontWhite3, type: patch, addr_pal: 0x800E597C, data: '3800FFFF'} + - {name: AlwaysDrawPictureFontWhite4, type: patch, addr_pal: 0x800E5984, data: '3800FFFF'} + diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp index 5379019..3255af8 100644 --- a/src/koopatlas/hud.cpp +++ b/src/koopatlas/hud.cpp @@ -192,7 +192,7 @@ int dWMHud_c::onCreate() { layout.disableAllAnimations(); layout.enableNonLoopAnim(SHOW_LIVES); - layout.enableNonLoopAnim(SHOW_FOOTER); + layout.resetAnim(SHOW_FOOTER); layout.resetAnim(SHOW_HEADER); static const char *tbNames[2] = {"MenuButtonInfo", "ItemsButtonInfo"}; @@ -236,6 +236,8 @@ int dWMHud_c::onCreate() { willShowFooter = false; loadFooterInfo(); + SaveBlock *save = GetSaveFile()->GetBlock(-1); + willShowFooter = (save->newerWorldName[0] != 0); if (!dScKoopatlas_c::instance->pathManager.isMoving) enteredNode(); @@ -347,14 +349,17 @@ void dWMHud_c::loadHeaderInfo() { // LEVEL NUMBER static const wchar_t *numberKinds[] = { // 0-19 are handled by code + // To insert a picturefont character: + // \x0B\x01YY\xZZZZ + // YY is the character code, ZZZZ is ignored L"A", // 20, alternate - L"Tower", // 21, tower - L"Tower2", // 22, tower 2 - L"Castle", // 23, castle - L"Fortress", // 24, fortress - L"FCastle", // 25, final castle + L"\x0B\x012F\xBEEF", // 21, tower + L"\x0B\x012F\xBEEF" L"2", // 22, tower 2 + L"\x0B\x012E\xBEEF", // 23, castle + L"\x0B\x012F\xBEEF", // 24, fortress + L"\x0B\x013D\xBEEF", // 25, final castle L"Train", // 26, train - L"Airship", // 27, airship + L"\x0B\x0132\xBEEF", // 27, airship L"Palace", // 28, switch palace L"House", // 29, yoshi's house L"Key1", // 30, key 1 @@ -365,8 +370,8 @@ void dWMHud_c::loadHeaderInfo() { L"Key6", // 35, key 6 }; - int origWN = nodeForHeader->levelNumber[0]; - int origWL = nodeForHeader->levelNumber[1]; + int origWN = infEntry->displayWorld; + int origWL = infEntry->displayLevel; wchar_t levelNumber[16]; levelNumber[0] = (origWN >= 10) ? (origWN-10+'A') : (origWN+'0'); @@ -383,6 +388,16 @@ void dWMHud_c::loadHeaderInfo() { } LevelNumber->SetString(levelNumber); + + // make the picture shadowy + int sidx = 0; + while (levelNumber[sidx]) { + if (levelNumber[sidx] == 11) { + levelNumber[sidx+1] = 0x200 | (levelNumber[sidx+1]&0xFF); + sidx += 2; + } + sidx++; + } LevelNumberS->SetString(levelNumber); nw4r::ut::TextWriter tw2; -- cgit v1.2.3