From 43e792fb71a3d4606dedf701f38a239e83537ba6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 11 Sep 2023 10:47:34 +0200 Subject: [PATCH 1/2] Move RetroAchievements to the Tools tab. --- Common/UI/PopupScreens.cpp | 2 ++ UI/GameSettingsScreen.cpp | 57 +++++++++++++++----------------------- UI/GameSettingsScreen.h | 5 ---- 3 files changed, 25 insertions(+), 39 deletions(-) diff --git a/Common/UI/PopupScreens.cpp b/Common/UI/PopupScreens.cpp index 61a07895a74a..220337b0682e 100644 --- a/Common/UI/PopupScreens.cpp +++ b/Common/UI/PopupScreens.cpp @@ -128,6 +128,8 @@ void PopupMultiChoice::UpdateText() { void PopupMultiChoice::ChoiceCallback(int num) { if (num != -1) { + _assert_(value_ != nullptr); + *value_ = num + minVal_; UpdateText(); diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 916e92adf945..b150c85f2e1d 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -894,11 +894,30 @@ void GameSettingsScreen::CreateToolsSettings(UI::ViewGroup *tools) { auto ri = GetI18NCategory(I18NCat::REMOTEISO); tools->Add(new ItemHeader(ms->T("Tools"))); + + auto retro = tools->Add(new Choice(sy->T("RetroAchievements"))); + retro->OnClick.Add([=](UI::EventParams &) -> UI::EventReturn { + screenManager()->push(new RetroAchievementsSettingsScreen(gamePath_)); + return UI::EVENT_DONE; + }); + retro->SetIcon(ImageID("I_RETROACHIEVEMENTS_LOGO")); // These were moved here so use the wrong translation objects, to avoid having to change all inis... This isn't a sustainable situation :P - tools->Add(new Choice(sa->T("Savedata Manager")))->OnClick.Handle(this, &GameSettingsScreen::OnSavedataManager); - tools->Add(new Choice(dev->T("System Information")))->OnClick.Handle(this, &GameSettingsScreen::OnSysInfo); - tools->Add(new Choice(sy->T("Developer Tools")))->OnClick.Handle(this, &GameSettingsScreen::OnDeveloperTools); - tools->Add(new Choice(ri->T("Remote disc streaming")))->OnClick.Handle(this, &GameSettingsScreen::OnRemoteISO); + tools->Add(new Choice(sa->T("Savedata Manager")))->OnClick.Add([=](UI::EventParams &) { + screenManager()->push(new SavedataScreen(gamePath_)); + return UI::EVENT_DONE; + }); + tools->Add(new Choice(dev->T("System Information")))->OnClick.Add([=](UI::EventParams &) { + screenManager()->push(new SystemInfoScreen(gamePath_)); + return UI::EVENT_DONE; + }); + tools->Add(new Choice(sy->T("Developer Tools")))->OnClick.Add([=](UI::EventParams &) { + screenManager()->push(new DeveloperToolsScreen(gamePath_)); + return UI::EVENT_DONE; + }); + tools->Add(new Choice(ri->T("Remote disc streaming")))->OnClick.Add([=](UI::EventParams &) { + screenManager()->push(new RemoteISOScreen(gamePath_)); + return UI::EVENT_DONE; + }); } void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) { @@ -910,15 +929,6 @@ void GameSettingsScreen::CreateSystemSettings(UI::ViewGroup *systemSettings) { auto th = GetI18NCategory(I18NCat::THEMES); auto psps = GetI18NCategory(I18NCat::PSPSETTINGS); // TODO: Should move more into this section. - systemSettings->Add(new ItemHeader(sy->T("RetroAchievements"))); - auto retro = systemSettings->Add(new Choice(sy->T("RetroAchievements"))); - - retro->OnClick.Add([&](UI::EventParams &) -> UI::EventReturn { - screenManager()->push(new RetroAchievementsSettingsScreen(gamePath_)); - return UI::EVENT_DONE; - }); - retro->SetIcon(ImageID("I_RETROACHIEVEMENTS_LOGO")); - systemSettings->Add(new ItemHeader(sy->T("UI"))); auto langCodeToName = [](const char *value) -> std::string { @@ -1582,16 +1592,6 @@ UI::EventReturn GameSettingsScreen::OnTextureShaderChange(UI::EventParams &e) { return UI::EVENT_DONE; } -UI::EventReturn GameSettingsScreen::OnDeveloperTools(UI::EventParams &e) { - screenManager()->push(new DeveloperToolsScreen(gamePath_)); - return UI::EVENT_DONE; -} - -UI::EventReturn GameSettingsScreen::OnRemoteISO(UI::EventParams &e) { - screenManager()->push(new RemoteISOScreen(gamePath_)); - return UI::EVENT_DONE; -} - UI::EventReturn GameSettingsScreen::OnControlMapping(UI::EventParams &e) { screenManager()->push(new ControlMappingScreen(gamePath_)); return UI::EVENT_DONE; @@ -1612,17 +1612,6 @@ UI::EventReturn GameSettingsScreen::OnTiltCustomize(UI::EventParams &e) { return UI::EVENT_DONE; }; -UI::EventReturn GameSettingsScreen::OnSavedataManager(UI::EventParams &e) { - auto saveData = new SavedataScreen(gamePath_); - screenManager()->push(saveData); - return UI::EVENT_DONE; -} - -UI::EventReturn GameSettingsScreen::OnSysInfo(UI::EventParams &e) { - screenManager()->push(new SystemInfoScreen(gamePath_)); - return UI::EVENT_DONE; -} - void DeveloperToolsScreen::CreateViews() { using namespace UI; root_ = new LinearLayout(ORIENT_VERTICAL, new LayoutParams(FILL_PARENT, FILL_PARENT)); diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index 14dd4af8e563..4c83715cf21f 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -83,8 +83,6 @@ class GameSettingsScreen : public TabbedUIDialogScreenWithGameBackground { UI::EventReturn OnAutoFrameskip(UI::EventParams &e); UI::EventReturn OnTextureShader(UI::EventParams &e); UI::EventReturn OnTextureShaderChange(UI::EventParams &e); - UI::EventReturn OnDeveloperTools(UI::EventParams &e); - UI::EventReturn OnRemoteISO(UI::EventParams &e); UI::EventReturn OnChangeQuickChat0(UI::EventParams &e); UI::EventReturn OnChangeQuickChat1(UI::EventParams &e); UI::EventReturn OnChangeQuickChat2(UI::EventParams &e); @@ -115,9 +113,6 @@ class GameSettingsScreen : public TabbedUIDialogScreenWithGameBackground { UI::EventReturn OnAdhocGuides(UI::EventParams &e); - UI::EventReturn OnSavedataManager(UI::EventParams &e); - UI::EventReturn OnSysInfo(UI::EventParams &e); - // Temporaries to convert setting types, cache enabled, etc. int iAlternateSpeedPercent1_ = 0; int iAlternateSpeedPercent2_ = 0; From 5fcca7d9f5d938226316d91119e3a11e5560c073 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Mon, 11 Sep 2023 10:47:59 +0200 Subject: [PATCH 2/2] Fix customization of Leaderboard Submitted events. See #17631 --- Common/System/OSD.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/System/OSD.cpp b/Common/System/OSD.cpp index d57c2687dcd2..7d0eb9a4812c 100644 --- a/Common/System/OSD.cpp +++ b/Common/System/OSD.cpp @@ -221,7 +221,7 @@ void OnScreenDisplay::ShowLeaderboardStartEnd(const std::string &title, const st } void OnScreenDisplay::ShowLeaderboardSubmitted(const std::string &title, const std::string &value) { - g_OSD.Show(OSDType::MESSAGE_SUCCESS, title, value, 3.0f); + g_OSD.Show(OSDType::LEADERBOARD_SUBMITTED, title, value, 3.0f); } void OnScreenDisplay::SetProgressBar(std::string id, std::string &&message, float minValue, float maxValue, float progress, float delay) {