From 4e0c417add264226b3db065c1466791f0591a1b5 Mon Sep 17 00:00:00 2001 From: Stenzek Date: Tue, 16 Apr 2024 12:43:23 +1000 Subject: [PATCH] FullscreenUI: Add "Open Containing Directory" --- src/core/fullscreen_ui.cpp | 17 +++++++++++------ src/util/imgui_fullscreen.cpp | 2 +- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/core/fullscreen_ui.cpp b/src/core/fullscreen_ui.cpp index a67866b67..8dc8116fc 100644 --- a/src/core/fullscreen_ui.cpp +++ b/src/core/fullscreen_ui.cpp @@ -6482,6 +6482,7 @@ void FullscreenUI::HandleGameListOptions(const GameList::Entry* entry) { ImGuiFullscreen::ChoiceDialogOptions options = { {FSUI_ICONSTR(ICON_FA_WRENCH, "Game Properties"), false}, + {FSUI_ICONSTR(ICON_FA_FOLDER_OPEN, "Open Containing Directory"), false}, {FSUI_ICONSTR(ICON_FA_PLAY, "Resume Game"), false}, {FSUI_ICONSTR(ICON_FA_UNDO, "Load State"), false}, {FSUI_ICONSTR(ICON_FA_COMPACT_DISC, "Default Boot"), false}, @@ -6499,22 +6500,25 @@ void FullscreenUI::HandleGameListOptions(const GameList::Entry* entry) case 0: // Open Game Properties SwitchToGameSettingsForPath(entry_path); break; - case 1: // Resume Game + case 1: // Open Containing Directory + ExitFullscreenAndOpenURL(Path::CreateFileURL(Path::GetDirectory(entry_path))); + break; + case 2: // Resume Game DoStartPath(entry_path, System::GetGameSaveStateFileName(entry_serial, -1)); break; - case 2: // Load State + case 3: // Load State OpenLoadStateSelectorForGame(entry_path); break; - case 3: // Default Boot + case 4: // Default Boot DoStartPath(entry_path); break; - case 4: // Fast Boot + case 5: // Fast Boot DoStartPath(entry_path, {}, true); break; - case 5: // Slow Boot + case 6: // Slow Boot DoStartPath(entry_path, {}, false); break; - case 6: // Reset Play Time + case 7: // Reset Play Time GameList::ClearPlayedTimeForSerial(entry_serial); break; default: @@ -7309,6 +7313,7 @@ TRANSLATE_NOOP("FullscreenUI", "Not Scanning Subdirectories"); TRANSLATE_NOOP("FullscreenUI", "OK"); TRANSLATE_NOOP("FullscreenUI", "OSD Scale"); TRANSLATE_NOOP("FullscreenUI", "On-Screen Display"); +TRANSLATE_NOOP("FullscreenUI", "Open Containing Directory"); TRANSLATE_NOOP("FullscreenUI", "Open in File Browser"); TRANSLATE_NOOP("FullscreenUI", "Operations"); TRANSLATE_NOOP("FullscreenUI", "Optimal Frame Pacing"); diff --git a/src/util/imgui_fullscreen.cpp b/src/util/imgui_fullscreen.cpp index 305f517d2..4fbbcd5bf 100644 --- a/src/util/imgui_fullscreen.cpp +++ b/src/util/imgui_fullscreen.cpp @@ -2277,7 +2277,7 @@ void ImGuiFullscreen::DrawChoiceDialog() const float title_height = g_large_font->FontSize + ImGui::GetStyle().FramePadding.y * 2.0f + ImGui::GetStyle().WindowPadding.y * 2.0f; const float height = - std::min(LayoutScale(450.0f), + std::min(LayoutScale(480.0f), title_height + LayoutScale(LAYOUT_MENU_BUTTON_HEIGHT_NO_SUMMARY + (LAYOUT_MENU_BUTTON_Y_PADDING * 2.0f)) * static_cast(s_choice_dialog_options.size())); ImGui::SetNextWindowSize(ImVec2(width, height));