diff options
author | Colin Noga <Tempus@chronometry.ca> | 2012-11-25 15:35:13 -0600 |
---|---|---|
committer | Colin Noga <Tempus@chronometry.ca> | 2012-11-25 15:35:13 -0600 |
commit | db34c0af338b8cf04f50b4ade98668869fd303e1 (patch) | |
tree | e373abe027205c0e8414cf6146ded59112b0ab72 /src/pregame.cpp | |
parent | 72b9b71b5b7fb5757849d19af3dfae21d0ab9c92 (diff) | |
parent | 1609b49c5c1777e663909b1936b2f8921677f230 (diff) | |
download | kamek-db34c0af338b8cf04f50b4ade98668869fd303e1.tar.gz kamek-db34c0af338b8cf04f50b4ade98668869fd303e1.zip |
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to 'src/pregame.cpp')
-rw-r--r-- | src/pregame.cpp | 28 |
1 files changed, 21 insertions, 7 deletions
diff --git a/src/pregame.cpp b/src/pregame.cpp index 3a2e89c..6ac04de 100644 --- a/src/pregame.cpp +++ b/src/pregame.cpp @@ -53,16 +53,15 @@ class PregameLytHandler { extern char CurrentLevel; extern char CurrentWorld; -#include "fileload.h" -void PregameLytHandler::hijack_loadLevelNumber() { +void LoadPregameStyleNameAndNumber(m2d::EmbedLayout_c *layout) { nw4r::lyt::TextBox *LevelNumShadow, *LevelNum, *LevelNameShadow, *LevelName; - LevelNumShadow = layout.findTextBoxByName("LevelNumShadow"); - LevelNum = layout.findTextBoxByName("LevelNum"); - LevelNameShadow = layout.findTextBoxByName("LevelNameShadow"); - LevelName = layout.findTextBoxByName("LevelName"); + LevelNumShadow = layout->findTextBoxByName("LevelNumShadow"); + LevelNum = layout->findTextBoxByName("LevelNum"); + LevelNameShadow = layout->findTextBoxByName("LevelNameShadow"); + LevelName = layout->findTextBoxByName("LevelName"); // work out the thing now dLevelInfo_c::entry_s *level = dLevelInfo_c::s_info.searchBySlot(CurrentWorld, CurrentLevel); @@ -82,13 +81,28 @@ void PregameLytHandler::hijack_loadLevelNumber() { wcscpy(levelNumber, L"World "); getNewerLevelNumberString(level->displayWorld, level->displayLevel, &levelNumber[6]); - LevelNumShadow->SetString(levelNumber); LevelNum->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++; + } + LevelNumShadow->SetString(levelNumber); + } else { LevelNameShadow->SetString(L"Not found in LevelInfo!"); LevelName->SetString(L"Not found in LevelInfo!"); } +} + +#include "fileload.h" +void PregameLytHandler::hijack_loadLevelNumber() { + LoadPregameStyleNameAndNumber(&layout); nw4r::lyt::Picture *LevelSample; LevelSample = layout.findPictureByName("LevelSample"); |