MCPcopy Create free account
hub / github.com/PCSX2/pcsx2 / DrawGameListSettingsWindow

Method DrawGameListSettingsWindow

pcsx2/ImGui/FullscreenUI.cpp:3084–3260  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3082}
3083
3084void FullscreenUI::DrawGameListSettingsWindow()
3085{
3086 ImGuiIO& io = ImGui::GetIO();
3087 const ImVec2 heading_size =
3088 ImVec2(io.DisplaySize.x, LayoutScale(LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY) +
3089 (LayoutScale(LAYOUT_MENU_BUTTON_Y_PADDING) * 2.0f) + LayoutScale(2.0f));
3090
3091 const float bg_alpha = VMManager::HasValidVM() ? 0.90f : 1.0f;
3092
3093 if (BeginFullscreenWindow(ImVec2(0.0f, 0.0f), heading_size, "gamelist_view", MulAlpha(UIPrimaryColor, bg_alpha)))
3094 {
3095 BeginNavBar();
3096
3097 if (NavButton(ICON_PF_BACKWARD, true, true))
3098 {
3099 s_current_main_window = MainWindowType::GameList;
3100 QueueResetFocus(FocusResetType::WindowChanged);
3101 }
3102
3103 NavTitle(FSUI_CSTR("Game List Settings"));
3104 EndNavBar();
3105 }
3106
3107 EndFullscreenWindow();
3108
3109 if (!BeginFullscreenWindow(
3110 ImVec2(0.0f, heading_size.y),
3111 ImVec2(io.DisplaySize.x, io.DisplaySize.y - heading_size.y - LayoutScale(LAYOUT_FOOTER_HEIGHT)),
3112 "settings_parent", UIBackgroundColor, 0.0f, ImVec2(ImGuiFullscreen::LAYOUT_MENU_WINDOW_X_PADDING, 0.0f)))
3113 {
3114 EndFullscreenWindow();
3115 return;
3116 }
3117
3118 if (ImGui::IsWindowFocused() && WantsToCloseMenu())
3119 {
3120 s_current_main_window = MainWindowType::GameList;
3121 QueueResetFocus(FocusResetType::WindowChanged);
3122 }
3123
3124 auto lock = Host::GetSettingsLock();
3125 SettingsInterface* bsi = GetEditingSettingsInterface(false);
3126
3127 BeginMenuButtons();
3128
3129 MenuHeading(FSUI_CSTR("Search Directories"));
3130 if (MenuButton(FSUI_ICONSTR(ICON_FA_FOLDER_PLUS, "Add Search Directory"), FSUI_CSTR("Adds a new directory to the game search list.")))
3131 {
3132 OpenFileSelector(FSUI_ICONSTR(ICON_FA_FOLDER_PLUS, "Add Search Directory"), true, [](const std::string& dir) {
3133 if (!dir.empty())
3134 {
3135 auto lock = Host::GetSettingsLock();
3136 SettingsInterface* bsi = Host::Internal::GetBaseSettingsLayer();
3137
3138 bsi->AddToStringList("GameList", "RecursivePaths", dir.c_str());
3139 bsi->RemoveFromStringList("GameList", "Paths", dir.c_str());
3140 SetSettingsChanged(bsi);
3141 PopulateGameListDirectoryCache(bsi);

Callers

nothing calls this directly

Calls 8

LayoutScaleFunction · 0.85
MulAlphaFunction · 0.85
ImVec2Class · 0.70
sizeFunction · 0.50
emptyMethod · 0.45
AddToStringListMethod · 0.45
c_strMethod · 0.45
RemoveFromStringListMethod · 0.45

Tested by

no test coverage detected