diff options
author | Treeki <treeki@gmail.com> | 2013-11-17 20:42:06 +0100 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2013-11-17 20:42:06 +0100 |
commit | c220e400436703c71adf2b49a04a863b72c41d29 (patch) | |
tree | 5d615b6834ee24233549a5ee4860f363c6e50185 /src/koopatlas | |
parent | d55debf80b417793ce924ec977ed3a16413fd5d6 (diff) | |
download | kamek-level-select.tar.gz kamek-level-select.zip |
broken translations and shit, possibly final commit before public releaselevel-select
Diffstat (limited to 'src/koopatlas')
-rw-r--r-- | src/koopatlas/core.cpp | 41 | ||||
-rw-r--r-- | src/koopatlas/hud.cpp | 18 | ||||
-rw-r--r-- | src/koopatlas/shop.cpp | 20 | ||||
-rw-r--r-- | src/koopatlas/starcoin.cpp | 12 |
4 files changed, 29 insertions, 62 deletions
diff --git a/src/koopatlas/core.cpp b/src/koopatlas/core.cpp index 40776c8..8712da7 100644 --- a/src/koopatlas/core.cpp +++ b/src/koopatlas/core.cpp @@ -518,6 +518,7 @@ void dScKoopatlas_c::endState_ContinueWait() { void dScKoopatlas_c::executeState_Normal() { + // ghb if (pathManager.completionMessagePending) { OSReport("Going to set CompletionMsg\n"); state.setState(&StateID_CompletionMsg); @@ -1081,37 +1082,21 @@ void dScKoopatlas_c::showSaveWindow() { yesNoWindow->visible = true; } -static const wchar_t *completionMsgs[] = { - L"The most erudite of Buttocks", - L"You've collected all of\nthe \x0B\x014F\xBEEF Star Coins in\n", - L"You have gotten every \x0B\x013B\xBEEF exit\nin", - L"You have gotten everything\nin", - L"You have collected all the\nnecessary \x0B\x014F\xBEEF coins to enter\nthe Special World!", - L"You have collected all the \x0B\x014F\xBEEF Star\nCoins in the game!", - L"You've found every \x0B\x013B\xBEEF exit in the\ngame!", - L"You've completed everything in\nNEWER SUPER MARIO BROS. Wii!\n\nWe present you a new quest.\nTry pressing \x0B\x0122\xBEEF, \x0B\x0123\xBEEF and \x0B\x0125\xBEEF\n on the Star Coin menu." -}; - void dScKoopatlas_c::beginState_CompletionMsg() { + if (pathManager.completionMessageType == 0) + pathManager.completionMessageType = 1; OSReport("CompletionMsg beginning with type %d\n", pathManager.completionMessageType); - static const int ynTypes[8] = { - /*NULL*/ -1, - /*COINS*/ 14, - /*EXITS*/ 7, - /*WORLD*/ 8, - /*COINS EXC W9*/ 9, - /*GLOBAL COINS*/ 11, - /*GLOBAL EXITS*/ 27, - /*EVERYTHING*/ 21 - }; - yesNoWindow->type = ynTypes[pathManager.completionMessageType]; + yesNoWindow->type = 21; yesNoWindow->visible = true; mustFixYesNoText = 10; // hacky shit } void dScKoopatlas_c::endState_CompletionMsg() { + // ghb pathManager.completionMessagePending = false; pathManager.completionMessageType = 0; + //pathManager.completionMessagePending = true; + //pathManager.completionMessageType ++; } void dScKoopatlas_c::executeState_CompletionMsg() { @@ -1121,16 +1106,20 @@ void dScKoopatlas_c::executeState_CompletionMsg() { int type = pathManager.completionMessageType; - const wchar_t *baseText = completionMsgs[type]; + dScript::Res_c *bmg = GetBMG(); + + const wchar_t *baseText = bmg->findStringForMessageID(9000, type); + // Used when we assemble a dynamic message wchar_t text[512]; if (type >= CMP_MSG_COINS && type <= CMP_MSG_WORLD) { // title int w = pathManager.completionMessageWorldNum; + // ghb + //w = 1; int l = ((w == 5) || (w == 7)) ? 101 : 100; - dLevelInfo_c::entry_s *titleEntry = dLevelInfo_c::s_info.searchByDisplayNum(w, l); - const char *title = dLevelInfo_c::s_info.getNameForLevel(titleEntry); + const wchar_t *title = bmg->findStringForMessageID(8000+w, l); // assemble the string @@ -1140,7 +1129,7 @@ void dScKoopatlas_c::executeState_CompletionMsg() { text[pos++] = ' '; while (*title) { - char chr = *(title++); + wchar_t chr = *(title++); if (chr != '-') text[pos++] = chr; } diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp index dceddb8..50899a7 100644 --- a/src/koopatlas/hud.cpp +++ b/src/koopatlas/hud.cpp @@ -227,19 +227,9 @@ void dWMHud_c::loadHeaderInfo() { } // LEVEL NAME - wchar_t convertedLevelName[100]; - const char *sourceLevelName = levelInfo->getNameForLevel(infEntry); - int charCount = 0; - - while (*sourceLevelName != 0 && charCount < 99) { - convertedLevelName[charCount] = *sourceLevelName; - sourceLevelName++; - charCount++; - } - convertedLevelName[charCount] = 0; - - LevelName->SetString(convertedLevelName); - LevelNameS->SetString(convertedLevelName); + dScript::Res_c *bmg = GetBMG(); + Newer_WriteBMGToTextBox(LevelName, bmg, 8000+infEntry->worldSlot+1, infEntry->levelSlot+1, 0); + Newer_WriteBMGToTextBox(LevelNameS, bmg, 8000+infEntry->worldSlot+1, infEntry->levelSlot+1, 0); // a hack because I don't feel like editing the rlyt LevelName->size.x = LevelNameS->size.x = 400.0f; @@ -326,7 +316,7 @@ void dWMHud_c::loadHeaderInfo() { if (LevelName->tagProc != 0) tw.tagProcessor = LevelName->tagProc; - float width = tw.CalcStringWidth(convertedLevelName, charCount); + float width = tw.CalcStringWidth(LevelName->stringBuf, LevelName->stringLength); float totalWidth = width + LevelName->trans.x - 20.0f; if (totalWidth < currentPos) totalWidth = currentPos; diff --git a/src/koopatlas/shop.cpp b/src/koopatlas/shop.cpp index 6f9566e..1ab6458 100644 --- a/src/koopatlas/shop.cpp +++ b/src/koopatlas/shop.cpp @@ -538,23 +538,9 @@ void dWMShop_c::loadInfo() { rightCol.colourise(save->hudHintH, save->hudHintS, save->hudHintL); // find out the shop name - dLevelInfo_c::entry_s *shopNameEntry = - dLevelInfo_c::s_info.searchBySlot(shopKind, 98); - - wchar_t shopName[100]; - // TODO: refactor this a bit - const char *sourceName = dLevelInfo_c::s_info.getNameForLevel(shopNameEntry); - int charCount = 0; - - while (*sourceName != 0 && charCount < 99) { - shopName[charCount] = *sourceName; - sourceName++; - charCount++; - } - shopName[charCount] = 0; - - Title->SetString(shopName); - TitleShadow->SetString(shopName); + dScript::Res_c *bmg = GetBMG(); + Newer_WriteBMGToTextBox(Title, bmg, 8000+shopKind+1, 99, 0); + Newer_WriteBMGToTextBox(TitleShadow, bmg, 8000+shopKind+1, 99, 0); // load the coin count int scCount = getUnspentStarCoinCount(); diff --git a/src/koopatlas/starcoin.cpp b/src/koopatlas/starcoin.cpp index 8cb819b..e81a347 100644 --- a/src/koopatlas/starcoin.cpp +++ b/src/koopatlas/starcoin.cpp @@ -239,6 +239,7 @@ void dWMStarCoin_c::loadInfo() { } void dWMStarCoin_c::loadSectionInfo() { + dScript::Res_c *bmg = GetBMG(); dLevelInfo_c::entry_s *visibleLevels[COLUMN_COUNT][ROW_COUNT]; // reset everything... everything @@ -262,9 +263,9 @@ void dWMStarCoin_c::loadSectionInfo() { SaveBlock *save = GetSaveFile()->GetBlock(-1); dLevelInfo_c *linfo = &dLevelInfo_c::s_info; - dLevelInfo_c::entry_s *names[COLUMN_COUNT]; + const wchar_t *names[COLUMN_COUNT]; for (int i = 0; i < COLUMN_COUNT; i++) - names[i] = linfo->searchByDisplayNum(currentSection, 100+i); + names[i] = bmg->findStringForMessageID(8000+currentSection, 100+i); bool useSubworlds = (COLUMN_COUNT > 1) && names[1]; @@ -321,9 +322,10 @@ void dWMStarCoin_c::loadSectionInfo() { names[1] = 0; // work out the names - WriteAsciiToTextBox(LeftTitle, linfo->getNameForLevel(names[0])); + LeftTitle->SetString(names[0]); + if (names[1]) - WriteAsciiToTextBox(RightTitle, linfo->getNameForLevel(names[1])); + RightTitle->SetString(names[1]); RightTitle->SetVisible(names[1] != 0); // load all level info @@ -351,7 +353,7 @@ void dWMStarCoin_c::loadSectionInfo() { } LevelName[col][row]->SetVisible(true); - WriteAsciiToTextBox(LevelName[col][row], linfo->getNameForLevel(level)); + Newer_WriteBMGToTextBox(LevelName[col][row], bmg, 8000+level->worldSlot+1, level->levelSlot+1, 0); } } |