FSUI: Add option to open Game List directly on startup

This commit is contained in:
KamFretoZ authored and Ty committed 2025-06-29 16:56:01 -04:00
1 parent 806ab5ad01
commit a53fdfae82
1 file changed
+18 -9
+18 -9
View File
@@ -308,6 +308,8 @@ namespace FullscreenUI
static void ConfirmShutdownIfMemcardBusy(std::function<void(bool)> 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<void(bool)> 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<u32>(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();