From 116aca3a149b2fd24878b96036bf4672ba883cc3 Mon Sep 17 00:00:00 2001 From: Joshua Date: Thu, 12 Dec 2024 09:14:42 -0500 Subject: [PATCH] change over to manual delegate for steam notification --- .../Classes/SteamNotificationsSubsystem.h | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h b/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h index 7b8641a..7b6948c 100644 --- a/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h +++ b/AdvancedSteamSessions/Source/AdvancedSteamSessions/Classes/SteamNotificationsSubsystem.h @@ -38,14 +38,27 @@ public: void Initialize(USteamNotificationsSubsystem* MyParent) { ParentSubsystem = MyParent; + +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED + OnExternalUITriggeredCallback.Register(this, &USteamNotificationsSubsystem::cSteamEventsStore::OnExternalUITriggered); +#endif + } + + void UnInitialize(USteamNotificationsSubsystem* MyParent) + { +#if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED + OnExternalUITriggeredCallback.Unregister(); +#endif } #if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED - cSteamEventsStore() : - OnExternalUITriggeredCallback(this, &cSteamEventsStore::OnExternalUITriggered) + cSteamEventsStore() + {} + //: + /*OnExternalUITriggeredCallback(this, &cSteamEventsStore::OnExternalUITriggered) { - } + }*/ #else //cSteamEventsStore() //{ @@ -57,7 +70,8 @@ public: private: #if (PLATFORM_WINDOWS || PLATFORM_MAC || PLATFORM_LINUX) && STEAM_SDK_INSTALLED - STEAM_CALLBACK(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback); + //STEAM_CALLBACK(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback); + STEAM_CALLBACK_MANUAL(cSteamEventsStore, OnExternalUITriggered, GameOverlayActivated_t, OnExternalUITriggeredCallback); #endif }; @@ -72,7 +86,7 @@ public: /** Implement this for deinitialization of instances of the system */ virtual void Deinitialize() override { - + MyEvents.UnInitialize(this); } };