diff --git a/src/core/fullscreenui.cpp b/src/core/fullscreenui.cpp index a4d3d2549..3e9ac8546 100644 --- a/src/core/fullscreenui.cpp +++ b/src/core/fullscreenui.cpp @@ -1378,7 +1378,7 @@ void FullscreenUI::DrawLandingWindow() if (UserThemeableHorizontalButton("fullscreenui/settings.png", "fullscreenui/settings.svg", FSUI_VSTR("Settings"), FSUI_VSTR("Changes settings for the application."))) { - BeginTransition(TransitionEffect::ZoomIn, DEFAULT_TRANSITION_TIME, &SwitchToSettings); + BeginTransition(TransitionEffect::ZoomIn, DEFAULT_TRANSITION_TIME, []() { SwitchToSettings(); }); } if (UserThemeableHorizontalButton("fullscreenui/exit.png", "fullscreenui/exit.svg", FSUI_VSTR("Exit"), @@ -1746,7 +1746,7 @@ void FullscreenUI::DrawPauseMenu() Host::RunOnCoreThread([]() { BeginChangeDiscOnCoreThread(false); }); if (MenuButtonWithoutSummary(FSUI_ICONVSTR(ICON_FA_SLIDERS, "Settings"))) - BeginTransition(TransitionEffect::ZoomIn, DEFAULT_TRANSITION_TIME, &SwitchToSettings); + BeginTransition(TransitionEffect::ZoomIn, DEFAULT_TRANSITION_TIME, []() { SwitchToSettings(); }); if (MenuButtonWithoutSummary(FSUI_ICONVSTR(ICON_FA_POWER_OFF, "Close Game"))) { diff --git a/src/core/fullscreenui_game_list.cpp b/src/core/fullscreenui_game_list.cpp index b1cb8e31f..a1a6763ab 100644 --- a/src/core/fullscreenui_game_list.cpp +++ b/src/core/fullscreenui_game_list.cpp @@ -390,7 +390,11 @@ void FullscreenUI::DrawGameListWindow() else if (ImGui::IsKeyPressed(ImGuiKey_GamepadBack, false) || ImGui::IsKeyPressed(ImGuiKey_F2, false)) { EnqueueSoundEffect(SFX_NAV_BACK); - BeginTransition(&SwitchToSettings); + BeginTransition(TransitionEffect::ZoomIn, DEFAULT_TRANSITION_TIME, []() { + // if we're opening to game list, use the main page, otherwise game list settings + const SettingsPage page = ShouldOpenToGameList() ? SettingsPage::Interface : SettingsPage::GameList; + FullscreenUI::SwitchToSettings(page); + }); } else if (ImGui::IsKeyPressed(ImGuiKey_GamepadStart, false) || ImGui::IsKeyPressed(ImGuiKey_F5, false)) { diff --git a/src/core/fullscreenui_private.h b/src/core/fullscreenui_private.h index 878229238..595cf0662 100644 --- a/src/core/fullscreenui_private.h +++ b/src/core/fullscreenui_private.h @@ -111,7 +111,7 @@ void RemoveCoverCacheEntry(const std::string& path); ////////////////////////////////////////////////////////////////////////// void ClearSettingsState(); -void SwitchToSettings(); +void SwitchToSettings(SettingsPage page = SettingsPage::Interface); bool SwitchToGameSettings(SettingsPage page = SettingsPage::Summary); void SwitchToGameSettings(const GameList::Entry* entry, SettingsPage page = SettingsPage::Summary); bool SwitchToGameSettingsForPath(const std::string& path, SettingsPage page = SettingsPage::Summary); diff --git a/src/core/fullscreenui_settings.cpp b/src/core/fullscreenui_settings.cpp index c8b487bd5..d96a9134d 100644 --- a/src/core/fullscreenui_settings.cpp +++ b/src/core/fullscreenui_settings.cpp @@ -1689,7 +1689,7 @@ void FullscreenUI::ClearSettingsState() s_settings_locals.image_track_summary = {}; } -void FullscreenUI::SwitchToSettings() +void FullscreenUI::SwitchToSettings(SettingsPage page /* = SettingsPage::Interface */) { s_settings_locals.game_settings_entry.reset(); s_settings_locals.game_settings_interface.reset(); @@ -1711,7 +1711,7 @@ void FullscreenUI::SwitchToSettings() PopulatePostProcessingChain(*sif, PostProcessing::Config::DISPLAY_CHAIN_SECTION); SwitchToMainWindow(MainWindowType::Settings); - s_settings_locals.settings_page = SettingsPage::Interface; + s_settings_locals.settings_page = page; } bool FullscreenUI::SwitchToGameSettings(SettingsPage page)