diff --git a/Runtime/MP1/CFrontEndUI.cpp b/Runtime/MP1/CFrontEndUI.cpp index ae29e8072..c929bc757 100644 --- a/Runtime/MP1/CFrontEndUI.cpp +++ b/Runtime/MP1/CFrontEndUI.cpp @@ -134,10 +134,11 @@ void CFrontEndUI::SNewFileSelectFrame::FinishedLoading() { x40_tablegroup_popup = static_cast(x1c_loadedFrame->FindWidget("tablegroup_popup")); x44_model_dash7 = static_cast(x1c_loadedFrame->FindWidget("model_dash7")); x60_textpane_cancel = static_cast(x1c_loadedFrame->FindWidget("textpane_cancel")); - FindAndSetPairText(x1c_loadedFrame, "textpane_title", g_MainStringTable->GetString(97)); + FindAndSetPairText(x1c_loadedFrame, "textpane_title", + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 97 : 92)); CGuiTextPane* proceed = static_cast(x1c_loadedFrame->FindWidget("textpane_proceed")); if (proceed) - proceed->TextSupport().SetText(g_MainStringTable->GetString(85)); + proceed->TextSupport().SetText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 85 : 79)); x40_tablegroup_popup->SetIsVisible(false); x40_tablegroup_popup->SetIsActive(false); x40_tablegroup_popup->SetVertical(false); @@ -307,7 +308,8 @@ void CFrontEndUI::SNewFileSelectFrame::HandleActiveChange(CGuiTableGroup* active tbDetails[i].percent = data->x18_itemPercent; } } - m_touchBar.SetFileSelectPhase(tbDetails.data(), x8_subMenu == ESubMenu::EraseGame, CSlideShow::SlideShowGalleryFlags()); + m_touchBar.SetFileSelectPhase(tbDetails.data(), x8_subMenu == ESubMenu::EraseGame, + CSlideShow::SlideShowGalleryFlags()); } else if (active == x40_tablegroup_popup) { if (x8_subMenu == ESubMenu::EraseGamePopup) m_touchBar.SetPhase(CFrontEndUITouchBar::EPhase::EraseBack); @@ -344,8 +346,10 @@ void CFrontEndUI::SNewFileSelectFrame::ActivateEraseGamePopup() { x8_subMenu = ESubMenu::EraseGamePopup; HandleActiveChange(x40_tablegroup_popup); - x48_textpane_popupadvance.SetPairText(g_MainStringTable->GetString(95)); - x50_textpane_popupcancel.SetPairText(g_MainStringTable->GetString(38)); + x48_textpane_popupadvance.SetPairText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 95 : 89)); + x50_textpane_popupcancel.SetPairText( + g_MainStringTable->GetString(38)); // This string is unmodified in PAL/NTSCJ/Trilogy x64_fileSelections[x20_tablegroup_fileselect->GetUserSelection()].x0_base->SetColor(zeus::CColor{1.f, 1.f, 1.f, 0.f}); x44_model_dash7->SetVisibility(false, ETraversalMode::Children); @@ -384,19 +388,25 @@ void CFrontEndUI::SNewFileSelectFrame::ActivateNewGamePopup() { PlayAdvanceSfx(); if (g_GameState->SystemOptions().GetPlayerBeatNormalMode()) { - x48_textpane_popupadvance.SetPairText(g_MainStringTable->GetString(102)); - x50_textpane_popupcancel.SetPairText(g_MainStringTable->GetString(94)); - x58_textpane_popupextra.SetPairText(g_MainStringTable->GetString(101)); + x48_textpane_popupadvance.SetPairText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 102 : 96)); + x50_textpane_popupcancel.SetPairText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 94 : 88)); + x58_textpane_popupextra.SetPairText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 101 : 95)); CGuiWidget* worker = x40_tablegroup_popup->GetWorkerWidget(2); worker->SetIsSelectable(true); worker->SetVisibility(true, ETraversalMode::Children); x44_model_dash7->SetVisibility(true, ETraversalMode::Children); } else { - x48_textpane_popupadvance.SetPairText(g_MainStringTable->GetString(67)); - x50_textpane_popupcancel.SetPairText(g_MainStringTable->GetString(94)); + x48_textpane_popupadvance.SetPairText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 67 : 61)); + x50_textpane_popupcancel.SetPairText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 94 : 88)); x44_model_dash7->SetVisibility(false, ETraversalMode::Children); } - x60_textpane_cancel->TextSupport().SetText(g_MainStringTable->GetString(82)); + x60_textpane_cancel->TextSupport().SetText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76)); } void CFrontEndUI::SNewFileSelectFrame::ResetFrame() { @@ -436,7 +446,8 @@ void CFrontEndUI::SNewFileSelectFrame::ActivateErase() { } } - x60_textpane_cancel->TextSupport().SetText(g_MainStringTable->GetString(82)); + x60_textpane_cancel->TextSupport().SetText( + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76)); HandleActiveChange(x20_tablegroup_fileselect); } @@ -456,13 +467,19 @@ void CFrontEndUI::SNewFileSelectFrame::ClearFrameContents() { } } - StartTextAnimating(x28_textpane_erase.x0_panes[0], g_MainStringTable->GetString(38), 60.f); - StartTextAnimating(x38_textpane_gba.x0_panes[0], g_MainStringTable->GetString(37), 60.f); - StartTextAnimating(x30_textpane_cheats.x0_panes[0], g_MainStringTable->GetString(96), 60.f); + StartTextAnimating(x28_textpane_erase.x0_panes[0], g_MainStringTable->GetString(38), + 60.f); // This string is unmodified in PAL/NTSCJ/Trilogy + StartTextAnimating(x38_textpane_gba.x0_panes[0], g_MainStringTable->GetString(37), + 60.f); // This string is unmodified in PAL/NTSCJ/Trilogy + StartTextAnimating(x30_textpane_cheats.x0_panes[0], + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 96 : 90), 60.f); - StartTextAnimating(x28_textpane_erase.x0_panes[1], g_MainStringTable->GetString(38), 60.f); - StartTextAnimating(x38_textpane_gba.x0_panes[1], g_MainStringTable->GetString(37), 60.f); - StartTextAnimating(x30_textpane_cheats.x0_panes[1], g_MainStringTable->GetString(96), 60.f); + StartTextAnimating(x28_textpane_erase.x0_panes[1], g_MainStringTable->GetString(38), + 60.f); // This string is unmodified in PAL/NTSCJ/Trilogy + StartTextAnimating(x38_textpane_gba.x0_panes[1], g_MainStringTable->GetString(37), + 60.f); // This string is unmodified in PAL/NTSCJ/Trilogy + StartTextAnimating(x30_textpane_cheats.x0_panes[1], + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 96 : 90), 60.f); if (hasSave) { x28_textpane_erase.x0_panes[0]->SetIsSelectable(true); @@ -489,6 +506,27 @@ void CFrontEndUI::SNewFileSelectFrame::ClearFrameContents() { HandleActiveChange(x20_tablegroup_fileselect); } +std::u16string GetTimeString(const CGameState::GameFileStateInfo* data) { + if (data) { + auto pt = std::div(data->x0_playTime, 3600); +#if FE_USE_SECONDS_IN_ELAPSED + return fmt::format(FMT_STRING(u"{:02d}:{:02d}:{:02d}"), pt.quot, pt.rem / 60, pt.rem % 60); +#else + return fmt::format(FMT_STRING(u"{:02d}:{:02d}"), pt.quot, pt.rem / 60); +#endif + } + if (!g_Main->IsUSA() || g_Main->IsTrilogy()) + return g_MainStringTable->GetString(53); + return g_MainStringTable->GetString(52); +} + +std::u16string GetElapsedString(const CGameState::GameFileStateInfo* data) { + if (!g_Main->IsUSA() || g_Main->IsTrilogy()) + return g_MainStringTable->GetString(data ? 55 : 54); + + return std::u16string(g_MainStringTable->GetString(data ? 54 : 53)); +} + void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents() { for (size_t i = 0; i < x64_fileSelections.size(); ++i) { SFileMenuOption& option = x64_fileSelections[i]; @@ -508,7 +546,11 @@ void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents() { case 0: // Completion percent if (data) { - std::u16string fileStr = g_MainStringTable->GetString((data->x20_hardMode ? 106 : 39) + int(i)); + int strIdx = (data->x20_hardMode ? 106 : 39); + if ((!g_Main->IsUSA() || g_Main->IsTrilogy())) + strIdx = (strIdx == 106 ? 100 : 40); + + std::u16string fileStr = g_MainStringTable->GetString(strIdx + int(i)); str = fileStr + fmt::format(FMT_STRING(u" {:02d}%"), data->x18_itemPercent); break; } @@ -524,38 +566,38 @@ void CFrontEndUI::SNewFileSelectFrame::SetupFrameContents() { } break; } - str = g_MainStringTable->GetString(51); + str = g_MainStringTable->GetString(51 + int(!g_Main->IsUSA() || g_Main->IsTrilogy())); break; -#if FE_USE_SECONDS_IN_ELAPSED - case 2: - // Formatted time - if (data) { - auto pt = std::div(data->x0_playTime, 3600); - str = fmt::format(FMT_STRING(u"{:02d}:{:02d}:{:02d}"), pt.quot, pt.rem / 60, pt.rem % 60); - break; - } - str = g_MainStringTable->GetString(52); - break; - case 3: - // "Elapsed" - str = std::u16string(u" ") + std::u16string(g_MainStringTable->GetString(data ? 54 : 53)); - break; -#else case 2: - // Formatted time - if (data) { - auto pt = std::div(data->x0_playTime, 3600); - str = hecl::Char16Format(L"%02d:%02d", pt.quot, pt.rem / 60); - break; +#if FE_USE_SECONDS_IN_ELAPSED + if (!g_Main->IsUSA() || g_Main->IsTrilogy()) { + str = GetElapsedString(data); + } else { + str = GetTimeString(data); + } +#else + if (!g_Main->IsUSA() || g_Main->IsTrilogy()) { + str = GetElapsedString(data); + } else { + str = GetTimeString(data); } - str = g_MainStringTable->GetString(52); - break; - - case 3: - // "Elapsed" - str = g_MainStringTable->GetString(data ? 54 : 53); - break; #endif + break; + case 3: +#if FE_USE_SECONDS_IN_ELAPSED + if (!g_Main->IsUSA() || g_Main->IsTrilogy()) { + str = GetTimeString(data); + } else { + str = std::u16string(u" ") + GetElapsedString(data); + } +#else + if (!g_Main->IsUSA() || g_Main->IsTrilogy()) { + str = GetTimeString(data); + } else { + str = std::u16string(u" ") + GetElapsedString(data); + } +#endif + break; default: break; @@ -681,54 +723,54 @@ void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::SetUIText(EUIType tp) { switch (tp) { case EUIType::InsertPak: - instructions = 73; // Insert Game Pak - no = 82; - yes = 83; + instructions = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 73 : 67; // Insert Game Pak + no = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76; + yes = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 83 : 77; pakoutVisible = true; circleGbaVisible = true; break; case EUIType::ConnectSocket: - instructions = 68; // Connect socket - no = 82; - yes = 83; + instructions = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 68 : 62; // Connect socket + no = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76; + yes = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 83 : 77; cableVisible = true; circleGcVisible = true; circleGbaVisible = true; break; case EUIType::PressStartAndSelect: - instructions = 74; // Hold start and select - no = 82; - yes = 83; + instructions = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 74 : 68; // Hold start and select + no = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76; + yes = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 83 : 77; cableVisible = true; circleStartVisible = true; gbaScreenVisible = true; break; case EUIType::BeginLink: - instructions = 75; // Begin link? - no = 82; - yes = 83; + instructions = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 75 : 69; // Begin link? + no = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76; + yes = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 83 : 77; cableVisible = true; gbaScreenVisible = true; break; case EUIType::TurnOffGBA: - instructions = 76; // Turn off GBA - no = 82; - yes = 83; + instructions = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 76 : 70; // Turn off GBA + no = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76; + yes = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 83 : 77; cableVisible = true; gbaScreenVisible = true; circleStartVisible = true; break; case EUIType::Linking: x4_gbaSupport->StartLink(); - instructions = 72; // Linking + instructions = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 72 : 66; // Linking cableVisible = true; gbaScreenVisible = true; connectVisible = true; break; case EUIType::LinkFailed: - instructions = 69; // Link failed - no = 82; - yes = 83; + instructions = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 69 : 63; // Link failed + no = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76; + yes = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 83 : 77; cableVisible = true; circleGcVisible = true; circleGbaVisible = true; @@ -736,8 +778,8 @@ void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::SetUIText(EUIType tp) { gbaScreenVisible = true; break; case EUIType::LinkCompleteOrLinking: - yes = 83; - instructions = x40_linkInProgress + 71; // Complete or linking + yes = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 83 : 77; + instructions = x40_linkInProgress + (g_Main->IsUSA() && !g_Main->IsTrilogy() ? 71 : 65); // Complete or linking cableVisible = true; gbaScreenVisible = true; break; @@ -775,8 +817,9 @@ void CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::SetUIText(EUIType tp) { x0_uiType = tp; } -CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EAction CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::ProcessUserInput( - const CFinalInput& input, bool linkInProgress, CFrontEndUITouchBar::EAction tbAction) { +CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EAction +CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::ProcessUserInput(const CFinalInput& input, bool linkInProgress, + CFrontEndUITouchBar::EAction tbAction) { if (linkInProgress != x40_linkInProgress) { x40_linkInProgress = linkInProgress; SetUIText(x0_uiType); @@ -790,9 +833,7 @@ CFrontEndUI::SFusionBonusFrame::SGBALinkFrame::EAction CFrontEndUI::SFusionBonus case EUIType::LinkFailed: case EUIType::LinkCompleteOrLinking: case EUIType::TurnOffGBA: - if (input.PA() || - input.PSpecialKey(boo::ESpecialKey::Enter) || - input.PMouseButton(boo::EMouseButton::Primary) || + if (input.PA() || input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || tbAction == CFrontEndUITouchBar::EAction::Confirm) { PlayAdvanceSfx(); SetUIText(NextLinkUI[size_t(x0_uiType)]); @@ -874,18 +915,23 @@ void CFrontEndUI::SFusionBonusFrame::FinishedLoading() { x2c_tablegroup_fusionsuit = static_cast(x24_loadedFrame->FindWidget("tablegroup_fusionsuit")); x30_textpane_instructions = FindTextPanePair(x24_loadedFrame, "textpane_instructions"); - FindAndSetPairText(x24_loadedFrame, "textpane_nes", g_MainStringTable->GetString(66)); - FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuit", g_MainStringTable->GetString(63)); - FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuitno", g_MainStringTable->GetString(65)); - FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuityes", g_MainStringTable->GetString(64)); - FindAndSetPairText(x24_loadedFrame, "textpane_title", g_MainStringTable->GetString(100)); + FindAndSetPairText(x24_loadedFrame, "textpane_nes", + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 66 : 60)); + FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuit", + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 63 : 57)); + FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuitno", + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 65 : 59)); + FindAndSetPairText(x24_loadedFrame, "textpane_fusionsuityes", + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 64 : 58)); + FindAndSetPairText(x24_loadedFrame, "textpane_title", + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 100 : 94)); static_cast(x24_loadedFrame->FindWidget("textpane_proceed")) ->TextSupport() - .SetText(g_MainStringTable->GetString(85)); + .SetText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 85 : 79)); static_cast(x24_loadedFrame->FindWidget("textpane_cancel")) ->TextSupport() - .SetText(g_MainStringTable->GetString(82)); + .SetText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76)); x2c_tablegroup_fusionsuit->SetIsActive(false); x2c_tablegroup_fusionsuit->SetIsVisible(false); @@ -949,22 +995,27 @@ void CFrontEndUI::SFusionBonusFrame::Update(float dt, CSaveGameScreen* saveUI) { if (x28_tablegroup_options->GetUserSelection() == 1) { /* Fusion Suit */ if (x3a_mpNotComplete) - instructionStr = g_MainStringTable->GetString(80); // MP not complete + instructionStr = + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 80 : 74); // MP not complete else if (!showFusionSuit) - instructionStr = g_MainStringTable->GetString(78); // To enable fusion suit + instructionStr = + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 78 : 72); // To enable fusion suit } else { /* NES Metroid */ if (x39_fusionNotComplete) - instructionStr = g_MainStringTable->GetString(79); // You have not completed fusion + instructionStr = g_MainStringTable->GetString( + (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 79 : 73); // You have not completed fusion else if (!g_GameState->SystemOptions().GetPlayerBeatFusion()) - instructionStr = g_MainStringTable->GetString(77); // To play NES Metroid + instructionStr = + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 77 : 71); // To play NES Metroid } x30_textpane_instructions.SetPairText(instructionStr); } -CFrontEndUI::SFusionBonusFrame::EAction CFrontEndUI::SFusionBonusFrame::ProcessUserInput( - const CFinalInput& input, CSaveGameScreen* sui, CFrontEndUITouchBar::EAction tbAction) { +CFrontEndUI::SFusionBonusFrame::EAction +CFrontEndUI::SFusionBonusFrame::ProcessUserInput(const CFinalInput& input, CSaveGameScreen* sui, + CFrontEndUITouchBar::EAction tbAction) { x8_action = EAction::None; if (sui) @@ -1129,15 +1180,18 @@ void CFrontEndUI::SFrontEndFrame::FinishedLoading() { x1c_gbaPair = FindTextPanePair(x14_loadedFrme, "textpane_gba"); x1c_gbaPair.SetPairText(g_MainStringTable->GetString(37)); x24_cheatPair = FindTextPanePair(x14_loadedFrme, "textpane_cheats"); - x24_cheatPair.SetPairText(g_MainStringTable->GetString(96)); + x24_cheatPair.SetPairText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 96 : 90)); - FindAndSetPairText(x14_loadedFrme, "textpane_start", g_MainStringTable->GetString(67)); - FindAndSetPairText(x14_loadedFrme, "textpane_options", g_MainStringTable->GetString(94)); - FindAndSetPairText(x14_loadedFrme, "textpane_title", g_MainStringTable->GetString(98)); + FindAndSetPairText(x14_loadedFrme, "textpane_start", + g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 67 : 61)); + FindAndSetPairText(x14_loadedFrme, "textpane_options", + 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)); CGuiTextPane* proceed = static_cast(x14_loadedFrme->FindWidget("textpane_proceed")); if (proceed) - proceed->TextSupport().SetText(g_MainStringTable->GetString(85)); + proceed->TextSupport().SetText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 85 : 79)); x18_tablegroup_mainmenu->SetMenuAdvanceCallback([this](CGuiTableGroup* caller) { DoAdvance(caller); }); x18_tablegroup_mainmenu->SetMenuSelectionChangeCallback( @@ -1220,7 +1274,8 @@ void CFrontEndUI::SFrontEndFrame::HandleActiveChange(CGuiTableGroup* active) { active->SetColors(zeus::skWhite, zeus::CColor{0.627450f, 0.627450f, 0.627450f, 0.784313f}); } -void CFrontEndUI::SFrontEndFrame::DoCancel(CGuiTableGroup* caller) { /* Intentionally empty */ } +void CFrontEndUI::SFrontEndFrame::DoCancel(CGuiTableGroup* caller) { /* Intentionally empty */ +} void CFrontEndUI::SFrontEndFrame::DoSelectionChange(CGuiTableGroup* caller, int oldSel) { CSfxManager::SfxStart(SFXfnt_selection_change, 1.f, 0.f, false, 0x7f, false, kInvalidAreaId); @@ -1260,9 +1315,8 @@ CFrontEndUI::SNesEmulatorFrame::SNesEmulatorFrame() { const SObjectTag* deface = g_ResFactory->GetResourceIdByName("FONT_Deface14B"); CGuiTextProperties props(false, true, EJustification::Left, EVerticalJustification::Center); - xc_textSupport = std::make_unique(deface->id, props, zeus::skWhite, zeus::skBlack, - zeus::skWhite, 0, 0, g_SimplePool, - CGuiWidget::EGuiModelDrawFlags::Alpha); + xc_textSupport = std::make_unique(deface->id, props, zeus::skWhite, zeus::skBlack, zeus::skWhite, 0, + 0, g_SimplePool, CGuiWidget::EGuiModelDrawFlags::Alpha); xc_textSupport->SetText(g_MainStringTable->GetString(103)); xc_textSupport->AutoSetExtent(); xc_textSupport->ClearRenderBuffer(); @@ -1529,7 +1583,8 @@ void CFrontEndUI::SOptionsFrontEndFrame::HandleRightSelectionChange() { void CFrontEndUI::SOptionsFrontEndFrame::SetRightUIText() { const int userSel = x24_tablegroup_leftmenu->GetUserSelection(); - const auto& options = GameOptionsRegistry[userSel]; + const auto& options = + (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? GameOptionsRegistry[userSel] : GameOptionsRegistryNew[userSel]; for (int i = 0; i < 5; ++i) { std::string name = fmt::format(FMT_STRING("textpane_right{}"), i); @@ -1578,24 +1633,31 @@ void CFrontEndUI::SOptionsFrontEndFrame::FinishedLoading() { x34_slidergroup_slider->SetSelectionChangedCallback( [this](CGuiSliderGroup* caller, float value) { DoSliderChange(caller, value); }); - FindTextPanePair(x1c_loadedFrame, "textpane_double0").SetPairText(x20_loadedPauseStrg->GetString(95)); // Off - FindTextPanePair(x1c_loadedFrame, "textpane_double1").SetPairText(x20_loadedPauseStrg->GetString(94)); // On - FindTextPanePair(x1c_loadedFrame, "textpane_triple0").SetPairText(x20_loadedPauseStrg->GetString(96)); // Mono - FindTextPanePair(x1c_loadedFrame, "textpane_triple1").SetPairText(x20_loadedPauseStrg->GetString(97)); // Stereo - FindTextPanePair(x1c_loadedFrame, "textpane_triple2").SetPairText(x20_loadedPauseStrg->GetString(98)); // Dolby + FindTextPanePair(x1c_loadedFrame, "textpane_double0") + .SetPairText(x20_loadedPauseStrg->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 95 : 98)); // Off + FindTextPanePair(x1c_loadedFrame, "textpane_double1") + .SetPairText(x20_loadedPauseStrg->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 94 : 97)); // On + FindTextPanePair(x1c_loadedFrame, "textpane_triple0") + .SetPairText(x20_loadedPauseStrg->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 96 : 99)); // Mono + FindTextPanePair(x1c_loadedFrame, "textpane_triple1") + .SetPairText(x20_loadedPauseStrg->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 97 : 100)); // Stereo + FindTextPanePair(x1c_loadedFrame, "textpane_triple2") + .SetPairText(x20_loadedPauseStrg->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 98 : 101)); // Dolby - FindTextPanePair(x1c_loadedFrame, "textpane_title").SetPairText(g_MainStringTable->GetString(99)); // OPTIONS + FindTextPanePair(x1c_loadedFrame, "textpane_title") + .SetPairText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 99 : 93)); // OPTIONS if (CGuiTextPane* proceed = static_cast(x1c_loadedFrame->FindWidget("textpane_proceed"))) - proceed->TextSupport().SetText(g_MainStringTable->GetString(85)); + proceed->TextSupport().SetText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 85 : 79)); if (CGuiTextPane* cancel = static_cast(x1c_loadedFrame->FindWidget("textpane_cancel"))) - cancel->TextSupport().SetText(g_MainStringTable->GetString(82)); + cancel->TextSupport().SetText(g_MainStringTable->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 82 : 76)); // Visor, Display, Sound, Controller for (int i = 0; i < 4; ++i) { const std::string name = fmt::format(FMT_STRING("textpane_filename{}"), i); - FindTextPanePair(x1c_loadedFrame, name).SetPairText(x20_loadedPauseStrg->GetString(16 + i)); + FindTextPanePair(x1c_loadedFrame, name) + .SetPairText(x20_loadedPauseStrg->GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 16 : 18 + i)); } x2c_tablegroup_double->SetVertical(false); @@ -1766,7 +1828,9 @@ void CFrontEndUI::StartSlideShow(CArchitectureQueue& queue) { queue.Push(MakeMsg::CreateCreateIOWin(EArchMsgTarget::IOWinManager, 12, 11, std::make_shared())); } -std::string CFrontEndUI::GetAttractMovieFileName(int idx) { return fmt::format(FMT_STRING("Video/attract{}.thp"), idx); } +std::string CFrontEndUI::GetAttractMovieFileName(int idx) { + return fmt::format(FMT_STRING("Video/attract{}.thp"), idx); +} std::string CFrontEndUI::GetNextAttractMovieFileName() { std::string ret = GetAttractMovieFileName(xbc_nextAttract); @@ -2091,10 +2155,8 @@ void CFrontEndUI::ProcessUserInput(const CFinalInput& input, CArchitectureQueue& if (x50_curScreen != x54_nextScreen) { if (x54_nextScreen == EScreen::AttractMovie && - (input.PStart() || input.PA() || - input.PSpecialKey(boo::ESpecialKey::Esc) || - input.PSpecialKey(boo::ESpecialKey::Enter) || - input.PMouseButton(boo::EMouseButton::Primary) || + (input.PStart() || input.PA() || input.PSpecialKey(boo::ESpecialKey::Esc) || + input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || touchBarAction == CFrontEndUITouchBar::EAction::Start)) { /* Player wants to return to opening credits from attract movie */ SetFadeBlackTimer(std::min(1.f, x58_fadeBlackTimer)); @@ -2102,10 +2164,8 @@ void CFrontEndUI::ProcessUserInput(const CFinalInput& input, CArchitectureQueue& return; } - if (input.PA() || input.PStart() || - input.PSpecialKey(boo::ESpecialKey::Esc) || - input.PSpecialKey(boo::ESpecialKey::Enter) || - input.PMouseButton(boo::EMouseButton::Primary) || + if (input.PA() || input.PStart() || input.PSpecialKey(boo::ESpecialKey::Esc) || + input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || touchBarAction == CFrontEndUITouchBar::EAction::Start) { if (x50_curScreen == EScreen::OpenCredits && x54_nextScreen == EScreen::Title && x58_fadeBlackTimer > 1.f) { /* Player is too impatient to view opening credits */ @@ -2116,10 +2176,8 @@ void CFrontEndUI::ProcessUserInput(const CFinalInput& input, CArchitectureQueue& } } else { if (x50_curScreen == EScreen::Title) { - if (input.PStart() || input.PA() || - input.PSpecialKey(boo::ESpecialKey::Esc) || - input.PSpecialKey(boo::ESpecialKey::Enter) || - input.PMouseButton(boo::EMouseButton::Primary) || + if (input.PStart() || input.PA() || input.PSpecialKey(boo::ESpecialKey::Esc) || + input.PSpecialKey(boo::ESpecialKey::Enter) || input.PMouseButton(boo::EMouseButton::Primary) || touchBarAction == CFrontEndUITouchBar::EAction::Start) { if (x58_fadeBlackTimer < 30.f - g_tweakGame->GetPressStartDelay()) { /* Proceed to file select UI */ diff --git a/Runtime/MP1/CInventoryScreen.cpp b/Runtime/MP1/CInventoryScreen.cpp index 55bc9e012..47082ad3c 100644 --- a/Runtime/MP1/CInventoryScreen.cpp +++ b/Runtime/MP1/CInventoryScreen.cpp @@ -286,7 +286,7 @@ bool CInventoryScreen::HasLeftInventoryItem(int idx) const { void CInventoryScreen::VActivate() { for (int i = 0; i < 5; ++i) { if (HasLeftInventoryItem(i)) { - if (g_Main->IsUSA()) { + if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 10)); } else { xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 12)); @@ -297,7 +297,7 @@ void CInventoryScreen::VActivate() { } } - if (g_Main->IsUSA()) { + if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { x178_textpane_title->TextSupport().SetText(xc_pauseStrg.GetString(9)); } else { x178_textpane_title->TextSupport().SetText(xc_pauseStrg.GetString(11)); @@ -311,12 +311,12 @@ void CInventoryScreen::UpdateTextBody() { x1ac_textLeaveRequested = false; const SInventoryItem& sel = InventoryRegistry[x70_tablegroup_leftlog->GetUserSelection()].second[x1c_rightSel]; - std::u16string entryText = xc_pauseStrg.GetString(g_Main->IsUSA() ? sel.entryStrIdx : sel.entryStrIdx + 3); + std::u16string entryText = xc_pauseStrg.GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? sel.entryStrIdx : sel.entryStrIdx + 3); if (sel.idx == 23) // Beam combo { CPlayerState& playerState = *x4_mgr.GetPlayerState(); - if (g_Main->IsUSA()) { + if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { entryText += xc_pauseStrg.GetString(playerState.HasPowerUp(CPlayerState::EItemType::SuperMissile) ? 71 : 65); entryText += xc_pauseStrg.GetString(playerState.HasPowerUp(CPlayerState::EItemType::IceSpreader) ? 73 : 65); entryText += xc_pauseStrg.GetString(playerState.HasPowerUp(CPlayerState::EItemType::Wavebuster) ? 75 : 65); @@ -467,7 +467,7 @@ void CInventoryScreen::UpdateRightTable() { CGuiTextPane* title = xd8_textpane_titles[i]; if (i < int(size)) { if (HasRightInventoryItem(data[i].idx)) { - title->TextSupport().SetText(xc_pauseStrg.GetString(g_Main->IsUSA() ? data[i].nameStrIdx : data[i].nameStrIdx + 3)); + title->TextSupport().SetText(xc_pauseStrg.GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? data[i].nameStrIdx : data[i].nameStrIdx + 3)); x84_tablegroup_rightlog->GetWorkerWidget(i + 1)->SetIsSelectable(true); if (i < minSel) minSel = i; diff --git a/Runtime/MP1/CLogBookScreen.cpp b/Runtime/MP1/CLogBookScreen.cpp index b4f0e5549..f469b1722 100644 --- a/Runtime/MP1/CLogBookScreen.cpp +++ b/Runtime/MP1/CLogBookScreen.cpp @@ -200,10 +200,11 @@ void CLogBookScreen::UpdateBodyText() { if (IsArtifactCategorySelected()) { const int headIdx = GetSelectedArtifactHeadScanIndex(); if (headIdx >= 0 && g_GameState->GetPlayerState()->HasPowerUp(CPlayerState::EItemType(headIdx + 29))) { - if (g_Main->IsUSA()) + if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { accumStr = std::u16string(u"\n\n\n\n\n\n").append(g_MainStringTable->GetString(105)); - else + } else { accumStr = std::u16string(u"\n\n\n\n\n\n").append(g_MainStringTable->GetString(107)); + } } } diff --git a/Runtime/MP1/COptionsScreen.cpp b/Runtime/MP1/COptionsScreen.cpp index 442204ebf..ae175de5f 100644 --- a/Runtime/MP1/COptionsScreen.cpp +++ b/Runtime/MP1/COptionsScreen.cpp @@ -179,14 +179,15 @@ bool COptionsScreen::VReady() const { return true; } void COptionsScreen::VActivate() { for (int i = 0; i < 5; ++i) { - if (g_Main->IsUSA()) { + if (g_Main->IsUSA() && !g_Main->IsTrilogy()) { xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 16)); } else { xa8_textpane_categories[i]->TextSupport().SetText(xc_pauseStrg.GetString(i + 18)); } } - x178_textpane_title->TextSupport().SetText(xc_pauseStrg.GetString(g_Main->IsUSA() ? 15 : 17)); + x178_textpane_title->TextSupport().SetText( + xc_pauseStrg.GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 15 : 17)); #if 0 for (int i=5 ; i<5 ; ++i) @@ -196,7 +197,7 @@ void COptionsScreen::VActivate() { x174_textpane_body->TextSupport().SetJustification(EJustification::Center); x174_textpane_body->TextSupport().SetVerticalJustification(EVerticalJustification::Bottom); - int stringOffset = g_Main->IsUSA() ? 0 : 3; + int stringOffset = (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 0 : 3; static_cast(x190_tablegroup_double->GetWorkerWidget(0)) ->TextSupport() .SetText(xc_pauseStrg.GetString(95 + stringOffset)); @@ -237,8 +238,8 @@ void COptionsScreen::ChangedMode(EMode oldMode) { void COptionsScreen::UpdateRightTable() { CPauseScreenBase::UpdateRightTable(); const std::pair& category = - g_Main->IsUSA() ? GameOptionsRegistry[x70_tablegroup_leftlog->GetUserSelection()] - : GameOptionsRegistryNew[x70_tablegroup_leftlog->GetUserSelection()]; + (g_Main->IsUSA() && !g_Main->IsTrilogy()) ? GameOptionsRegistry[x70_tablegroup_leftlog->GetUserSelection()] + : GameOptionsRegistryNew[x70_tablegroup_leftlog->GetUserSelection()]; for (int i = 0; i < 5; ++i) { if (i < category.first) { xd8_textpane_titles[i]->TextSupport().SetText(xc_pauseStrg.GetString(category.second[i].stringId)); diff --git a/Runtime/MP1/CPauseScreenBase.cpp b/Runtime/MP1/CPauseScreenBase.cpp index 07712a349..caf457b95 100644 --- a/Runtime/MP1/CPauseScreenBase.cpp +++ b/Runtime/MP1/CPauseScreenBase.cpp @@ -81,7 +81,7 @@ void CPauseScreenBase::InitializeFrameGlue() { x184_textpane_yicon = static_cast(x8_frame.FindWidget("textpane_yicon")); x188_textpane_ytext = static_cast(x8_frame.FindWidget("textpane_ytext")); x184_textpane_yicon->TextSupport().SetText(fmt::format(FMT_STRING(u"&image={};"), g_tweakPlayerRes->xbc_yButton[0])); - x188_textpane_ytext->TextSupport().SetText(xc_pauseStrg.GetString(g_Main->IsUSA() ? 99 : 102)); + x188_textpane_ytext->TextSupport().SetText(xc_pauseStrg.GetString((g_Main->IsUSA() && !g_Main->IsTrilogy()) ? 99 : 102)); x188_textpane_ytext->SetColor(g_tweakGuiColors->GetPauseItemAmberColor()); x18c_slidergroup_slider = static_cast(x8_frame.FindWidget("slidergroup_slider")); x18c_slidergroup_slider->SetMouseActive(true);