diff --git a/UnleashedRecomp/patches/CHudPause_patches.cpp b/UnleashedRecomp/patches/CHudPause_patches.cpp index 45a47f7..c04bd95 100644 --- a/UnleashedRecomp/patches/CHudPause_patches.cpp +++ b/UnleashedRecomp/patches/CHudPause_patches.cpp @@ -163,7 +163,7 @@ PPC_FUNC(sub_824B0930) if (*SWA::SGlobals::ms_IsRenderHud && pHudPause->m_IsShown && !pHudPause->m_Submenu && pHudPause->m_Transition == SWA::eTransitionType_Undefined) { - ButtonGuide::Open(Button(Localise("Achievements_Name"), EButtonIcon::Back, EButtonAlignment::Left, EFontQuality::Low)); + ButtonGuide::Open(Button("Achievements_Name", EButtonIcon::Back, EButtonAlignment::Left, EFontQuality::Low)); g_isClosed = false; } else if (!g_isClosed) diff --git a/UnleashedRecomp/ui/achievement_menu.cpp b/UnleashedRecomp/ui/achievement_menu.cpp index a42dc22..4c0068d 100644 --- a/UnleashedRecomp/ui/achievement_menu.cpp +++ b/UnleashedRecomp/ui/achievement_menu.cpp @@ -778,7 +778,7 @@ void AchievementMenu::Open() return std::get<1>(a) > std::get<1>(b); }); - ButtonGuide::Open(Button(Localise("Common_Back"), EButtonIcon::B)); + ButtonGuide::Open(Button("Common_Back", EButtonIcon::B)); ResetSelection(); Game_PlaySound("sys_actstg_pausewinopen"); diff --git a/UnleashedRecomp/ui/button_guide.cpp b/UnleashedRecomp/ui/button_guide.cpp index d81db82..c65c6b0 100644 --- a/UnleashedRecomp/ui/button_guide.cpp +++ b/UnleashedRecomp/ui/button_guide.cpp @@ -260,9 +260,10 @@ void ButtonGuide::Draw() if (btn.Visibility && !*btn.Visibility) continue; + auto str = Localise(btn.Name.c_str()).c_str(); auto iconWidth = Scale(g_iconWidths[btn.Icon]); auto iconHeight = Scale(g_iconHeights[btn.Icon]); - auto textSize = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, btn.Name.c_str()); + auto textSize = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str); if (i > 0) offsetLeft += textSize.x + iconWidth + textMarginX; @@ -270,7 +271,7 @@ void ButtonGuide::Draw() ImVec2 iconMin = { regionMin.x + offsetLeft - iconWidth - iconMarginX, regionMin.y }; ImVec2 iconMax = { regionMin.x + offsetLeft - iconMarginX, regionMin.y + iconHeight }; - DrawGuide(&offsetLeft, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textSize, fontSize, btn.Name.c_str()); + DrawGuide(&offsetLeft, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textSize, fontSize, str); } // Draw right aligned icons. @@ -284,9 +285,10 @@ void ButtonGuide::Draw() if (btn.Visibility && !*btn.Visibility) continue; + auto str = Localise(btn.Name.c_str()).c_str(); auto iconWidth = Scale(g_iconWidths[btn.Icon]); auto iconHeight = Scale(g_iconHeights[btn.Icon]); - auto textSize = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, btn.Name.c_str()); + auto textSize = g_fntNewRodin->CalcTextSizeA(fontSize, FLT_MAX, 0, str); if (i < g_buttons.size() - 1) offsetRight += textSize.x + iconWidth + textMarginX; @@ -294,7 +296,7 @@ void ButtonGuide::Draw() ImVec2 iconMin = { regionMax.x - offsetRight - iconWidth - iconMarginX, regionMin.y }; ImVec2 iconMax = { regionMax.x - offsetRight - iconMarginX, regionMin.y + iconHeight }; - DrawGuide(&offsetRight, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textSize, fontSize, btn.Name.c_str()); + DrawGuide(&offsetRight, regionMin, regionMax, btn.Icon, btn.Alignment, iconMin, iconMax, btn.FontQuality, textSize, fontSize, str); } } diff --git a/UnleashedRecomp/ui/installer_wizard.cpp b/UnleashedRecomp/ui/installer_wizard.cpp index 6ccfacd..765c567 100644 --- a/UnleashedRecomp/ui/installer_wizard.cpp +++ b/UnleashedRecomp/ui/installer_wizard.cpp @@ -863,7 +863,7 @@ static void DrawDescriptionContainer() if (g_currentPage == WizardPage::InstallSucceeded && textAlpha >= 1.0) { - ButtonGuide::Open(Button(Localise("Common_Select"), selectIcon)); + ButtonGuide::Open(Button("Common_Select", selectIcon)); } else if (g_currentPage != WizardPage::Installing && textAlpha >= 1.0) { @@ -875,15 +875,15 @@ static void DrawDescriptionContainer() std::array buttons = { - Button(Localise("Common_Select"), selectIcon), - Button(Localise(backKey), backIcon) + Button("Common_Select", selectIcon), + Button(backKey, backIcon) }; ButtonGuide::Open(buttons); } else if (g_currentPage == WizardPage::Installing) { - ButtonGuide::Open(Button(Localise("Common_Cancel"), backIcon)); + ButtonGuide::Open(Button("Common_Cancel", backIcon)); } else { diff --git a/UnleashedRecomp/ui/message_window.cpp b/UnleashedRecomp/ui/message_window.cpp index 7249178..2b289a9 100644 --- a/UnleashedRecomp/ui/message_window.cpp +++ b/UnleashedRecomp/ui/message_window.cpp @@ -245,7 +245,7 @@ void DrawNextButtonGuide(bool isController, bool isKeyboard) if (App::s_isInit) icon = EButtonIcon::A; - ButtonGuide::Open(Button(Localise("Common_Next"), icon)); + ButtonGuide::Open(Button("Common_Next", icon)); } static void ResetSelection() @@ -425,8 +425,8 @@ void MessageWindow::Draw() std::array buttons = { - Button(Localise("Common_Select"), selectIcon), - Button(Localise("Common_Back"), backIcon), + Button("Common_Select", selectIcon), + Button("Common_Back", backIcon), }; ButtonGuide::Open(buttons); diff --git a/UnleashedRecomp/ui/options_menu.cpp b/UnleashedRecomp/ui/options_menu.cpp index 30589c7..2008383 100644 --- a/UnleashedRecomp/ui/options_menu.cpp +++ b/UnleashedRecomp/ui/options_menu.cpp @@ -1737,10 +1737,10 @@ void OptionsMenu::Open(bool isPause, SWA::EMenuType pauseMenuType) std::array buttons = { - Button(Localise("Common_Switch"), EButtonIcon::LBRB, EButtonAlignment::Left, &g_isControlsVisible), - Button(Localise("Common_Reset"), EButtonIcon::X, &g_canReset), - Button(Localise("Common_Select"), EButtonIcon::A, &g_isControlsVisible), - Button(Localise("Common_Back"), EButtonIcon::B, &g_isControlsVisible) + Button("Common_Switch", EButtonIcon::LBRB, EButtonAlignment::Left, &g_isControlsVisible), + Button("Common_Reset", EButtonIcon::X, &g_canReset), + Button("Common_Select", EButtonIcon::A, &g_isControlsVisible), + Button("Common_Back", EButtonIcon::B, &g_isControlsVisible) }; ButtonGuide::Open(buttons);