From a304959933df2b12fa23dc687f2b59948585daf6 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 | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/pcsx2/ImGui/ImGuiOverlays.cpp b/pcsx2/ImGui/ImGuiOverlays.cpp index 2078befcf2..0ec9d9e118 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) @@ -960,9 +964,9 @@ void SaveStateSelectorUI::Draw() const auto& io = ImGui::GetIO(); const float scale = ImGuiManager::GetGlobalScale(); const float width = (600.0f * scale); - const float height = (420.0f * scale); + const float height = (430.0f * scale); - const float padding_and_rounding = 15.0f * scale; + const float padding_and_rounding = 10.0f * scale; ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, padding_and_rounding); ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(padding_and_rounding, padding_and_rounding)); ImGui::PushStyleColor(ImGuiCol_WindowBg, ImVec4(0.11f, 0.15f, 0.17f, 0.8f)); @@ -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(); }