From a53fdfae82189f8fef22d7c006ef4edd115b4064 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Sun, 15 Jun 2025 20:37:06 +0700 Subject: [PATCH] FSUI: Add option to open Game List directly on startup --- pcsx2/ImGui/FullscreenUI.cpp | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/pcsx2/ImGui/FullscreenUI.cpp b/pcsx2/ImGui/FullscreenUI.cpp index 57551b3b45..b9b4b224a5 100644 --- a/pcsx2/ImGui/FullscreenUI.cpp +++ b/pcsx2/ImGui/FullscreenUI.cpp @@ -308,6 +308,8 @@ namespace FullscreenUI static void ConfirmShutdownIfMemcardBusy(std::function callback); + static bool ShouldDefaultToGameList(); + ////////////////////////////////////////////////////////////////////////// // Settings ////////////////////////////////////////////////////////////////////////// @@ -780,9 +782,9 @@ bool FullscreenUI::Initialize() } else { - // only switch to landing if we weren't e.g. in settings - if (s_current_main_window == MainWindowType::None) - SwitchToLanding(); + const bool open_main_window = s_current_main_window == MainWindowType::None; + if (open_main_window) + ReturnToMainWindow(); } ForceKeyNavEnabled(); @@ -866,7 +868,7 @@ void FullscreenUI::OnVMDestroyed() s_pause_menu_was_open = false; s_was_paused_on_quick_menu_open = false; s_current_pause_submenu = PauseSubMenu::None; - SwitchToLanding(); + ReturnToMainWindow(); }); } @@ -1116,7 +1118,7 @@ void FullscreenUI::ReturnToPreviousWindow() void FullscreenUI::ReturnToMainWindow() { ClosePauseMenu(); - s_current_main_window = VMManager::HasValidVM() ? MainWindowType::None : MainWindowType::Landing; + s_current_main_window = VMManager::HasValidVM() ? MainWindowType::None : (ShouldDefaultToGameList() ? MainWindowType::GameList : MainWindowType::Landing); } bool FullscreenUI::LoadResources() @@ -1372,6 +1374,11 @@ void FullscreenUI::ConfirmShutdownIfMemcardBusy(std::function callba std::move(callback)); } +bool FullscreenUI::ShouldDefaultToGameList() +{ + return Host::GetBaseBoolSettingValue("UI", "FullscreenUIDefaultToGameList", false); +} + ////////////////////////////////////////////////////////////////////////// // Landing Window ////////////////////////////////////////////////////////////////////////// @@ -3168,7 +3175,7 @@ void FullscreenUI::DrawSettingsWindow() } if (NavButton(ICON_PF_BACKWARD, true, true)) - ReturnToMainWindow(); + SwitchToLanding(); if (s_game_settings_entry) { @@ -3460,6 +3467,8 @@ void FullscreenUI::DrawInterfaceSettingsPage() DrawStringListSetting(bsi, FSUI_ICONSTR(ICON_FA_PAINT_BRUSH, "Theme"), FSUI_CSTR("Selects the color style to be used for Big Picture Mode."), "UI", "FullscreenUITheme", "Dark", s_theme_name, s_theme_value, std::size(s_theme_name), true); + DrawToggleSetting( + bsi, FSUI_ICONSTR(ICON_FA_LIST, "Default To Game List"), FSUI_CSTR("When Big Picture mode is started, the game list will be displayed instead of the main menu."), "UI", "FullscreenUIDefaultToGameList", false); DrawToggleSetting(bsi, FSUI_ICONSTR(ICON_FA_INFO_CIRCLE, "Use Save State Selector"), FSUI_CSTR("Show a save state selector UI when switching slots instead of showing a notification bubble."), "EmuCore", "UseSavestateSelector", true); @@ -6357,7 +6366,7 @@ void FullscreenUI::DrawGameListWindow() BeginNavBar(); if (NavButton(ICON_PF_BACKWARD, true, true)) - ReturnToPreviousWindow(); + SwitchToLanding(); NavTitle(Host::TranslateToCString(TR_CONTEXT, titles[static_cast(s_game_list_view)])); RightAlignNavButtons(count, ITEM_WIDTH, LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY); @@ -6445,7 +6454,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size) } if (!AreAnyDialogsOpen() && WantsToCloseMenu()) - ReturnToPreviousWindow(); + SwitchToLanding(); const GameList::Entry* selected_entry = nullptr; @@ -6652,7 +6661,7 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size) } if (!AreAnyDialogsOpen() && WantsToCloseMenu()) - ReturnToPreviousWindow(); + SwitchToLanding(); ResetFocusHere(); BeginMenuButtons();