diff --git a/MosswartMassacre/PluginCore.cs b/MosswartMassacre/PluginCore.cs index 9149b60..8c03124 100644 --- a/MosswartMassacre/PluginCore.cs +++ b/MosswartMassacre/PluginCore.cs @@ -112,6 +112,11 @@ namespace MosswartMassacre Views.VVSTabbedMainView.RefreshSettingsFromConfig(); } + public static void RestoreWindowPosition() + { + Views.VVSTabbedMainView.RestorePosition(); + } + public static void RefreshUpdateStatus() { Views.VVSTabbedMainView.RefreshUpdateStatus(); @@ -503,9 +508,10 @@ namespace MosswartMassacre WebSocketEnabled = PluginSettings.Instance.WebSocketEnabled; CharTag = PluginSettings.Instance.CharTag; - // 3. Update UI with current settings + // 3. Update UI with current settings and restore window position ViewManager.SetRareMetaToggleState(RareMetaEnabled); ViewManager.RefreshSettingsFromConfig(); + ViewManager.RestoreWindowPosition(); // 4. Restart services if they were enabled (stop first, then start) if (WebSocketEnabled) @@ -574,6 +580,34 @@ namespace MosswartMassacre WriteToChat($"[ERROR] Quest streaming service hot reload failed: {ex.Message}"); } + // 10. Reinitialize character stats streaming + try + { + if (characterStatsTimer == null) + { + characterStatsTimer = new Timer(Constants.CharacterStatsIntervalMs); + characterStatsTimer.Elapsed += OnCharacterStatsUpdate; + characterStatsTimer.AutoReset = true; + characterStatsTimer.Start(); + } + + // Send initial stats after short delay + var initialDelay = new Timer(Constants.LoginDelayMs); + initialDelay.AutoReset = false; + initialDelay.Elapsed += (s, args) => + { + CharacterStats.CollectAndSend(); + ((Timer)s).Dispose(); + }; + initialDelay.Start(); + + WriteToChat("[OK] Character stats streaming initialized"); + } + catch (Exception ex) + { + WriteToChat($"[ERROR] Character stats hot reload failed: {ex.Message}"); + } + WriteToChat("Hot reload initialization completed!"); } diff --git a/MosswartMassacre/Views/VVSTabbedMainView.cs b/MosswartMassacre/Views/VVSTabbedMainView.cs index 1c1c1d6..cccbebc 100644 --- a/MosswartMassacre/Views/VVSTabbedMainView.cs +++ b/MosswartMassacre/Views/VVSTabbedMainView.cs @@ -1047,6 +1047,12 @@ namespace MosswartMassacre.Views PluginCore.WriteToChat($"Error refreshing settings from config: {ex.Message}"); } } + + public static void RestorePosition() + { + instance?.RestoreWindowPosition(); + instance?.KeepWindowInBounds(); + } #endregion #region Status Update Methods diff --git a/MosswartMassacre/bin/Release/MosswartMassacre.dll b/MosswartMassacre/bin/Release/MosswartMassacre.dll index d1ee6a9..6503adc 100644 Binary files a/MosswartMassacre/bin/Release/MosswartMassacre.dll and b/MosswartMassacre/bin/Release/MosswartMassacre.dll differ