mirror of https://github.com/PCSX2/pcsx2.git
Savestate: Make selector dismissible by opening pause menu
This commit is contained in:
parent
58a26dbca4
commit
c1eecb3512
|
@ -15,6 +15,7 @@
|
|||
#include "ImGui/FullscreenUI.h"
|
||||
#include "ImGui/ImGuiFullscreen.h"
|
||||
#include "ImGui/ImGuiManager.h"
|
||||
#include "ImGui/ImGuiOverlays.h"
|
||||
#include "Input/InputManager.h"
|
||||
#include "MTGS.h"
|
||||
#include "Patch.h"
|
||||
|
@ -716,6 +717,12 @@ void FullscreenUI::OpenPauseMenu()
|
|||
if (!VMManager::HasValidVM())
|
||||
return;
|
||||
|
||||
if (SaveStateSelectorUI::IsOpen())
|
||||
{
|
||||
SaveStateSelectorUI::Close();
|
||||
return;
|
||||
}
|
||||
|
||||
MTGS::RunOnGSThread([]() {
|
||||
if (!ImGuiManager::InitializeFullscreenUI() || s_current_main_window != MainWindowType::None)
|
||||
return;
|
||||
|
|
|
@ -752,6 +752,7 @@ namespace SaveStateSelectorUI
|
|||
static void RefreshHotkeyLegend();
|
||||
static void Draw();
|
||||
static void ShowSlotOSDMessage();
|
||||
bool IsOpen();
|
||||
|
||||
static constexpr const char* DATE_TIME_FORMAT = TRANSLATE_NOOP("ImGuiOverlays", "Saved at {0:%H:%M} on {0:%a} {0:%Y/%m/%d}.");
|
||||
|
||||
|
@ -800,6 +801,10 @@ void SaveStateSelectorUI::Open(float open_time /* = DEFAULT_OPEN_TIME */)
|
|||
RefreshHotkeyLegend();
|
||||
}
|
||||
|
||||
bool SaveStateSelectorUI::IsOpen(){
|
||||
return s_open;
|
||||
}
|
||||
|
||||
void SaveStateSelectorUI::Close()
|
||||
{
|
||||
s_open = false;
|
||||
|
|
|
@ -12,13 +12,14 @@ namespace ImGuiManager
|
|||
|
||||
namespace SaveStateSelectorUI
|
||||
{
|
||||
static constexpr float DEFAULT_OPEN_TIME = 7.5f;
|
||||
static constexpr float DEFAULT_OPEN_TIME = 5.0f;
|
||||
|
||||
void Open(float open_time = DEFAULT_OPEN_TIME);
|
||||
void RefreshList(const std::string& serial, u32 crc);
|
||||
void DestroyTextures();
|
||||
void Clear();
|
||||
void Close();
|
||||
bool IsOpen();
|
||||
|
||||
void SelectNextSlot(bool open_selector);
|
||||
void SelectPreviousSlot(bool open_selector);
|
||||
|
|
Loading…
Reference in New Issue