mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-22 22:00:39 -06:00
update ui after savestate load (because loading a savestate can affect whether certain items should be grayed out in the menu)
This commit is contained in:
@ -61,6 +61,8 @@ static int ev_FileSave, ev_BufferSave, ev_FileLoad, ev_BufferLoad, ev_FileVerify
|
||||
|
||||
static std::string g_current_filename, g_last_filename;
|
||||
|
||||
static CallbackFunc g_onAfterLoadCb = NULL;
|
||||
|
||||
// Temporary undo state buffer
|
||||
static std::vector<u8> g_undo_load_buffer;
|
||||
static std::vector<u8> g_current_buffer;
|
||||
@ -406,12 +408,20 @@ void LoadFileStateCallback(u64 userdata, int cyclesLate)
|
||||
|
||||
g_op_in_progress = false;
|
||||
|
||||
if (g_onAfterLoadCb)
|
||||
g_onAfterLoadCb();
|
||||
|
||||
g_loadDepth--;
|
||||
|
||||
// resume dat core
|
||||
CCPU::EnableStepping(false);
|
||||
}
|
||||
|
||||
void SetOnAfterLoadCallback(CallbackFunc callback)
|
||||
{
|
||||
g_onAfterLoadCb = callback;
|
||||
}
|
||||
|
||||
void VerifyFileStateCallback(u64 userdata, int cyclesLate)
|
||||
{
|
||||
Flush();
|
||||
|
@ -56,6 +56,10 @@ void UndoLoadState();
|
||||
|
||||
void Flush(); // wait until previously scheduled savestate event (if any) is done
|
||||
|
||||
// for calling back into UI code without introducing a dependency on it in core
|
||||
typedef void(*CallbackFunc)(void);
|
||||
void SetOnAfterLoadCallback(CallbackFunc callback);
|
||||
|
||||
}
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user