diff --git a/Common/System/System.h b/Common/System/System.h index 5bd9a4bb19..0838e3f7cd 100644 --- a/Common/System/System.h +++ b/Common/System/System.h @@ -321,6 +321,7 @@ enum class UIMessage { RECENT_FILES_CHANGED, SAVE_FRAME_DUMP, ADHOC_SERVER_LIST_CHANGED, + SAVESTATE_SLOT_SAVED, // A slot's save state file was written. }; std::string System_GetProperty(SystemProperty prop); diff --git a/Core/SaveState.cpp b/Core/SaveState.cpp index dffde2d7a9..6a00dca850 100644 --- a/Core/SaveState.cpp +++ b/Core/SaveState.cpp @@ -1174,6 +1174,8 @@ int g_screenshotFailures; g_Config.Save("Saving config for savestate last save undo"); } g_filesStale = true; + // The pause screen may have listed the slots before the file was there. + System_PostUIMessage(UIMessage::SAVESTATE_SLOT_SAVED); } } else { if (result == CChunkFileReader::ERROR_BROKEN_STATE) { diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index aed72a1238..4e6ef286f8 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -411,6 +411,14 @@ void GamePauseScreen::update() { SetVRAppMode(VRAppMode::VR_MENU_MODE); } +void GamePauseScreen::sendMessage(UIMessage message, const char *value) { + UIBaseDialogScreen::sendMessage(message, value); + if (message == UIMessage::SAVESTATE_SLOT_SAVED) { + // A save started before the screen opened has finished writing, so its slot needs updating. + RecreateViews(); + } +} + GamePauseScreen::GamePauseScreen(const Path &filename, bool bootPending) : UIBaseDialogScreen(filename), bootPending_(bootPending) { // So we can tell if something blew up while on the pause screen. diff --git a/UI/PauseScreen.h b/UI/PauseScreen.h index 91ec75d11f..1a02e968b1 100644 --- a/UI/PauseScreen.h +++ b/UI/PauseScreen.h @@ -36,6 +36,7 @@ public: ~GamePauseScreen(); void dialogFinished(const Screen *dialog, DialogResult dr) override; + void sendMessage(UIMessage message, const char *value) override; const char *tag() const override { return "GamePause"; }