System: Don't unconditionally refresh save state UI

This commit is contained in:
Stenzek 2023-12-17 00:09:15 +10:00
parent 38777439c5
commit 6328d08c14
No known key found for this signature in database
3 changed files with 8 additions and 1 deletions

View file

@ -688,6 +688,11 @@ static ImAnimatedFloat s_background_animated;
static bool s_open = false;
} // namespace SaveStateSelectorUI
bool SaveStateSelectorUI::IsOpen()
{
return s_open;
}
void SaveStateSelectorUI::Open(float open_time /* = DEFAULT_OPEN_TIME */)
{
s_open_time = 0.0f;

View file

@ -15,6 +15,7 @@ namespace SaveStateSelectorUI {
static constexpr float DEFAULT_OPEN_TIME = 5.0f;
bool IsOpen();
void Open(float open_time = DEFAULT_OPEN_TIME);
void RefreshList();
void DestroyTextures();

View file

@ -3366,7 +3366,8 @@ void System::UpdateRunningGame(const char* path, CDImage* image, bool booting)
if (s_running_game_serial != prev_serial)
UpdateSessionTime(prev_serial);
SaveStateSelectorUI::RefreshList();
if (SaveStateSelectorUI::IsOpen())
SaveStateSelectorUI::RefreshList();
#ifdef ENABLE_DISCORD_PRESENCE
UpdateDiscordPresence();