From b2b5974c8e43941c199b3a98be1c8b3305e76858 Mon Sep 17 00:00:00 2001 From: KamFretoZ <14798312+kamfretoz@users.noreply.github.com> Date: Wed, 2 Oct 2024 12:58:41 +0700 Subject: [PATCH] OSD/Savestate: Add close menu hint to the selector Don't you hate it when you come up with more ideas just minutes AFTER the PR has been merged? --- pcsx2/ImGui/ImGuiOverlays.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pcsx2/ImGui/ImGuiOverlays.cpp b/pcsx2/ImGui/ImGuiOverlays.cpp index 2078befcf2b0f5..98845435a45398 100644 --- a/pcsx2/ImGui/ImGuiOverlays.cpp +++ b/pcsx2/ImGui/ImGuiOverlays.cpp @@ -761,6 +761,7 @@ namespace SaveStateSelectorUI static std::string s_save_legend; static std::string s_prev_legend; static std::string s_next_legend; + static std::string s_close_legend; static std::array s_slots; static std::atomic_int32_t s_current_slot{0}; @@ -812,6 +813,7 @@ void SaveStateSelectorUI::Close() s_save_legend = {}; s_prev_legend = {}; s_next_legend = {}; + s_close_legend = {}; } void SaveStateSelectorUI::RefreshList(const std::string& serial, u32 crc) @@ -873,6 +875,8 @@ void SaveStateSelectorUI::RefreshHotkeyLegend() TRANSLATE_STR("ImGuiOverlays", "Select Previous")); s_next_legend = format_legend_entry(Host::GetSmallStringSettingValue("Hotkeys", "NextSaveStateSlot"), TRANSLATE_STR("ImGuiOverlays", "Select Next")); + s_close_legend = format_legend_entry(Host::GetSmallStringSettingValue("Hotkeys", "OpenPauseMenu"), + TRANSLATE_STR("ImGuiOverlays", "Close Menu")); } void SaveStateSelectorUI::SelectNextSlot(bool open_selector) @@ -975,7 +979,7 @@ void SaveStateSelectorUI::Draw() ImGuiWindowFlags_NoScrollbar)) { // Leave 2 lines for the legend - const float legend_margin = ImGui::GetFontSize() * 2.0f + ImGui::GetStyle().ItemSpacing.y * 3.0f; + const float legend_margin = ImGui::GetFontSize() * 3.0f + ImGui::GetStyle().ItemSpacing.y * 3.0f; const float padding = 10.0f * scale; ImGui::BeginChild("##item_list", ImVec2(0, -legend_margin), false, @@ -1069,6 +1073,8 @@ void SaveStateSelectorUI::Draw() ImGui::TextUnformatted(s_save_legend.c_str()); ImGui::TableNextColumn(); ImGui::TextUnformatted(s_next_legend.c_str()); + ImGui::TableNextColumn(); + ImGui::TextUnformatted(s_close_legend.c_str()); ImGui::EndTable(); }