@@ -164,7 +164,6 @@ enum class MainWindowType : u8
164164 StartGame,
165165 Exit,
166166 GameList,
167- GameListSettings,
168167 Settings,
169168 PauseMenu,
170169 Achievements,
@@ -182,6 +181,7 @@ enum class SettingsPage : u8
182181{
183182 Summary,
184183 Interface,
184+ GameList,
185185 Console,
186186 Emulation,
187187 BIOS,
@@ -444,7 +444,7 @@ static void DrawGameGrid(const ImVec2& heading_size);
444444static void HandleGameListActivate (const GameList::Entry* entry);
445445static void HandleGameListOptions (const GameList::Entry* entry);
446446static void HandleSelectDiscForDiscSet (std::string_view disc_set_name);
447- static void DrawGameListSettingsWindow ();
447+ static void DrawGameListSettingsPage ();
448448static void SwitchToGameList ();
449449static void PopulateGameListEntryList ();
450450static GPUTexture* GetTextureForGameListEntryType (GameList::EntryType type);
@@ -971,9 +971,6 @@ void FullscreenUI::Render()
971971 case MainWindowType::GameList:
972972 DrawGameListWindow ();
973973 break ;
974- case MainWindowType::GameListSettings:
975- DrawGameListSettingsWindow ();
976- break ;
977974 case MainWindowType::Settings:
978975 DrawSettingsWindow ();
979976 break ;
@@ -3423,16 +3420,18 @@ void FullscreenUI::DrawSettingsWindow()
34233420 static constexpr float ITEM_WIDTH = 25 .0f ;
34243421
34253422 static constexpr const SettingsPage global_pages[] = {
3426- SettingsPage::Interface, SettingsPage::Console, SettingsPage::Emulation, SettingsPage::BIOS,
3427- SettingsPage::Graphics, SettingsPage::PostProcessing, SettingsPage::Audio, SettingsPage::Controller,
3428- SettingsPage::Hotkey, SettingsPage::MemoryCards, SettingsPage::Achievements, SettingsPage::Advanced};
3423+ SettingsPage::Interface, SettingsPage::GameList, SettingsPage::Console, SettingsPage::Emulation,
3424+ SettingsPage::BIOS, SettingsPage::Graphics, SettingsPage::PostProcessing, SettingsPage::Audio,
3425+ SettingsPage::Controller, SettingsPage::Hotkey, SettingsPage::MemoryCards, SettingsPage::Achievements,
3426+ SettingsPage::Advanced};
34293427 static constexpr const SettingsPage per_game_pages[] = {
34303428 SettingsPage::Summary, SettingsPage::Console, SettingsPage::Emulation, SettingsPage::Patches,
34313429 SettingsPage::Cheats, SettingsPage::Graphics, SettingsPage::Audio, SettingsPage::Controller,
34323430 SettingsPage::MemoryCards, SettingsPage::Achievements, SettingsPage::Advanced};
34333431 static constexpr std::array<std::pair<const char *, const char *>, static_cast <u32 >(SettingsPage::Count)> titles = {
34343432 {{FSUI_NSTR (" Summary" ), ICON_FA_FILE_ALT},
34353433 {FSUI_NSTR (" Interface Settings" ), ICON_FA_TV},
3434+ {FSUI_NSTR (" Game List Settings" ), ICON_FA_LIST_ALT},
34363435 {FSUI_NSTR (" Console Settings" ), ICON_FA_DICE_D20},
34373436 {FSUI_NSTR (" Emulation Settings" ), ICON_FA_COGS},
34383437 {FSUI_NSTR (" BIOS Settings" ), ICON_PF_MICROCHIP},
@@ -3538,6 +3537,10 @@ void FullscreenUI::DrawSettingsWindow()
35383537 DrawInterfaceSettingsPage ();
35393538 break ;
35403539
3540+ case SettingsPage::GameList:
3541+ DrawGameListSettingsPage ();
3542+ break ;
3543+
35413544 case SettingsPage::BIOS:
35423545 DrawBIOSSettingsPage ();
35433546 break ;
@@ -7435,14 +7438,14 @@ void FullscreenUI::DrawGameListWindow()
74357438
74367439 EndFullscreenWindow ();
74377440
7438- if (ImGui::IsKeyPressed (ImGuiKey_NavGamepadMenu, false ) || ImGui::IsKeyPressed (ImGuiKey_F1, false ))
7439- {
7440- s_state.game_list_view = (s_state.game_list_view == GameListView::Grid) ? GameListView::List : GameListView::Grid;
7441- }
7442- else if (ImGui::IsKeyPressed (ImGuiKey_GamepadStart, false ) || ImGui::IsKeyPressed (ImGuiKey_F2))
7441+ if (!AreAnyDialogsOpen ())
74437442 {
7444- s_state.current_main_window = MainWindowType::GameListSettings;
7445- QueueResetFocus (FocusResetType::ViewChanged);
7443+ if (ImGui::IsKeyPressed (ImGuiKey_NavGamepadMenu, false ) || ImGui::IsKeyPressed (ImGuiKey_F4, false ))
7444+ s_state.game_list_view = (s_state.game_list_view == GameListView::Grid) ? GameListView::List : GameListView::Grid;
7445+ else if (ImGui::IsKeyPressed (ImGuiKey_GamepadBack, false ) || ImGui::IsKeyPressed (ImGuiKey_F2, false ))
7446+ SwitchToSettings ();
7447+ else if (ImGui::IsKeyPressed (ImGuiKey_GamepadStart, false ) || ImGui::IsKeyPressed (ImGuiKey_F3, false ))
7448+ DoResume ();
74467449 }
74477450
74487451 switch (s_state.game_list_view )
@@ -7460,8 +7463,9 @@ void FullscreenUI::DrawGameListWindow()
74607463 if (IsGamepadInputSource ())
74617464 {
74627465 SetFullscreenFooterText (std::array{std::make_pair (ICON_PF_XBOX_DPAD, FSUI_VSTR (" Select Game" )),
7466+ std::make_pair (ICON_PF_BURGER_MENU, FSUI_VSTR (" Resume Last Session" )),
7467+ std::make_pair (ICON_PF_SHARE_CAPTURE, FSUI_VSTR (" Settings" )),
74637468 std::make_pair (ICON_PF_BUTTON_X, FSUI_VSTR (" Change View" )),
7464- std::make_pair (ICON_PF_BURGER_MENU, FSUI_VSTR (" Settings" )),
74657469 std::make_pair (ICON_PF_BUTTON_Y, FSUI_VSTR (" Launch Options" )),
74667470 std::make_pair (ICON_PF_BUTTON_A, FSUI_VSTR (" Start Game" )),
74677471 std::make_pair (ICON_PF_BUTTON_B, FSUI_VSTR (" Back" ))},
@@ -7473,9 +7477,13 @@ void FullscreenUI::DrawGameListWindow()
74737477 std::array{
74747478 std::make_pair (ICON_PF_ARROW_UP ICON_PF_ARROW_DOWN ICON_PF_ARROW_LEFT ICON_PF_ARROW_RIGHT,
74757479 FSUI_VSTR (" Select Game" )),
7476- std::make_pair (ICON_PF_F1, FSUI_VSTR (" Change View" )), std::make_pair (ICON_PF_F2, FSUI_VSTR (" Settings" )),
7477- std::make_pair (ICON_PF_F3, FSUI_VSTR (" Launch Options" )), std::make_pair (ICON_PF_ENTER, FSUI_VSTR (" Start Game" )),
7478- std::make_pair (ICON_PF_ESC, FSUI_VSTR (" Back" ))},
7480+ std::make_pair (ICON_PF_F3, FSUI_VSTR (" Resume Last Session" )),
7481+ std::make_pair (ICON_PF_F2, FSUI_VSTR (" Settings" )),
7482+ std::make_pair (ICON_PF_F4, FSUI_VSTR (" Change View" )),
7483+ std::make_pair (ICON_PF_F1, FSUI_VSTR (" Launch Options" )),
7484+ std::make_pair (ICON_PF_ENTER, FSUI_VSTR (" Start Game" )),
7485+ std::make_pair (ICON_PF_ESC, FSUI_VSTR (" Back" )),
7486+ },
74797487 GetBackgroundAlpha ());
74807488 }
74817489}
@@ -7566,7 +7574,7 @@ void FullscreenUI::DrawGameList(const ImVec2& heading_size)
75667574
75677575 if (selected_entry &&
75687576 (ImGui::IsItemClicked (ImGuiMouseButton_Right) || ImGui::IsKeyPressed (ImGuiKey_NavGamepadInput, false ) ||
7569- ImGui::IsKeyPressed (ImGuiKey_F3 , false )))
7577+ ImGui::IsKeyPressed (ImGuiKey_F1 , false )))
75707578 {
75717579 CancelPendingMenuClose ();
75727580 HandleGameListOptions (selected_entry);
@@ -7828,7 +7836,7 @@ void FullscreenUI::DrawGameGrid(const ImVec2& heading_size)
78287836 }
78297837 else if (hovered &&
78307838 (ImGui::IsItemClicked (ImGuiMouseButton_Right) || ImGui::IsKeyPressed (ImGuiKey_NavGamepadInput, false ) ||
7831- ImGui::IsKeyPressed (ImGuiKey_F3 , false )))
7839+ ImGui::IsKeyPressed (ImGuiKey_F1 , false )))
78327840 {
78337841 CancelPendingMenuClose ();
78347842 HandleGameListOptions (entry);
@@ -7984,51 +7992,49 @@ void FullscreenUI::HandleSelectDiscForDiscSet(std::string_view disc_set_name)
79847992 });
79857993}
79867994
7987- void FullscreenUI::DrawGameListSettingsWindow ()
7995+ void FullscreenUI::DrawGameListSettingsPage ()
79887996{
7989- ImGuiIO& io = ImGui::GetIO ();
7990- const ImVec2 heading_size =
7991- ImVec2 (io.DisplaySize .x , LayoutScale (LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY) +
7992- (LayoutScale (LAYOUT_MENU_BUTTON_Y_PADDING) * 2 .0f ) + LayoutScale (2 .0f ));
7997+ SettingsInterface* bsi = GetEditingSettingsInterface (false );
79937998
7994- if (BeginFullscreenWindow (ImVec2 (0 .0f , 0 .0f ), heading_size, " gamelist_view" ,
7995- MulAlpha (UIStyle.PrimaryColor , GetBackgroundAlpha ())))
7999+ BeginMenuButtons ();
8000+
8001+ MenuHeading (FSUI_CSTR (" List Settings" ));
79968002 {
7997- BeginNavBar ();
8003+ static constexpr const char * view_types[] = {FSUI_NSTR (" Game Grid" ), FSUI_NSTR (" Game List" )};
8004+ static constexpr const char * sort_types[] = {
8005+ FSUI_NSTR (" Type" ),
8006+ FSUI_NSTR (" Serial" ),
8007+ FSUI_NSTR (" Title" ),
8008+ FSUI_NSTR (" File Title" ),
8009+ FSUI_NSTR (" Time Played" ),
8010+ FSUI_NSTR (" Last Played" ),
8011+ FSUI_NSTR (" File Size" ),
8012+ FSUI_NSTR (" Uncompressed Size" ),
8013+ FSUI_NSTR (" Achievement Unlock/Count" ),
8014+ };
79988015
7999- if (NavButton (ICON_PF_NAVIGATION_BACK, true , true ))
8016+ DrawIntListSetting (bsi, FSUI_ICONSTR (ICON_FA_BORDER_ALL, " Default View" ),
8017+ FSUI_CSTR (" Selects the view that the game list will open to." ), " Main" ,
8018+ " DefaultFullscreenUIGameView" , 0 , view_types);
8019+ DrawIntListSetting (bsi, FSUI_ICONSTR (ICON_FA_SORT, " Sort By" ),
8020+ FSUI_CSTR (" Determines that field that the game list will be sorted by." ), " Main" ,
8021+ " FullscreenUIGameSort" , 0 , sort_types);
8022+ DrawToggleSetting (
8023+ bsi, FSUI_ICONSTR (ICON_FA_SORT_ALPHA_DOWN, " Sort Reversed" ),
8024+ FSUI_CSTR (" Reverses the game list sort order from the default (usually ascending to descending)." ), " Main" ,
8025+ " FullscreenUIGameSortReverse" , false );
8026+ DrawToggleSetting (bsi, FSUI_ICONSTR (ICON_FA_LIST, " Merge Multi-Disc Games" ),
8027+ FSUI_CSTR (" Merges multi-disc games into one item in the game list." ), " Main" ,
8028+ " FullscreenUIMergeDiscSets" , true );
8029+ if (DrawToggleSetting (
8030+ bsi, FSUI_ICONSTR (ICON_FA_TROPHY, " Show Achievement Trophy Icons" ),
8031+ FSUI_CSTR (" Shows trophy icons in game grid when games have achievements or have been mastered." ), " Main" ,
8032+ " FullscreenUIShowTrophyIcons" , true ))
80008033 {
8001- s_state.current_main_window = MainWindowType::GameList;
8002- QueueResetFocus (FocusResetType::Other);
8034+ s_state.game_list_show_trophy_icons = bsi->GetBoolValue (" Main" , " FullscreenUIShowTrophyIcons" , true );
80038035 }
8004-
8005- NavTitle (FSUI_CSTR (" Game List Settings" ));
8006- EndNavBar ();
80078036 }
80088037
8009- EndFullscreenWindow ();
8010-
8011- if (!BeginFullscreenWindow (
8012- ImVec2 (0 .0f , heading_size.y ),
8013- ImVec2 (io.DisplaySize .x , io.DisplaySize .y - heading_size.y - LayoutScale (LAYOUT_FOOTER_HEIGHT)),
8014- " settings_parent" , MulAlpha (UIStyle.PrimaryColor , GetBackgroundAlpha ()), 0 .0f ,
8015- ImVec2 (ImGuiFullscreen::LAYOUT_MENU_WINDOW_X_PADDING, 0 .0f )))
8016- {
8017- EndFullscreenWindow ();
8018- return ;
8019- }
8020-
8021- if (ImGui::IsWindowFocused () && WantsToCloseMenu ())
8022- {
8023- s_state.current_main_window = MainWindowType::GameList;
8024- QueueResetFocus (FocusResetType::ViewChanged);
8025- }
8026-
8027- auto lock = Host::GetSettingsLock ();
8028- SettingsInterface* bsi = GetEditingSettingsInterface (false );
8029-
8030- BeginMenuButtons ();
8031-
80328038 MenuHeading (FSUI_CSTR (" Search Directories" ));
80338039 if (MenuButton (FSUI_ICONSTR (ICON_FA_FOLDER_PLUS, " Add Search Directory" ),
80348040 FSUI_CSTR (" Adds a new directory to the game search list." )))
@@ -8107,43 +8113,6 @@ void FullscreenUI::DrawGameListSettingsWindow()
81078113 }
81088114 }
81098115
8110- MenuHeading (FSUI_CSTR (" List Settings" ));
8111- {
8112- static constexpr const char * view_types[] = {FSUI_NSTR (" Game Grid" ), FSUI_NSTR (" Game List" )};
8113- static constexpr const char * sort_types[] = {
8114- FSUI_NSTR (" Type" ),
8115- FSUI_NSTR (" Serial" ),
8116- FSUI_NSTR (" Title" ),
8117- FSUI_NSTR (" File Title" ),
8118- FSUI_NSTR (" Time Played" ),
8119- FSUI_NSTR (" Last Played" ),
8120- FSUI_NSTR (" File Size" ),
8121- FSUI_NSTR (" Uncompressed Size" ),
8122- FSUI_NSTR (" Achievement Unlock/Count" ),
8123- };
8124-
8125- DrawIntListSetting (bsi, FSUI_ICONSTR (ICON_FA_BORDER_ALL, " Default View" ),
8126- FSUI_CSTR (" Selects the view that the game list will open to." ), " Main" ,
8127- " DefaultFullscreenUIGameView" , 0 , view_types);
8128- DrawIntListSetting (bsi, FSUI_ICONSTR (ICON_FA_SORT, " Sort By" ),
8129- FSUI_CSTR (" Determines that field that the game list will be sorted by." ), " Main" ,
8130- " FullscreenUIGameSort" , 0 , sort_types);
8131- DrawToggleSetting (
8132- bsi, FSUI_ICONSTR (ICON_FA_SORT_ALPHA_DOWN, " Sort Reversed" ),
8133- FSUI_CSTR (" Reverses the game list sort order from the default (usually ascending to descending)." ), " Main" ,
8134- " FullscreenUIGameSortReverse" , false );
8135- DrawToggleSetting (bsi, FSUI_ICONSTR (ICON_FA_LIST, " Merge Multi-Disc Games" ),
8136- FSUI_CSTR (" Merges multi-disc games into one item in the game list." ), " Main" ,
8137- " FullscreenUIMergeDiscSets" , true );
8138- if (DrawToggleSetting (
8139- bsi, FSUI_ICONSTR (ICON_FA_TROPHY, " Show Achievement Trophy Icons" ),
8140- FSUI_CSTR (" Shows trophy icons in game grid when games have achievements or have been mastered." ), " Main" ,
8141- " FullscreenUIShowTrophyIcons" , true ))
8142- {
8143- s_state.game_list_show_trophy_icons = bsi->GetBoolValue (" Main" , " FullscreenUIShowTrophyIcons" , true );
8144- }
8145- }
8146-
81478116 MenuHeading (FSUI_CSTR (" Cover Settings" ));
81488117 {
81498118 DrawFolderSetting (bsi, FSUI_ICONSTR (ICON_FA_FOLDER, " Covers Directory" ), " Folders" , " Covers" , EmuFolders::Covers);
@@ -8169,10 +8138,6 @@ void FullscreenUI::DrawGameListSettingsWindow()
81698138 }
81708139
81718140 EndMenuButtons ();
8172-
8173- EndFullscreenWindow ();
8174-
8175- SetStandardSelectionFooterText (true );
81768141}
81778142
81788143void FullscreenUI::SwitchToGameList ()
0 commit comments