Core: Make AddOnStateChangedCallback use HookableEvent.

This commit is contained in:
Jordan Woyak
2025-11-09 16:43:19 -06:00
parent fdf822f430
commit a97627e736
7 changed files with 15 additions and 37 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ static std::unique_ptr<QPalette> s_default_palette;
Settings::Settings()
{
qRegisterMetaType<Core::State>();
Core::AddOnStateChangedCallback([this](Core::State new_state) {
m_core_state_changed_hook = Core::AddOnStateChangedCallback([this](Core::State new_state) {
QueueOnObject(this, [this, new_state] {
// Avoid signal spam while continuously frame stepping. Will still send a signal for the first
// and last framestep.
+2
View File
@@ -236,6 +236,8 @@ private:
std::shared_ptr<NetPlay::NetPlayServer> m_server;
Common::EventHook m_hotplug_event_hook;
Config::ConfigChangedCallbackID m_config_changed_callback_id;
Common::EventHook m_core_state_changed_hook;
};
Q_DECLARE_METATYPE(Core::State);