From a06594f404f9c2aa1c815635e5604cbe964a8937 Mon Sep 17 00:00:00 2001 From: Phillip Stephens Date: Fri, 17 Apr 2020 05:53:22 -0700 Subject: [PATCH] Fix CAutoMapper strings, disable saving on non-USA/GC versions --- Runtime/AutoMapper/CAutoMapper.cpp | 12 ++++++------ Runtime/CStateManager.cpp | 2 +- Runtime/MP1/CFrontEndUI.cpp | 27 ++++++++++++++++++++++++--- 3 files changed, 31 insertions(+), 10 deletions(-) diff --git a/Runtime/AutoMapper/CAutoMapper.cpp b/Runtime/AutoMapper/CAutoMapper.cpp index d018c6bd6..f13e03012 100644 --- a/Runtime/AutoMapper/CAutoMapper.cpp +++ b/Runtime/AutoMapper/CAutoMapper.cpp @@ -1049,13 +1049,13 @@ void CAutoMapper::ProcessControllerInput(const CFinalInput& input, CStateManager } else { x2fc_textpane_hint->TextSupport().SetText(u""); std::u16string str = fmt::format(FMT_STRING(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x24_lStick[x2e4_lStickPos]); - str += g_MainStringTable->GetString(46); // Rotate + str += g_MainStringTable->GetString(46 + (!g_Main->IsUSA() || g_Main->IsTrilogy())); // Rotate x300_textpane_instructions->TextSupport().SetText(str); str = fmt::format(FMT_STRING(u"&image=SI,0.6,1.0,{};"), g_tweakPlayerRes->x4c_cStick[x2e8_rStickPos]); - str += g_MainStringTable->GetString(47); // Move + str += g_MainStringTable->GetString(47 + (!g_Main->IsUSA() || g_Main->IsTrilogy())); // Move x304_textpane_instructions1->TextSupport().SetText(str); str = fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->x74_lTrigger[x2ec_lTriggerPos]); - str += g_MainStringTable->GetString(48); // Zoom + str += g_MainStringTable->GetString(48 + (!g_Main->IsUSA() || g_Main->IsTrilogy())); // Zoom str += fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->x80_rTrigger[x2f0_rTriggerPos]); x308_textpane_instructions2->TextSupport().SetText(str); } @@ -1104,10 +1104,10 @@ void CAutoMapper::Update(float dt, CStateManager& mgr) { m_frmeInitialized = true; static_cast(x28_frmeMapScreen->FindWidget("textpane_left")) ->TextSupport() - .SetText(g_MainStringTable->GetString(42)); + .SetText(g_MainStringTable->GetString(42 + (!g_Main->IsUSA() || g_Main->IsTrilogy()))); static_cast(x28_frmeMapScreen->FindWidget("textpane_yicon")) ->TextSupport() - .SetText(g_MainStringTable->GetString(43)); + .SetText(g_MainStringTable->GetString(43 + (!g_Main->IsUSA() || g_Main->IsTrilogy()))); x2fc_textpane_hint = static_cast(x28_frmeMapScreen->FindWidget("textpane_hint")); x300_textpane_instructions = static_cast(x28_frmeMapScreen->FindWidget("textpane_instructions")); x304_textpane_instructions1 = static_cast(x28_frmeMapScreen->FindWidget("textpane_instructions1")); @@ -1115,7 +1115,7 @@ void CAutoMapper::Update(float dt, CStateManager& mgr) { CGuiTextPane* mapLegend = static_cast(x28_frmeMapScreen->FindWidget("textpane_mapLegend")); mapLegend->TextSupport().ClearRenderBuffer(); mapLegend->TextSupport().SetImageBaseline(true); - mapLegend->TextSupport().SetText(g_MainStringTable->GetString(49)); + mapLegend->TextSupport().SetText(g_MainStringTable->GetString(49 + (!g_Main->IsUSA() || g_Main->IsTrilogy()))); x30c_basewidget_leftPane = x28_frmeMapScreen->FindWidget("basewidget_leftPane"); x310_basewidget_yButtonPane = x28_frmeMapScreen->FindWidget("basewidget_yButtonPane"); x314_basewidget_bottomPane = x28_frmeMapScreen->FindWidget("basewidget_bottomPane"); diff --git a/Runtime/CStateManager.cpp b/Runtime/CStateManager.cpp index 2b5ebc9ea..a82c4a470 100644 --- a/Runtime/CStateManager.cpp +++ b/Runtime/CStateManager.cpp @@ -2580,7 +2580,7 @@ std::pair CStateManager::CalculateScanCompletionRate() const { void CStateManager::SetBossParams(TUniqueId bossId, float maxEnergy, u32 stringIdx) { xf18_bossId = bossId; xf1c_totalBossEnergy = maxEnergy; - xf20_bossStringIdx = stringIdx; + xf20_bossStringIdx = stringIdx - (g_Main->IsUSA() && !g_Main->IsTrilogy() ? 0 : 6); } float CStateManager::IntegrateVisorFog(float f) const { diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index 66460502a..30065b8af 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -125,6 +125,16 @@ void CFrontEndUI::SNewFileSelectFrame::FinishedLoading() { x20_tablegroup_fileselect = static_cast(x1c_loadedFrame->FindWidget("tablegroup_fileselect")); x24_model_erase = static_cast(x1c_loadedFrame->FindWidget("model_erase")); xf8_model_erase_position = x24_model_erase->GetLocalPosition(); + + // TODO: Implement language menu + auto langPair = FindTextPanePair(x1c_loadedFrame, "textpane_lang"); + if (langPair.x0_panes[0] != nullptr) { + langPair.x0_panes[0]->SetIsSelectable(false); + langPair.x0_panes[0]->SetIsVisible(false); + langPair.x0_panes[1]->SetIsSelectable(false); + langPair.x0_panes[1]->SetIsVisible(false); + } + x28_textpane_erase = FindTextPanePair(x1c_loadedFrame, "textpane_erase"); x38_textpane_gba = FindTextPanePair(x1c_loadedFrame, "textpane_gba"); x30_textpane_cheats = FindTextPanePair(x1c_loadedFrame, "textpane_cheats"); @@ -1177,14 +1187,25 @@ void CFrontEndUI::SFrontEndFrame::FinishedLoading() { x14_loadedFrme->SetAspectConstraint(1.78f); x18_tablegroup_mainmenu = static_cast(x14_loadedFrme->FindWidget("tablegroup_mainmenu")); - x1c_gbaPair = FindTextPanePair(x14_loadedFrme, "textpane_gba"); + //TODO: HACK: Implement language menu so this isn't necessary + if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { + x1c_gbaPair = FindTextPanePair(x14_loadedFrme, "textpane_gba"); + } else { + x1c_gbaPair = FindTextPanePair(x14_loadedFrme, "textpane_lang"); + } x1c_gbaPair.SetPairText(g_MainStringTable->GetString(37)); - x24_cheatPair = FindTextPanePair(x14_loadedFrme, "textpane_cheats"); + //TODO: HACK: Implement language menu so this isn't necessary + if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { + x24_cheatPair = FindTextPanePair(x14_loadedFrme, "textpane_cheats"); + } else { + x24_cheatPair = FindTextPanePair(x14_loadedFrme, "textpane_options"); + } x24_cheatPair.SetPairText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 96 : 90)); FindAndSetPairText(x14_loadedFrme, "textpane_start", g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 67 : 61)); - FindAndSetPairText(x14_loadedFrme, "textpane_options", + //TODO: HACK: Implement language menu so this isn't necessary + FindAndSetPairText(x14_loadedFrme, (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? "textpane_options" : "textpane_gba", g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 94 : 88)); FindAndSetPairText(x14_loadedFrme, "textpane_title", g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 98 : 92));