From 9e1f55964442a8fb82f723e5747cc01fc8b18b51 Mon Sep 17 00:00:00 2001 From: JonKazama-Hellion Date: Sun, 3 May 2026 13:01:07 +0200 Subject: [PATCH] config: pivot pop-out input from per-tab to global master switch --- ChatTwo/Configuration.cs | 13 ++++++++----- ChatTwo/Plugin.cs | 13 ++++++------- ChatTwo/Ui/Popout.cs | 8 ++++---- ChatTwo/Ui/SettingsTabs/Tabs.cs | 6 ------ ChatTwo/Ui/SettingsTabs/Window.cs | 5 +++++ 5 files changed, 23 insertions(+), 22 deletions(-) diff --git a/ChatTwo/Configuration.cs b/ChatTwo/Configuration.cs index 367b4fa..f2238de 100755 --- a/ChatTwo/Configuration.cs +++ b/ChatTwo/Configuration.cs @@ -108,6 +108,13 @@ public class Configuration : IPluginConfiguration // pop-out window; never reset after that. public bool SeenPopOutInputHint; + // Hellion Chat — v0.6.0 master switch for the pop-out input bar. + // Global on purpose: per-tab makes no sense for Auto-Tell-Tabs which + // are session-only and would force the user to re-enable it for every + // new conversation. Default OFF so existing users see no behavior + // change after the v10→v11 migration. + public bool PopOutInputEnabled; + public int GetRetentionDays(ChatType type) { if (RetentionPerChannelDays.TryGetValue(type, out var userOverride)) @@ -303,6 +310,7 @@ public class Configuration : IPluginConfiguration AutoTellTabsShowGreetedToggle = other.AutoTellTabsShowGreetedToggle; SeenPopOutInputHint = other.SeenPopOutInputHint; + PopOutInputEnabled = other.PopOutInputEnabled; } } @@ -350,10 +358,6 @@ public class Tab public bool DisplayTimestamp = true; public InputChannel? Channel; public bool PopOut; - // Hellion Chat — v0.6.0 opt-in input bar inside the pop-out window for - // this tab. Independent text buffer and channel state per pop-out; - // history is shared with the main window via InputHistoryService. - public bool PopOutInputEnabled; public bool IndependentOpacity; public float Opacity = 100f; public bool InputDisabled; @@ -434,7 +438,6 @@ public class Tab DisplayTimestamp = DisplayTimestamp, Channel = Channel, PopOut = PopOut, - PopOutInputEnabled = PopOutInputEnabled, IndependentOpacity = IndependentOpacity, Opacity = Opacity, Identifier = Identifier, diff --git a/ChatTwo/Plugin.cs b/ChatTwo/Plugin.cs index f12f544..c74306f 100755 --- a/ChatTwo/Plugin.cs +++ b/ChatTwo/Plugin.cs @@ -152,19 +152,18 @@ public sealed class Plugin : IDalamudPlugin }); } - // Hellion Chat v10 → v11 — adds Tab.PopOutInputEnabled and - // Configuration.SeenPopOutInputHint for the v0.6.0 pop-out input - // feature. Lightweight migration: defaults the new fields, no - // user-facing notification because the change is opt-in only. + // Hellion Chat v10 → v11 — adds the global Configuration.PopOutInputEnabled + // master switch and SeenPopOutInputHint flag for the v0.6.0 pop-out + // input feature. Lightweight migration: defaults both fields, + // no user-facing notification because the change is opt-in only. if (Config.Version < 11) { - foreach (var tab in Config.Tabs) - tab.PopOutInputEnabled = false; + Config.PopOutInputEnabled = false; Config.SeenPopOutInputHint = false; Config.Version = 11; SaveConfig(); Log.Information( - "Migrated config v10 → v11: PopOutInputEnabled added per tab (default off), " + + "Migrated config v10 → v11: PopOutInputEnabled added (global, default off), " + "SeenPopOutInputHint added (default false)"); } diff --git a/ChatTwo/Ui/Popout.cs b/ChatTwo/Ui/Popout.cs index c3cb7d8..6c17c3b 100644 --- a/ChatTwo/Ui/Popout.cs +++ b/ChatTwo/Ui/Popout.cs @@ -107,9 +107,9 @@ internal class Popout : Window // v0.6.0 — pop-out optional input bar. Reserve height first so the // message log draws into the right region; only shown when the - // per-tab toggle is on. Toggle-OFF resets InputBar so the next - // toggle-ON gives a fresh buffer (no stale text persists). - var inputEnabled = Tab.PopOutInputEnabled; + // global master switch is on. Toggle-OFF resets InputBar so the + // next toggle-ON gives a fresh buffer (no stale text persists). + var inputEnabled = Plugin.Config.PopOutInputEnabled; if (!inputEnabled && InputBar != null) { InputBar = null; @@ -145,7 +145,7 @@ internal class Popout : Window return 0f; // Inline strings — i18n keys follow in Task 29 (Phase E). - const string hintText = "Neu in v0.6.0: Du kannst jetzt direkt im Pop-Out tippen. Pro Tab in den Tab-Settings aktivieren."; + const string hintText = "Neu in v0.6.0: Du kannst jetzt direkt im Pop-Out tippen. Master-Switch in den Fenster-Settings aktivieren."; const string ackLabel = "Verstanden"; const string openLabel = "Tab-Settings öffnen"; diff --git a/ChatTwo/Ui/SettingsTabs/Tabs.cs b/ChatTwo/Ui/SettingsTabs/Tabs.cs index 8ba4248..1f4b7ee 100755 --- a/ChatTwo/Ui/SettingsTabs/Tabs.cs +++ b/ChatTwo/Ui/SettingsTabs/Tabs.cs @@ -96,12 +96,6 @@ internal sealed class Tabs : ISettingsTab if (tab.PopOut) { using var _ = ImRaii.PushIndent(10.0f); - // v0.6.0 — Pop-Out optional input bar. Inline strings; i18n - // keys follow in Task 29 (Phase E). - ImGui.Checkbox("Eingabe im Pop-Out aktivieren", ref tab.PopOutInputEnabled); - ImGuiUtil.HelpMarker("Erlaubt direktes Tippen und Absenden im Pop-Out-Fenster dieses Tabs. Jedes Pop-Out hat einen eigenen Text-Buffer; Channel-Wechsel wirkt global wie im Hauptfenster."); - ImGui.Spacing(); - ImGui.Checkbox(Language.Options_Tabs_IndependentOpacity, ref tab.IndependentOpacity); if (tab.IndependentOpacity) ImGuiUtil.DragFloatVertical(Language.Options_Tabs_Opacity, ref tab.Opacity, 0.25f, 0f, 100f, $"{tab.Opacity:N2}%%", ImGuiSliderFlags.AlwaysClamp); diff --git a/ChatTwo/Ui/SettingsTabs/Window.cs b/ChatTwo/Ui/SettingsTabs/Window.cs index 109bc78..a522a3e 100644 --- a/ChatTwo/Ui/SettingsTabs/Window.cs +++ b/ChatTwo/Ui/SettingsTabs/Window.cs @@ -133,6 +133,11 @@ internal sealed class Window : ISettingsTab ImGui.Checkbox(Language.Options_ShowPopOutTitleBar_Name, ref Mutable.ShowPopOutTitleBar); + // v0.6.0 — global master switch for the pop-out input bar. + // Inline strings; i18n keys follow in Task 29 (Phase E). + ImGui.Checkbox("Eingabe in Pop-Outs aktivieren", ref Mutable.PopOutInputEnabled); + ImGuiUtil.HelpMarker("Master-Switch: erlaubt direktes Tippen und Absenden in jedem Pop-Out-Fenster (inkl. Auto-Tell-Tabs). Channel-Wechsel im Pop-Out wirkt global wie im Hauptfenster; Text-Buffer und History-Cursor sind pro Pop-Out unabhängig."); + ImGui.Checkbox(Language.Options_ShowHideButton_Name, ref Mutable.ShowHideButton); ImGuiUtil.HelpMarker(Language.Options_ShowHideButton_Description);