FullscreenUI: Switch to list page on settings open from game list

pull/3766/head
Stenzek 3 months ago
parent 3968606be4
commit e2a654715a
No known key found for this signature in database

@ -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")))
{

@ -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))
{

@ -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);

@ -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)

Loading…
Cancel
Save