Core: Add a HookableEvent for UICommon::FlushUnsavedData to use.

This commit is contained in:
Jordan Woyak 2025-04-26 17:18:56 -05:00
parent 30b88a69cf
commit ba6331723b
2 changed files with 6 additions and 0 deletions

View file

@ -15,6 +15,7 @@
#include <string_view>
#include "Common/CommonTypes.h"
#include "Common/HookableEvent.h"
struct BootParameters;
struct WindowSystemInfo;
@ -193,4 +194,8 @@ void UpdateInputGate(bool require_focus, bool require_full_focus = false);
void UpdateTitle(Core::System& system);
// Android triggers this before a potential process termination.
// Core is expected to be paused when this happens.
using FlushUnsavedDataEvent = Common::HookableEvent<"FlushUnsavedData">;
} // namespace Core

View file

@ -161,6 +161,7 @@ void Shutdown()
void FlushUnsavedData()
{
INFO_LOG_FMT(CORE, "Flushing unsaved data...");
Core::FlushUnsavedDataEvent::Trigger();
}
void InitControllers(const WindowSystemInfo& wsi)