Core: Make AddOnStateChangedCallback use HookableEvent.
This commit is contained in:
@@ -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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user