From 7dcf6752d481b26d811f6427200b48be4c9236ff Mon Sep 17 00:00:00 2001 From: searica <143636061+searica@users.noreply.github.com> Date: Tue, 7 Nov 2023 18:59:33 -0800 Subject: [PATCH 1/2] Correct doc comment to refer to correct event --- JotunnLib/Managers/SynchronizationManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/JotunnLib/Managers/SynchronizationManager.cs b/JotunnLib/Managers/SynchronizationManager.cs index 506cf2397..f2aa9bb5d 100644 --- a/JotunnLib/Managers/SynchronizationManager.cs +++ b/JotunnLib/Managers/SynchronizationManager.cs @@ -875,7 +875,7 @@ private void InvokeOnConfigurationSynchronized(bool initial, HashSet plu } /// - /// Safely invoke the event + /// Safely invoke the event /// private void InvokeOnSyncingConfiguration() { From 2343bf7220399ee97a89e62f126e456ce18695ba Mon Sep 17 00:00:00 2001 From: searica <143636061+searica@users.noreply.github.com> Date: Tue, 7 Nov 2023 19:01:04 -0800 Subject: [PATCH 2/2] Add configuration window closed event --- JotunnLib/Managers/SynchronizationManager.cs | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/JotunnLib/Managers/SynchronizationManager.cs b/JotunnLib/Managers/SynchronizationManager.cs index f2aa9bb5d..b4722dcc8 100644 --- a/JotunnLib/Managers/SynchronizationManager.cs +++ b/JotunnLib/Managers/SynchronizationManager.cs @@ -46,6 +46,11 @@ public class SynchronizationManager : IManager /// public static event Action OnAdminStatusChanged; + /// + /// Event triggered after the in-game configuration manager window is closed + /// + public static event Action OnConfigurationWindowClosed; + private static SynchronizationManager _instance; /// @@ -574,11 +579,21 @@ private void ConfigurationManager_DisplayingWindowChanged(object sender, object if (!ConfigurationManagerWindowShown) { + InvokeOnConfigurationWindowClosed(); + // After closing the window check for changed configs SynchronizeChangedConfig(); } } + /// + /// Safely invoke the event + /// + private void InvokeOnConfigurationWindowClosed() + { + OnConfigurationWindowClosed?.SafeInvoke(); + } + /// /// Initial cache the config values of dependent plugins and register ourself to config change events ///