feat(auto-tell-tabs): add settings sections in chat and privacy tabs with help-marker pattern
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
using ChatTwo.Resources;
|
using ChatTwo.Resources;
|
||||||
using ChatTwo.Util;
|
using ChatTwo.Util;
|
||||||
using Dalamud.Interface.Style;
|
using Dalamud.Interface.Style;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
|
||||||
@@ -92,6 +93,12 @@ internal sealed class ChatLog : ISettingsTab
|
|||||||
Plugin.ChatLogWindow.Position = pos;
|
Plugin.ChatLogWindow.Position = pos;
|
||||||
ImGuiUtil.WarningText(Language.Options_AdjustPosition_Warning);
|
ImGuiUtil.WarningText(Language.Options_AdjustPosition_Warning);
|
||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
ImGui.Spacing();
|
||||||
|
ImGui.Separator();
|
||||||
|
ImGui.Spacing();
|
||||||
|
|
||||||
|
DrawAutoTellTabsSection();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Mutable.OverrideStyle)
|
if (!Mutable.OverrideStyle)
|
||||||
@@ -116,4 +123,34 @@ internal sealed class ChatLog : ISettingsTab
|
|||||||
|
|
||||||
ImGui.Spacing();
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ using ChatTwo.Privacy;
|
|||||||
using ChatTwo.Resources;
|
using ChatTwo.Resources;
|
||||||
using ChatTwo.Util;
|
using ChatTwo.Util;
|
||||||
using Dalamud.Interface.ImGuiNotification;
|
using Dalamud.Interface.ImGuiNotification;
|
||||||
|
using Dalamud.Interface.Utility;
|
||||||
using Dalamud.Interface.Utility.Raii;
|
using Dalamud.Interface.Utility.Raii;
|
||||||
using Dalamud.Bindings.ImGui;
|
using Dalamud.Bindings.ImGui;
|
||||||
|
|
||||||
@@ -186,6 +187,33 @@ internal sealed class Privacy : ISettingsTab
|
|||||||
ImGui.Spacing();
|
ImGui.Spacing();
|
||||||
|
|
||||||
DrawExportSection();
|
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()
|
private void DrawExportSection()
|
||||||
|
|||||||
@@ -215,6 +215,24 @@ internal static class ImGuiUtil
|
|||||||
ImGui.TextUnformatted(text);
|
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)
|
internal static void WarningText(string text, bool wrap = true)
|
||||||
{
|
{
|
||||||
var style = StyleModel.GetConfiguredStyle() ?? StyleModel.GetFromCurrent();
|
var style = StyleModel.GetConfiguredStyle() ?? StyleModel.GetFromCurrent();
|
||||||
|
|||||||
Reference in New Issue
Block a user