From c22b169b73ad5dca27ee41dd6a97ae3553e7e3f0 Mon Sep 17 00:00:00 2001 From: JonKazama-Hellion Date: Sat, 2 May 2026 17:36:31 +0200 Subject: [PATCH] chore(settings): remove legacy settings tab files The nine legacy tab implementations were superseded by the new eight themed tabs. Removing them now that the consolidated structure is in place keeps SettingsTabs/ aligned with what actually ships. --- ChatTwo/Ui/SettingsTabs/About.cs | 128 ------------------ ChatTwo/Ui/SettingsTabs/Changelog.cs | 51 -------- ChatTwo/Ui/SettingsTabs/ChatColours.cs | 69 ---------- ChatTwo/Ui/SettingsTabs/ChatLog.cs | 159 ----------------------- ChatTwo/Ui/SettingsTabs/Display.cs | 116 ----------------- ChatTwo/Ui/SettingsTabs/Emote.cs | 113 ---------------- ChatTwo/Ui/SettingsTabs/Fonts.cs | 97 -------------- ChatTwo/Ui/SettingsTabs/Miscellaneous.cs | 62 --------- ChatTwo/Ui/SettingsTabs/Preview.cs | 42 ------ 9 files changed, 837 deletions(-) delete mode 100755 ChatTwo/Ui/SettingsTabs/About.cs delete mode 100644 ChatTwo/Ui/SettingsTabs/Changelog.cs delete mode 100755 ChatTwo/Ui/SettingsTabs/ChatColours.cs delete mode 100644 ChatTwo/Ui/SettingsTabs/ChatLog.cs delete mode 100755 ChatTwo/Ui/SettingsTabs/Display.cs delete mode 100644 ChatTwo/Ui/SettingsTabs/Emote.cs delete mode 100755 ChatTwo/Ui/SettingsTabs/Fonts.cs delete mode 100755 ChatTwo/Ui/SettingsTabs/Miscellaneous.cs delete mode 100644 ChatTwo/Ui/SettingsTabs/Preview.cs diff --git a/ChatTwo/Ui/SettingsTabs/About.cs b/ChatTwo/Ui/SettingsTabs/About.cs deleted file mode 100755 index fde0a6d..0000000 --- a/ChatTwo/Ui/SettingsTabs/About.cs +++ /dev/null @@ -1,128 +0,0 @@ -using System.Numerics; -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Interface; -using Dalamud.Interface.Colors; -using Dalamud.Interface.Utility; -using Dalamud.Interface.Utility.Raii; -using Dalamud.Bindings.ImGui; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class About : ISettingsTab -{ - public string Name => string.Format(Language.Options_About_Tab, Plugin.PluginName) + "###tabs-about"; - - private readonly List Translators = - [ - "q673135110", "Akizem", "d0tiKs", - "Moonlight_Everlit", "Dark32", "andreycout", - "Button_", "Cali666", "cassandra308", - "lokinmodar", "jtabox", "AkiraYorumoto", - "MKhayle", "elena.space", "imlisa", - "andrei5125", "ShivaMaheshvara", "aislinn87", - "nishinatsu051", "lichuyuan", "Risu64", - "yummypillow", "witchymary", "Yuzumi", - "zomsakura", "Sirayuki" - ]; - - internal About() - { - Translators.Sort((a, b) => string.Compare(a.ToLowerInvariant(), b.ToLowerInvariant(), StringComparison.Ordinal)); - } - - public void Draw(bool changed) - { - using var wrap = ImRaii.TextWrapPos(0.0f); - - ImGui.TextUnformatted(string.Format(Language.Options_About_Opening, Plugin.PluginName)); - - ImGuiHelpers.ScaledDummy(10.0f); - - ImGui.TextUnformatted(Language.Options_About_Authors); - ImGui.SameLine(); - ImGui.TextColored(ImGuiColors.ParsedGold, Plugin.Interface.Manifest.Author); - - ImGui.TextUnformatted(Language.Options_About_Discord); - ImGui.SameLine(); - ImGui.TextColored(ImGuiColors.ParsedGold, "@j.j_kazama"); - - ImGui.TextUnformatted(Language.Options_About_Version); - ImGui.SameLine(); - ImGui.TextColored(ImGuiColors.ParsedOrange, Plugin.Interface.Manifest.AssemblyVersion.ToString(3)); - - ImGuiHelpers.ScaledDummy(10.0f); - - ImGui.TextUnformatted(Language.Options_About_Github_Issues); - ImGui.SameLine(); - if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "githubIssues")) - Dalamud.Utility.Util.OpenLink("https://github.com/JonKazama-Hellion/HellionChat/issues"); - - ImGuiHelpers.ScaledDummy(10.0f); - - ImGui.TextColored(ImGuiColors.ParsedGold, HellionStrings.About_Maintainer_Heading); - ImGui.TextUnformatted(HellionStrings.About_Maintainer_Body); - ImGui.TextUnformatted(HellionStrings.About_Maintainer_Website_Label); - ImGui.SameLine(); - if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "hellionMedia")) - Dalamud.Utility.Util.OpenLink("https://hellion-media.de"); - - ImGuiHelpers.ScaledDummy(10.0f); - - ImGui.TextColored(ImGuiColors.ParsedGold, HellionStrings.About_Mission_Heading); - ImGui.TextUnformatted(HellionStrings.About_Mission_P1); - ImGui.Spacing(); - ImGui.TextUnformatted(HellionStrings.About_Mission_P2); - ImGui.Spacing(); - ImGui.TextUnformatted(HellionStrings.About_Mission_P3); - - ImGuiHelpers.ScaledDummy(10.0f); - - ImGui.TextColored(ImGuiColors.ParsedGold, HellionStrings.About_BuiltOn_Heading); - ImGui.TextUnformatted(HellionStrings.About_BuiltOn_P1); - ImGui.Spacing(); - ImGui.TextUnformatted(HellionStrings.About_BuiltOn_P2); - ImGui.Spacing(); - ImGui.TextUnformatted(HellionStrings.About_BuiltOn_Upstream_Label); - ImGui.SameLine(); - if (ImGuiUtil.IconButton(FontAwesomeIcon.ExternalLinkAlt, "chatTwoUpstream")) - Dalamud.Utility.Util.OpenLink("https://github.com/Infiziert90/ChatTwo"); - - ImGuiHelpers.ScaledDummy(10.0f); - - ImGui.TextColored(ImGuiColors.ParsedGold, HellionStrings.About_License_Heading); - ImGui.TextUnformatted(HellionStrings.About_License_P1); - ImGui.TextUnformatted(HellionStrings.About_License_P2); - ImGui.TextUnformatted(HellionStrings.About_License_P3); - - ImGuiHelpers.ScaledDummy(10.0f); - - ImGui.TextColored(ImGuiColors.DalamudOrange, HellionStrings.About_SE_Heading); - ImGui.TextUnformatted(HellionStrings.About_SE_P1); - ImGui.TextUnformatted(HellionStrings.About_SE_P2); - - ImGui.Spacing(); - - ImGui.TextColored(ImGuiColors.ParsedGold, HellionStrings.About_Localization_Heading); - ImGui.TextUnformatted(HellionStrings.About_Localization_P1); - ImGui.TextUnformatted(HellionStrings.About_Localization_P2); - - ImGui.Spacing(); - - // The translator list lives at the bottom of the About tab. Render - // it directly inside the parent scroll container instead of a - // fixed-height child — the previous "remaining space" calculation - // shrank to zero (or below) once the About copy grew, which made - // the section unreachable on smaller settings windows. - using (var treeNode = ImRaii.TreeNode(HellionStrings.About_Translators_TreeNode)) - { - if (treeNode) - { - using var indent = ImRaii.PushIndent(ImGui.GetStyle().IndentSpacing, false); - foreach (var translator in Translators) - ImGui.TextUnformatted(translator); - } - } - ImGui.Spacing(); - } -} diff --git a/ChatTwo/Ui/SettingsTabs/Changelog.cs b/ChatTwo/Ui/SettingsTabs/Changelog.cs deleted file mode 100644 index 8ee43a7..0000000 --- a/ChatTwo/Ui/SettingsTabs/Changelog.cs +++ /dev/null @@ -1,51 +0,0 @@ -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Interface.Utility.Raii; -using Dalamud.Bindings.ImGui; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class Changelog : ISettingsTab -{ - private Configuration Mutable { get; } - - public string Name => Language.Options_Changelog_Tab + "###tabs-changelog"; - - internal Changelog(Configuration mutable) - { - Mutable = mutable; - } - - public void Draw(bool changed) - { - using var wrap = ImRaii.TextWrapPos(0.0f); - - ImGui.TextUnformatted(Language.Options_Warning_NotImplemented); - ImGuiUtil.OptionCheckbox(ref Mutable.PrintChangelog, Language.Options_PrintChangelog_Name, Language.Options_PrintChangelog_Description); - - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - - var changelog = Plugin.Interface.Manifest.Changelog; - if (changelog != null) - { - ImGui.TextUnformatted(Language.Options_Changelog_Header); - ImGui.TextUnformatted($"Version {Plugin.Interface.Manifest.AssemblyVersion.ToString(3)}"); - ImGui.Spacing(); - foreach (var sentence in changelog.Split("\n")) - { - if (sentence == string.Empty) - { - ImGui.NewLine(); - continue; - } - - var condition = sentence.StartsWith('-') || sentence.StartsWith(" -"); - using var indent = ImRaii.PushIndent(10.0f, true, condition); - ImGui.TextUnformatted(sentence); - } - } - ImGui.Spacing(); - } -} diff --git a/ChatTwo/Ui/SettingsTabs/ChatColours.cs b/ChatTwo/Ui/SettingsTabs/ChatColours.cs deleted file mode 100755 index 18f784f..0000000 --- a/ChatTwo/Ui/SettingsTabs/ChatColours.cs +++ /dev/null @@ -1,69 +0,0 @@ -using ChatTwo.Code; -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Interface; -using Dalamud.Bindings.ImGui; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class ChatColours : ISettingsTab -{ - private Plugin Plugin { get; } - private Configuration Mutable { get; } - - public string Name => Language.Options_ChatColours_Tab + "###tabs-chat-colours"; - - internal ChatColours(Plugin plugin, Configuration mutable) - { - Plugin = plugin; - Mutable = mutable; - - #if DEBUG - // Users can set colours for ExtraChat linkshells in the ExtraChat plugin directly. - var sortable = ChatTypeExt.SortOrder - .SelectMany(entry => entry.Item2) - .Where(type => !type.IsGm() && !type.IsExtraChatLinkshell()) - .ToHashSet(); - var total = Enum.GetValues() - .Where(type => !type.IsGm() && !type.IsExtraChatLinkshell()) - .ToHashSet(); - if (sortable.Count != total.Count) - { - Plugin.Log.Warning($"There are {sortable.Count} sortable channels, but there are {total.Count} total channels."); - total.ExceptWith(sortable); - foreach (var missing in total) - Plugin.Log.Information($"Missing {missing}"); - } - #endif - } - - public void Draw(bool changed) - { - foreach (var (_, types) in ChatTypeExt.SortOrder) - { - foreach (var type in types) - { - if (ImGuiUtil.IconButton(FontAwesomeIcon.UndoAlt, $"{type}", Language.Options_ChatColours_Reset)) - Mutable.ChatColours.Remove(type); - - ImGui.SameLine(); - - if (ImGuiUtil.IconButton(FontAwesomeIcon.LongArrowAltDown, $"{type}", Language.Options_ChatColours_Import)) - { - var gameColour = Plugin.Functions.Chat.GetChannelColor(type); - Mutable.ChatColours[type] = gameColour ?? type.DefaultColor() ?? 0; - } - - ImGui.SameLine(); - - var vec = Mutable.ChatColours.TryGetValue(type, out var colour) - ? ColourUtil.RgbaToVector3(colour) - : ColourUtil.RgbaToVector3(type.DefaultColor() ?? 0); - if (ImGui.ColorEdit3(type.Name(), ref vec, ImGuiColorEditFlags.NoInputs)) - Mutable.ChatColours[type] = ColourUtil.Vector3ToRgba(vec); - } - } - - ImGui.Spacing(); - } -} diff --git a/ChatTwo/Ui/SettingsTabs/ChatLog.cs b/ChatTwo/Ui/SettingsTabs/ChatLog.cs deleted file mode 100644 index a88f5be..0000000 --- a/ChatTwo/Ui/SettingsTabs/ChatLog.cs +++ /dev/null @@ -1,159 +0,0 @@ -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Interface.Style; -using Dalamud.Interface.Utility; -using Dalamud.Interface.Utility.Raii; -using Dalamud.Bindings.ImGui; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class ChatLog : ISettingsTab -{ - private readonly Plugin Plugin; - private Configuration Mutable { get; } - - public string Name => Language.Options_ChatLog_Tab + "###tabs-chatlog"; - - internal ChatLog(Plugin plugin, Configuration mutable) - { - Plugin = plugin; - Mutable = mutable; - } - - public void Draw(bool changed) - { - using (ImRaii.TextWrapPos(0.0f)) - { - ImGuiUtil.OptionCheckbox(ref Mutable.KeepInputFocus, Language.Options_KeepInputFocus_Name, Language.Options_KeepInputFocus_Description); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.PlaySounds, Language.Options_PlaySounds_Name, Language.Options_PlaySounds_Description); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.SidebarTabView, Language.Options_SidebarTabView_Name, string.Format(Language.Options_SidebarTabView_Description, Plugin.PluginName)); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.ShowNoviceNetwork, Language.Options_ShowNoviceNetwork_Name, Language.Options_ShowNoviceNetwork_Description); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.ShowHideButton, Language.Options_ShowHideButton_Name, Language.Options_ShowHideButton_Description); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.NativeItemTooltips, Language.Options_NativeItemTooltips_Name, string.Format(Language.Options_NativeItemTooltips_Description, Plugin.PluginName)); - ImGui.Spacing(); - - if (Mutable.NativeItemTooltips) - { - ImGuiUtil.DragFloatVertical(Language.Options_TooltipOffset_Name, Language.Options_TooltipOffset_Desc, ref Mutable.TooltipOffset, 1, 0f, 400f, $"{Mutable.TooltipOffset:N0}px", ImGuiSliderFlags.AlwaysClamp); - ImGui.Spacing(); - } - - ImGuiUtil.DragFloatVertical(Language.Options_WindowOpacity_Name, ref Mutable.WindowAlpha, .25f, 0f, 100f, $"{Mutable.WindowAlpha:N2}%%", ImGuiSliderFlags.AlwaysClamp); - ImGui.Spacing(); - - if (ImGuiUtil.InputIntVertical(Language.Options_MaxLinesToShow_Name, Language.Options_MaxLinesToShow_Description, ref Mutable.MaxLinesToRender)) - Mutable.MaxLinesToRender = Math.Clamp(Mutable.MaxLinesToRender, 1, 10_000); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.CanMove, Language.Options_CanMove_Name); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.CanResize, Language.Options_CanResize_Name); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.ShowTitleBar, Language.Options_ShowTitleBar_Name); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.ShowPopOutTitleBar, Language.Options_ShowPopOutTitleBar_Name); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.OverrideStyle, Language.Options_OverrideStyle_Name, Language.Options_OverrideStyle_Name_Desc); - ImGui.Spacing(); - - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - - ImGui.TextUnformatted(Language.Options_ChatTabForwardKeybind_Name); - ImGui.SetNextItemWidth(-1); - ImGuiUtil.KeybindInput("ChatTabForwardKeybind", ref Mutable.ChatTabForward); - - ImGui.TextUnformatted(Language.Options_ChatTabBackwardKeybind_Name); - ImGui.SetNextItemWidth(-1); - ImGuiUtil.KeybindInput("ChatTabBackwardKeybind", ref Mutable.ChatTabBackward); - - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - - ImGui.TextUnformatted(Language.Options_AdjustPosition_Name); - ImGui.SetNextItemWidth(-1); - var pos = Plugin.ChatLogWindow.LastWindowPos; - if (ImGui.DragFloat2($"##{Language.Options_AdjustPosition_Name}", ref pos, 1, 0, float.MaxValue, "%.0fpx")) - Plugin.ChatLogWindow.Position = pos; - ImGuiUtil.WarningText(Language.Options_AdjustPosition_Warning); - ImGui.Spacing(); - - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - - DrawAutoTellTabsSection(); - } - - if (!Mutable.OverrideStyle) - return; - - var styles = StyleModel.GetConfiguredStyles(); - if (styles == null) - { - ImGui.TextUnformatted(Language.Options_OverrideStyle_NotAvailable); - ImGui.Spacing(); - return; - } - - var currentStyle = Mutable.ChosenStyle ?? Language.Options_OverrideStyle_NotSelected; - using var combo = ImRaii.Combo(Language.Options_OverrideStyleDropdown_Name, currentStyle); - if (combo) - { - foreach (var style in styles) - if (ImGui.Selectable(style.Name, Mutable.ChosenStyle == style.Name)) - Mutable.ChosenStyle = style.Name; - } - - 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.Checkbox(HellionStrings.ChatLog_AutoTellTabs_GreetedToggle_Name, ref Mutable.AutoTellTabsShowGreetedToggle); - ImGuiUtil.HelpMarker(HellionStrings.ChatLog_AutoTellTabs_GreetedToggle_Description); - - ImGui.Spacing(); - ImGuiUtil.HelpText(HellionStrings.ChatLog_AutoTellTabs_PreloadHint); - - ImGui.Spacing(); - ImGuiUtil.WarningText(HellionStrings.ChatLog_AutoTellTabs_ConflictHint); - } - } -} diff --git a/ChatTwo/Ui/SettingsTabs/Display.cs b/ChatTwo/Ui/SettingsTabs/Display.cs deleted file mode 100755 index 1f2ec64..0000000 --- a/ChatTwo/Ui/SettingsTabs/Display.cs +++ /dev/null @@ -1,116 +0,0 @@ -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Interface.Utility.Raii; -using Dalamud.Bindings.ImGui; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class Display : ISettingsTab -{ - private Configuration Mutable { get; } - - public string Name => Language.Options_Display_Tab + "###tabs-display"; - - internal Display(Configuration mutable) - { - Mutable = mutable; - } - - public void Draw(bool changed) - { - using var wrap = ImRaii.TextWrapPos(0.0f); - - ImGuiUtil.OptionCheckbox(ref Mutable.HideChat, Language.Options_HideChat_Name, Language.Options_HideChat_Description); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.HideDuringCutscenes, Language.Options_HideDuringCutscenes_Name, string.Format(Language.Options_HideDuringCutscenes_Description, Plugin.PluginName)); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.HideWhenNotLoggedIn, Language.Options_HideWhenNotLoggedIn_Name, string.Format(Language.Options_HideWhenNotLoggedIn_Description, Plugin.PluginName)); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.HideWhenUiHidden, Language.Options_HideWhenUiHidden_Name, string.Format(Language.Options_HideWhenUiHidden_Description, Plugin.PluginName)); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.HideInLoadingScreens, Language.Options_HideInLoadingScreens_Name, string.Format(Language.Options_HideInLoadingScreens_Description, Plugin.PluginName)); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.HideInBattle, Language.Options_HideInBattle_Name, Language.Options_HideInBattle_Description); - ImGui.Spacing(); - - ImGui.Separator(); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.HideWhenInactive, Language.Options_HideWhenInactive_Name, Language.Options_HideWhenInactive_Description); - ImGui.Spacing(); - - if (Mutable.HideWhenInactive) - { - using var _ = ImRaii.PushIndent(); - ImGuiUtil.InputIntVertical(Language.Options_InactivityHideTimeout_Name, - Language.Options_InactivityHideTimeout_Description, ref Mutable.InactivityHideTimeout, 1, 10); - // Enforce a minimum of 2 seconds to avoid people soft locking - // themselves. - Mutable.InactivityHideTimeout = Math.Max(2, Mutable.InactivityHideTimeout); - ImGui.Spacing(); - - // This setting conflicts with HideInBattle, so it's disabled. - using (ImRaii.Disabled(Mutable.HideInBattle)) - { - ImGuiUtil.OptionCheckbox(ref Mutable.InactivityHideActiveDuringBattle, - Language.Options_InactivityHideActiveDuringBattle_Name, - Language.Options_InactivityHideActiveDuringBattle_Description); - ImGui.Spacing(); - } - - using var channelTree = ImRaii.TreeNode(Language.Options_InactivityHideChannels_Name); - if (channelTree.Success) - { - if (ImGuiUtil.CtrlShiftButton(Language.Options_InactivityHideChannels_All_Label, Language.Options_InactivityHideChannels_Button_Tooltip)) - { - Mutable.InactivityHideChannelsV2 = TabsUtil.AllChannels(); - Mutable.InactivityHideExtraChatAll = true; - Mutable.InactivityHideExtraChatChannels = []; - } - - ImGui.SameLine(); - if (ImGuiUtil.CtrlShiftButton(Language.Options_InactivityHideChannels_None_Label, Language.Options_InactivityHideChannels_Button_Tooltip)) - { - Mutable.InactivityHideChannelsV2 = []; - Mutable.InactivityHideExtraChatAll = false; - Mutable.InactivityHideExtraChatChannels = []; - } - - ImGui.Spacing(); - - ImGuiUtil.ChannelSelector(Language.Options_Tabs_Channels, Mutable.InactivityHideChannelsV2); - ImGuiUtil.ExtraChatSelector(Language.Options_Tabs_ExtraChatChannels, - ref Mutable.InactivityHideExtraChatAll, Mutable.InactivityHideExtraChatChannels); - } - ImGui.Spacing(); - } - - ImGui.Separator(); - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.Use24HourClock, Language.Options_Use24HourClock_Name, Language.Options_Use24HourClock_Description); - - ImGuiUtil.OptionCheckbox(ref Mutable.PrettierTimestamps, Language.Options_PrettierTimestamps_Name, Language.Options_PrettierTimestamps_Description); - - if (Mutable.PrettierTimestamps) - { - using var _ = ImRaii.PushIndent(); - ImGuiUtil.OptionCheckbox(ref Mutable.MoreCompactPretty, Language.Options_MoreCompactPretty_Name, Language.Options_MoreCompactPretty_Description); - ImGuiUtil.OptionCheckbox(ref Mutable.HideSameTimestamps, Language.Options_HideSameTimestamps_Name, Language.Options_HideSameTimestamps_Description); - } - ImGui.Spacing(); - - ImGuiUtil.OptionCheckbox(ref Mutable.CollapseDuplicateMessages, Language.Options_CollapseDuplicateMessages_Name, Language.Options_CollapseDuplicateMessages_Description); - if (Mutable.CollapseDuplicateMessages) - { - using var _ = ImRaii.PushIndent(); - ImGuiUtil.OptionCheckbox(ref Mutable.CollapseKeepUniqueLinks, Language.Options_CollapseDuplicateMsgUniqueLink_Name, Language.Options_CollapseDuplicateMsgUniqueLink_Description); - } - ImGui.Spacing(); - } -} diff --git a/ChatTwo/Ui/SettingsTabs/Emote.cs b/ChatTwo/Ui/SettingsTabs/Emote.cs deleted file mode 100644 index 64f2411..0000000 --- a/ChatTwo/Ui/SettingsTabs/Emote.cs +++ /dev/null @@ -1,113 +0,0 @@ -using System.Numerics; -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Interface; -using Dalamud.Interface.Colors; -using Dalamud.Interface.Utility.Raii; -using Dalamud.Bindings.ImGui; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class Emote : ISettingsTab -{ - private readonly Plugin Plugin; - private Configuration Mutable { get; } - - public string Name => Language.Options_Emote_Tab + "###tabs-emote"; - - private static SearchSelector.SelectorPopupOptions? WordPopupOptions; - - internal Emote(Plugin plugin, Configuration mutable) - { - Plugin = plugin; - Mutable = mutable; - - WordPopupOptions = new SearchSelector.SelectorPopupOptions - { - FilteredSheet = EmoteCache.SortedCodeArray.Where(w => !Mutable.BlockedEmotes.Contains(w)).ToArray() - }; - } - - private SearchSelector.SelectorPopupOptions RefillSheet() - { - return new SearchSelector.SelectorPopupOptions - { - FilteredSheet = EmoteCache.SortedCodeArray.Where(w => !Mutable.BlockedEmotes.Contains(w)).ToArray() - }; - } - - public void Draw(bool changed) - { - using var wrap = ImRaii.TextWrapPos(0.0f); - - ImGuiUtil.OptionCheckbox(ref Mutable.ShowEmotes, Language.Options_ShowEmotes_Name, Language.Options_ShowEmotes_Desc); - ImGui.Spacing(); - - ImGui.TextUnformatted(Language.Options_Emote_BlockedEmotes); - ImGui.Spacing(); - - WordPopupOptions ??= RefillSheet(); - if (EmoteCache.State is EmoteCache.LoadingState.Done && WordPopupOptions.FilteredSheet.Length == 0) - WordPopupOptions = RefillSheet(); - - var buttonWidth = ImGui.GetContentRegionAvail().X / 3; - using (Plugin.FontManager.FontAwesome.Push()) - ImGui.Button(FontAwesomeIcon.Plus.ToIconString(), new Vector2(buttonWidth, 0)); - - if (SearchSelector.SelectorPopup("WordAddPopup", out var newWord, WordPopupOptions)) - Mutable.BlockedEmotes.Add(newWord); - - using(var table = ImRaii.Table("##BlockedWords", 2, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInner)) - { - if (table) - { - ImGui.TableSetupColumn(Language.Options_Emote_EmoteTable); - ImGui.TableSetupColumn("##Del", ImGuiTableColumnFlags.WidthStretch, 0.07f); - - ImGui.TableHeadersRow(); - - var copiedList = Mutable.BlockedEmotes.ToArray(); - foreach (var word in copiedList) - { - ImGui.TableNextColumn(); - ImGui.TextUnformatted(word); - - ImGui.TableNextColumn(); - if (ImGuiUtil.Button($"##{word}Del", FontAwesomeIcon.Trash, !ImGui.GetIO().KeyCtrl)) - Mutable.BlockedEmotes.Remove(word); - } - } - } - - ImGui.Spacing(); - ImGui.Separator(); - ImGui.Spacing(); - - ImGui.TextUnformatted(Language.Options_Emote_EmoteStats); - ImGui.Spacing(); - - if (EmoteCache.State is EmoteCache.LoadingState.Done) - ImGui.TextColored(ImGuiColors.HealerGreen, Language.Options_Emote_Ready); - else - ImGui.TextColored(ImGuiColors.DPSRed, Language.Options_Emote_NotReady); - - ImGui.TextUnformatted($"{Language.Options_Emote_Loaded} {EmoteCache.SortedCodeArray.Length}"); - using (var emoteTable = ImRaii.Table("##LoadedEmotes", 5, ImGuiTableFlags.RowBg | ImGuiTableFlags.BordersInner)) - { - if (emoteTable) - { - ImGui.TableSetupColumn("##word1"); - ImGui.TableSetupColumn("##word2"); - ImGui.TableSetupColumn("##word3"); - ImGui.TableSetupColumn("##word4"); - ImGui.TableSetupColumn("##word5"); - - foreach (var word in EmoteCache.SortedCodeArray) - { - ImGui.TableNextColumn(); - ImGui.TextUnformatted(word); - } - } - } - } -} diff --git a/ChatTwo/Ui/SettingsTabs/Fonts.cs b/ChatTwo/Ui/SettingsTabs/Fonts.cs deleted file mode 100755 index a55543a..0000000 --- a/ChatTwo/Ui/SettingsTabs/Fonts.cs +++ /dev/null @@ -1,97 +0,0 @@ -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud; -using Dalamud.Interface.FontIdentifier; -using Dalamud.Bindings.ImGui; -using Dalamud.Interface.Utility.Raii; - -namespace ChatTwo.Ui.SettingsTabs; - -public class Fonts : ISettingsTab -{ - private Configuration Mutable { get; } - - public string Name => Language.Options_Fonts_Tab + "###tabs-fonts"; - - internal Fonts(Configuration mutable) - { - Mutable = mutable; - } - - public void Draw(bool _) - { - using var wrap = ImRaii.TextWrapPos(0.0f); - - ImGui.Checkbox(Language.Options_FontsEnabled, ref Mutable.FontsEnabled); - ImGui.Spacing(); - - if (!Mutable.FontsEnabled) - { - ImGuiUtil.FontSizeCombo(Language.Options_FontSize_Name, ref Mutable.FontSizeV2); - } - else - { - var globalChooser = ImGuiUtil.FontChooser(Language.Options_Font_Name, Mutable.GlobalFontV2, false, ref _); - globalChooser?.ResultTask.ContinueWith(r => - { - if (r.IsCompletedSuccessfully) - Mutable.GlobalFontV2 = r.Result; - }); - ImGui.SameLine(); - if (ImGui.Button("Reset##global")) - Mutable.GlobalFontV2 = new SingleFontSpec{ FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular), SizePt = 12.75f }; - - ImGuiUtil.HelpText(string.Format(Language.Options_Font_Description, Plugin.PluginName)); - ImGuiUtil.WarningText(Language.Options_Font_Warning); - ImGui.Spacing(); - - // LocaleNames being null means it is likely a game font which all support JP symbols - var japaneseChooser = ImGuiUtil.FontChooser(Language.Options_JapaneseFont_Name, Mutable.JapaneseFontV2, false, ref _, id => !id.LocaleNames?.ContainsKey("ja-jp") ?? false, "いろはにほへと ちりぬるを"); - japaneseChooser?.ResultTask.ContinueWith(r => - { - if (r.IsCompletedSuccessfully) - Mutable.JapaneseFontV2 = r.Result; - }); - ImGui.SameLine(); - if (ImGui.Button("Reset##japanese")) - Mutable.JapaneseFontV2 = new SingleFontSpec{ FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkMedium), SizePt = 12.75f }; - - ImGuiUtil.HelpText(string.Format(Language.Options_JapaneseFont_Description, Plugin.PluginName)); - ImGui.Spacing(); - - var italicChooser = ImGuiUtil.FontChooser(Language.Options_ItalicFont_Name, Mutable.ItalicFontV2, true, ref Mutable.ItalicEnabled); - italicChooser?.ResultTask.ContinueWith(r => - { - if (r.IsCompletedSuccessfully) - Mutable.ItalicFontV2 = r.Result; - }); - ImGui.SameLine(); - if (ImGui.Button("Reset##italic")) - { - Mutable.ItalicEnabled = false; - Mutable.ItalicFontV2 = new SingleFontSpec{ FontId = new DalamudAssetFontAndFamilyId(DalamudAsset.NotoSansCjkRegular), SizePt = 12.75f }; - } - - ImGuiUtil.HelpText(string.Format(Language.Options_Italic_Description, Plugin.PluginName)); - ImGui.Spacing(); - - if (ImGui.CollapsingHeader(Language.Options_ExtraGlyphs_Name)) - { - ImGuiUtil.HelpText(string.Format(Language.Options_ExtraGlyphs_Description, Plugin.PluginName)); - - var range = (int) Mutable.ExtraGlyphRanges; - foreach (var extra in Enum.GetValues()) - ImGui.CheckboxFlags(extra.Name(), ref range, (int) extra); - - Mutable.ExtraGlyphRanges = (ExtraGlyphRanges) range; - } - - ImGui.Spacing(); - } - - ImGuiUtil.FontSizeCombo(Language.Options_SymbolsFontSize_Name, ref Mutable.SymbolsFontSizeV2); - ImGuiUtil.HelpText(Language.Options_SymbolsFontSize_Description); - - ImGui.Spacing(); - } -} diff --git a/ChatTwo/Ui/SettingsTabs/Miscellaneous.cs b/ChatTwo/Ui/SettingsTabs/Miscellaneous.cs deleted file mode 100755 index e802d5e..0000000 --- a/ChatTwo/Ui/SettingsTabs/Miscellaneous.cs +++ /dev/null @@ -1,62 +0,0 @@ -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Bindings.ImGui; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class Miscellaneous(Configuration mutable) : ISettingsTab -{ - private Configuration Mutable { get; } = mutable; - public string Name => Language.Options_Miscellaneous_Tab + "###tabs-miscellaneous"; - - public void Draw(bool changed) - { - using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Language_Name, Mutable.LanguageOverride.Name())) - { - if (combo.Success) - { - foreach (var language in Enum.GetValues()) - if (ImGui.Selectable(language.Name())) - Mutable.LanguageOverride = language; - } - } - - ImGuiUtil.HelpText(string.Format(Language.Options_Language_Description, Plugin.PluginName)); - ImGui.Spacing(); - - using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_CommandHelpSide_Name, Mutable.CommandHelpSide.Name())) - { - if (combo.Success) - { - foreach (var side in Enum.GetValues()) - if (ImGui.Selectable(side.Name(), Mutable.CommandHelpSide == side)) - Mutable.CommandHelpSide = side; - } - } - - ImGuiUtil.HelpText(string.Format(Language.Options_CommandHelpSide_Description, Plugin.PluginName)); - ImGui.Spacing(); - - using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_KeybindMode_Name, Mutable.KeybindMode.Name())) - { - if (combo.Success) - { - foreach (var mode in Enum.GetValues()) - { - if (ImGui.Selectable(mode.Name(), Mutable.KeybindMode == mode)) - Mutable.KeybindMode = mode; - - if (ImGui.IsItemHovered()) - ImGuiUtil.Tooltip(mode.Tooltip() ?? ""); - } - } - } - - ImGuiUtil.HelpText(string.Format(Language.Options_KeybindMode_Description, Plugin.PluginName)); - ImGui.Spacing(); - - ImGui.Checkbox(Language.Options_SortAutoTranslate_Name, ref Mutable.SortAutoTranslate); - ImGuiUtil.HelpText(Language.Options_SortAutoTranslate_Description); - ImGui.Spacing(); - } -} diff --git a/ChatTwo/Ui/SettingsTabs/Preview.cs b/ChatTwo/Ui/SettingsTabs/Preview.cs deleted file mode 100644 index 8cc0119..0000000 --- a/ChatTwo/Ui/SettingsTabs/Preview.cs +++ /dev/null @@ -1,42 +0,0 @@ -using ChatTwo.Resources; -using ChatTwo.Util; -using Dalamud.Bindings.ImGui; -using Dalamud.Interface.Utility.Raii; - -namespace ChatTwo.Ui.SettingsTabs; - -internal sealed class Preview : ISettingsTab -{ - private Configuration Mutable { get; } - - public string Name => $"{Language.Options_Preview_Tab}###tabs-preview"; - - internal Preview(Configuration mutable) - { - Mutable = mutable; - } - - public void Draw(bool changed) - { - using var wrap = ImRaii.TextWrapPos(0.0f); - - using (var combo = ImGuiUtil.BeginComboVertical(Language.Options_Preview_Name, Mutable.PreviewPosition.Name())) - { - if (combo) - { - foreach (var position in Enum.GetValues()) - if (ImGui.Selectable(position.Name(), Mutable.PreviewPosition == position)) - Mutable.PreviewPosition = position; - } - } - ImGuiUtil.HelpText(Language.Options_Preview_Description); - ImGui.Spacing(); - - if (ImGuiUtil.InputIntVertical(Language.Options_PreviewMinimum_Name, Language.Options_PreviewMinimum_Description, ref Mutable.PreviewMinimum)) - Mutable.PreviewMinimum = Math.Clamp(Mutable.PreviewMinimum, 1, 250); - ImGui.Spacing(); - ImGuiUtil.OptionCheckbox(ref Mutable.OnlyPreviewIf, Language.Options_PreviewOnlyIf_Name, Language.Options_PreviewOnlyIf_Description); - - ImGui.Spacing(); - } -}