Merge pull request #14096 from jordan-woyak/state-changed-hookable-event

Core: Make AddOnStateChangedCallback use HookableEvent.
This commit is contained in:
JMC47
2025-11-11 20:58:45 -05:00
committed by GitHub
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);