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?
This commit is contained in:
KamFretoZ 2024-10-02 12:58:41 +07:00 committed by Ty
parent 5f0bc729d7
commit a304959933

View File

@ -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};
@ -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();
}