From 695ca12956f20a997baf593ed59731f3d487487f Mon Sep 17 00:00:00 2001 From: Khayle Date: Wed, 1 Jan 2025 03:55:12 +0100 Subject: [PATCH] [PUSH] v2.0.2.0 Added a custom opt-out theme setting for better visibility. --- XIVComboExpanded/Interface/Changelog.cs | 6 +++++ XIVComboExpanded/Interface/ConfigWindow.cs | 29 ++++++++++++++++++++++ XIVComboExpanded/Interface/OneTimeModal.cs | 14 +++++++++-- XIVComboExpanded/PluginConfiguration.cs | 6 +++++ 4 files changed, 53 insertions(+), 2 deletions(-) diff --git a/XIVComboExpanded/Interface/Changelog.cs b/XIVComboExpanded/Interface/Changelog.cs index d536d42c..e7c4632c 100644 --- a/XIVComboExpanded/Interface/Changelog.cs +++ b/XIVComboExpanded/Interface/Changelog.cs @@ -12,6 +12,12 @@ public static Dictionary GetChangelog() { return new Dictionary() { + { + "v2.0.2.0", + [ + "Added a custom opt-out theme setting for better visibility.", + ] + }, { "v2.0.1.4", [ diff --git a/XIVComboExpanded/Interface/ConfigWindow.cs b/XIVComboExpanded/Interface/ConfigWindow.cs index d4e6619e..b2162ae6 100644 --- a/XIVComboExpanded/Interface/ConfigWindow.cs +++ b/XIVComboExpanded/Interface/ConfigWindow.cs @@ -6,6 +6,7 @@ using Dalamud.Interface; using Dalamud.Interface.Colors; +using Dalamud.Interface.Style; using Dalamud.Interface.Textures; using Dalamud.Interface.Utility.Raii; using Dalamud.Interface.Windowing; @@ -24,6 +25,26 @@ namespace XIVComboExpandedPlugin.Interface; /// public class ConfigWindow : Window { + StyleModel currentStyle; + // Code to be executed before conditionals are applied and the window is drawn. + public override void PreDraw() + { + if (Service.Configuration.EnableTheme) + { + currentStyle = StyleModel.GetFromCurrent(); + var style = StyleModel.Deserialize("DS1H4sIAAAAAAAACqVYW3PiNhT+Kxk/ZxhZtiWbtyS0m06TTmaTne3umwIKuHEwNYa9ZPa/V7J0jmRhUiC8WLbOd246N/EaiWgcj8h59BiNX6O/1QvRb1+iMRuRX+fRNBp3H2aWT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K4A4DKY/py5uacqNxdCta2ZSiOvv0x9nlzcXVn2f3ZaXCNlIXTHMpEjvx2z9rY7WrpzxID3+sUHfXA6gOu1LJg25qT84dHB3C0SV6hbTzHUtVnR2wdeFN0WpiTArMNkIzFQzAnbGYFXHmK136bSejJAcLOU2KPMYrGeWUE528iISbulI6VxMwz3EmTliaqnkTKjy+ItSbOJPuBzNjnsQJpxnOLCaY/XG6cgfGWcoJjjl6wIUkKPSOnaoMzBVLqu4Rahs7ox2MoSqZPuZLdEMn04QEddUXlLiAeMlUU1bK+76FPx70CKylgmuZbuB4SSm61twDupnmKCPVnxfg1t4lhfVwqSkfft32rtU9IAe1bcvX1xs/Pl27c0ZY38D93US1khdnLqMUVGf0mPz6D52ZDyxdEgAA"); + style.Push(); + } + } + + // Code to be executed after the window is drawn. + public override void PostDraw() + { + StyleModel.GetFromCurrent().Pop(); + if (Service.Configuration.EnableTheme) + currentStyle.Push(); + } + public enum Tabs { Classic = 1, @@ -350,6 +371,14 @@ public override void Draw() Service.Configuration.Save(); } + var enableTheme = Service.Configuration.EnableTheme; + if (ImGui.Checkbox("Do not enforce a custom theme.", ref enableTheme)) + { + Service.Configuration.EnableTheme = enableTheme; + StyleModel.GetFromCurrent().Pop(); + Service.Configuration.Save(); + } + var hideChildren = Service.Configuration.HideChildren; if (ImGui.Checkbox("Hide children of disabled combos and features.", ref hideChildren)) { diff --git a/XIVComboExpanded/Interface/OneTimeModal.cs b/XIVComboExpanded/Interface/OneTimeModal.cs index 8b61c7f2..9e8752db 100644 --- a/XIVComboExpanded/Interface/OneTimeModal.cs +++ b/XIVComboExpanded/Interface/OneTimeModal.cs @@ -2,6 +2,7 @@ using Dalamud.Interface; using Dalamud.Interface.Colors; +using Dalamud.Interface.Style; using Dalamud.Interface.Windowing; using ImGuiNET; using XIVComboExpandedPlugin; @@ -86,7 +87,7 @@ public override void Draw() ImGuiWindowFlags window_flags = ImGuiWindowFlags.NoScrollbar | ImGuiWindowFlags.ChildWindow; ImGui.PushStyleVar(ImGuiStyleVar.ChildRounding, 5f); - ImGui.BeginChild("ModalSettings", new System.Numerics.Vector2(ImGui.GetContentRegionAvail().X - ImGui.GetScrollX(), 150f), true, window_flags); + ImGui.BeginChild("ModalSettings", new System.Numerics.Vector2(ImGui.GetContentRegionAvail().X - ImGui.GetScrollX(), 180f), true, window_flags); ImGui.PushFont(UiBuilder.MonoFont); ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.ParsedGold); @@ -114,7 +115,16 @@ public override void Draw() { Service.Configuration.BigJobIcons = bigJobIcons; Service.Configuration.Save(); - } + + } + + var enableTheme = Service.Configuration.EnableTheme; + if (ImGui.Checkbox("Do not enforce a custom theme.", ref enableTheme)) + { + Service.Configuration.EnableTheme = enableTheme; + StyleModel.GetFromCurrent().Pop(); + Service.Configuration.Save(); + } var hideIcons = Service.Configuration.HideIcons; if (ImGui.Checkbox("Hide icons for combos and features.", ref hideIcons)) diff --git a/XIVComboExpanded/PluginConfiguration.cs b/XIVComboExpanded/PluginConfiguration.cs index 5e0f5393..fb315907 100644 --- a/XIVComboExpanded/PluginConfiguration.cs +++ b/XIVComboExpanded/PluginConfiguration.cs @@ -90,6 +90,12 @@ static PluginConfiguration() [JsonProperty("Secret")] public bool EnableSecretCombos { get; set; } = false; + /// + /// Gets or sets a value indicating whether to allow and display secret combos. + /// + [JsonProperty("Theme")] + public bool EnableTheme { get; set; } = true; + /// /// Gets or sets a value indicating whether to allow and display secret combos. ///