diff --git a/HellionChat/Configuration.cs b/HellionChat/Configuration.cs index 644bf42..ac6f7da 100755 --- a/HellionChat/Configuration.cs +++ b/HellionChat/Configuration.cs @@ -35,7 +35,7 @@ public class ConfigKeyBind [Serializable] public class Configuration : IPluginConfiguration { - private const int LatestVersion = 19; + private const int LatestVersion = 20; public int Version { get; set; } = LatestVersion; @@ -252,6 +252,15 @@ public class Configuration : IPluginConfiguration public ConfigKeyBind? ChatTabForward; public ConfigKeyBind? ChatTabBackward; + // v20 fields: window visibility state, channel popout pool size and + // sidebar auto-switch threshold. All initializers double as the + // migration defaults for configs loaded at v19 or earlier. + public bool MainWindowOpen = true; + public bool SettingsWindowOpen; + public int MaxParallelPopouts = 8; + public TellAutoOpenMode TellAutoOpenMode = TellAutoOpenMode.Sidebar; + public int SidebarAutoSwitchThresholdPx = 800; + public void UpdateFrom(Configuration other, bool backToOriginal) { if (backToOriginal) @@ -392,9 +401,24 @@ public class Configuration : IPluginConfiguration WorldSuffixMode = other.WorldSuffixMode; NameFormMode = other.NameFormMode; + + MainWindowOpen = other.MainWindowOpen; + SettingsWindowOpen = other.SettingsWindowOpen; + MaxParallelPopouts = other.MaxParallelPopouts; + TellAutoOpenMode = other.TellAutoOpenMode; + SidebarAutoSwitchThresholdPx = other.SidebarAutoSwitchThresholdPx; } } +[Serializable] +public enum TellAutoOpenMode +{ + Off, + Sidebar, + TopTab, + Popout, +} + [Serializable] public enum UnreadMode { diff --git a/HellionChat/Plugin.cs b/HellionChat/Plugin.cs index 5c090a4..078a61a 100755 --- a/HellionChat/Plugin.cs +++ b/HellionChat/Plugin.cs @@ -200,11 +200,12 @@ public sealed class Plugin : IAsyncDalamudPlugin // do not touch either static, so the brief null-window is safe. // Schema gate: v1.4.x+ requires config v16+. Users on older schemas - // must install v1.4.2 first to run the migration chain. v19 adds the + // must install v1.4.2 first to run the migration chain. v19 added the // top-level CustomSoundVolume, WindowOpacityInactive, WorldSuffixMode - // and NameFormMode fields — all additive with defaults, so v16-v18 - // configs load cleanly and get their Version stamp bumped after the - // gate. + // and NameFormMode fields; v20 adds MainWindowOpen, SettingsWindowOpen, + // MaxParallelPopouts, TellAutoOpenMode and SidebarAutoSwitchThresholdPx + // — all additive with defaults, so v16-v19 configs load cleanly and + // get their Version stamp bumped after the gate. if (Config.Version < 16) { throw new InvalidOperationException( @@ -212,7 +213,7 @@ public sealed class Plugin : IAsyncDalamudPlugin + "Please install v1.4.2 first to migrate the configuration, then upgrade to v1.4.10." ); } - Config.Version = 19; + Config.Version = 20; // Unpinned TempTabs are session-only and dropped on every load. Pinned // TempTabs survive reload — Jin's tester feedback (v1.4.7).