Skip to content

Commit

Permalink
OSD/Savestate: Add close menu hint to the selector
Browse files Browse the repository at this point in the history
Don't you hate it when you come up with more ideas just minutes AFTER the PR has been merged?
  • Loading branch information
kamfretoz committed Oct 2, 2024
1 parent 7dbe54f commit 003e176
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pcsx2/ImGui/ImGuiOverlays.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ListEntry, VMManager::NUM_SAVE_STATE_SLOTS> s_slots;
static std::atomic_int32_t s_current_slot{0};
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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();
}
Expand Down

0 comments on commit 003e176

Please sign in to comment.