From 757370dd53297e9e35ef2d17ce803f97dd39bf86 Mon Sep 17 00:00:00 2001 From: JonKazama-Hellion Date: Sat, 2 May 2026 14:19:35 +0200 Subject: [PATCH] feat(auto-tell-tabs): add settings sections in chat and privacy tabs with help-marker pattern --- ChatTwo/Ui/SettingsTabs/ChatLog.cs | 37 ++++++++++++++++++++++++++++++ ChatTwo/Ui/SettingsTabs/Privacy.cs | 28 ++++++++++++++++++++++ ChatTwo/Util/ImGuiUtil.cs | 18 +++++++++++++++ 3 files changed, 83 insertions(+) diff --git a/ChatTwo/Ui/SettingsTabs/ChatLog.cs b/ChatTwo/Ui/SettingsTabs/ChatLog.cs index b8bb944..426a34c 100644 --- a/ChatTwo/Ui/SettingsTabs/ChatLog.cs +++ b/ChatTwo/Ui/SettingsTabs/ChatLog.cs @@ -1,6 +1,7 @@ using ChatTwo.Resources; using ChatTwo.Util; using Dalamud.Interface.Style; +using Dalamud.Interface.Utility; using Dalamud.Interface.Utility.Raii; using Dalamud.Bindings.ImGui; @@ -92,6 +93,12 @@ internal sealed class ChatLog : ISettingsTab Plugin.ChatLogWindow.Position = pos; ImGuiUtil.WarningText(Language.Options_AdjustPosition_Warning); ImGui.Spacing(); + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Spacing(); + + DrawAutoTellTabsSection(); } if (!Mutable.OverrideStyle) @@ -116,4 +123,34 @@ internal sealed class ChatLog : ISettingsTab ImGui.Spacing(); } + + private void DrawAutoTellTabsSection() + { + using var tree = ImRaii.TreeNode(HellionStrings.ChatLog_AutoTellTabs_Section_Title); + if (!tree.Success) + return; + + using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false)) + { + ImGui.Checkbox(HellionStrings.ChatLog_AutoTellTabs_Enable_Name, ref Mutable.EnableAutoTellTabs); + ImGuiUtil.HelpMarker(HellionStrings.ChatLog_AutoTellTabs_Enable_Description); + + ImGui.SetNextItemWidth(200f * ImGuiHelpers.GlobalScale); + var limit = Mutable.AutoTellTabsLimit; + if (ImGui.SliderInt(HellionStrings.ChatLog_AutoTellTabs_Limit_Name, ref limit, 1, 50)) + { + Mutable.AutoTellTabsLimit = limit; + } + ImGuiUtil.HelpMarker(HellionStrings.ChatLog_AutoTellTabs_Limit_Description); + + ImGui.Checkbox(HellionStrings.ChatLog_AutoTellTabs_Compact_Name, ref Mutable.AutoTellTabsCompactDisplay); + ImGuiUtil.HelpMarker(HellionStrings.ChatLog_AutoTellTabs_Compact_Description); + + ImGui.Spacing(); + ImGuiUtil.HelpText(HellionStrings.ChatLog_AutoTellTabs_PreloadHint); + + ImGui.Spacing(); + ImGuiUtil.WarningText(HellionStrings.ChatLog_AutoTellTabs_ConflictHint); + } + } } diff --git a/ChatTwo/Ui/SettingsTabs/Privacy.cs b/ChatTwo/Ui/SettingsTabs/Privacy.cs index 9db5cfe..46d3ca9 100644 --- a/ChatTwo/Ui/SettingsTabs/Privacy.cs +++ b/ChatTwo/Ui/SettingsTabs/Privacy.cs @@ -4,6 +4,7 @@ using ChatTwo.Privacy; using ChatTwo.Resources; using ChatTwo.Util; using Dalamud.Interface.ImGuiNotification; +using Dalamud.Interface.Utility; using Dalamud.Interface.Utility.Raii; using Dalamud.Bindings.ImGui; @@ -186,6 +187,33 @@ internal sealed class Privacy : ISettingsTab ImGui.Spacing(); DrawExportSection(); + + ImGui.Spacing(); + ImGui.Separator(); + ImGui.Spacing(); + + DrawAutoTellTabsPreloadSection(); + } + + private void DrawAutoTellTabsPreloadSection() + { + using var tree = ImRaii.TreeNode(HellionStrings.Privacy_AutoTellTabs_Section_Title); + if (!tree.Success) + return; + + using (ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false)) + { + var preload = Mutable.AutoTellTabsHistoryPreload; + ImGui.SetNextItemWidth(200f * ImGuiHelpers.GlobalScale); + if (ImGui.SliderInt(HellionStrings.Privacy_AutoTellTabs_Preload_Name, ref preload, 0, 100)) + { + Mutable.AutoTellTabsHistoryPreload = preload; + } + ImGuiUtil.HelpMarker(HellionStrings.Privacy_AutoTellTabs_Preload_Description); + + ImGui.Spacing(); + ImGuiUtil.HelpText(HellionStrings.Privacy_AutoTellTabs_Preload_Hint); + } } private void DrawExportSection() diff --git a/ChatTwo/Util/ImGuiUtil.cs b/ChatTwo/Util/ImGuiUtil.cs index 75b17fb..366dcce 100755 --- a/ChatTwo/Util/ImGuiUtil.cs +++ b/ChatTwo/Util/ImGuiUtil.cs @@ -215,6 +215,24 @@ internal static class ImGuiUtil ImGui.TextUnformatted(text); } + // Hellion Chat — compact help affordance: a dimmed "(?)" glyph rendered + // on the same line as the previous item, with the long-form description + // tucked into a hover tooltip. Lets us keep the settings panes scannable + // instead of stacking a wall of HelpText paragraphs under every option. + internal static void HelpMarker(string description) + { + ImGui.SameLine(); + using (ImRaii.PushColor(ImGuiCol.Text, ImGui.GetStyle().Colors[(int) ImGuiCol.TextDisabled])) + ImGui.TextUnformatted("(?)"); + + if (!ImGui.IsItemHovered()) + return; + + using var tooltip = ImRaii.Tooltip(); + using (ImRaii.TextWrapPos(35.0f * ImGui.GetFontSize())) + ImGui.TextUnformatted(description); + } + internal static void WarningText(string text, bool wrap = true) { var style = StyleModel.GetConfiguredStyle() ?? StyleModel.GetFromCurrent();