mirror of
https://github.com/izzy2lost/dolphin.git
synced 2026-06-19 01:16:48 -07:00
Core: Add a HookableEvent for UICommon::FlushUnsavedData.
This commit is contained in:
@@ -65,6 +65,7 @@
|
||||
namespace UICommon
|
||||
{
|
||||
static Config::ConfigChangedCallbackID s_config_changed_callback_id;
|
||||
static Common::HookableEvent<> s_flush_unsaved_data_event_hook;
|
||||
|
||||
static void CreateDumpPath(std::string path)
|
||||
{
|
||||
@@ -162,9 +163,15 @@ void Shutdown()
|
||||
Config::Shutdown();
|
||||
}
|
||||
|
||||
[[nodiscard]] Common::EventHook AddFlushUnsavedDataCallback(std::function<void()> callback)
|
||||
{
|
||||
return s_flush_unsaved_data_event_hook.Register(std::move(callback));
|
||||
}
|
||||
|
||||
void FlushUnsavedData()
|
||||
{
|
||||
INFO_LOG_FMT(CORE, "Flushing unsaved data...");
|
||||
s_flush_unsaved_data_event_hook.Trigger();
|
||||
}
|
||||
|
||||
void InitControllers(const WindowSystemInfo& wsi)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <string>
|
||||
|
||||
#include "Common/CommonTypes.h"
|
||||
#include "Common/HookableEvent.h"
|
||||
|
||||
struct WindowSystemInfo;
|
||||
|
||||
@@ -14,6 +15,8 @@ namespace UICommon
|
||||
void Init();
|
||||
void Shutdown();
|
||||
|
||||
// Triggered from the Host-thread on Android before a potential process termination.
|
||||
[[nodiscard]] Common::EventHook AddFlushUnsavedDataCallback(std::function<void()> callback);
|
||||
void FlushUnsavedData();
|
||||
|
||||
void InitControllers(const WindowSystemInfo& wsi);
|
||||
|
||||
Reference in New Issue
Block a user