Skip to content

Commit

Permalink
[PUSH] v2.0.2.0
Browse files Browse the repository at this point in the history
Added a custom opt-out theme setting for better visibility.
  • Loading branch information
MKhayle committed Jan 1, 2025
1 parent 88dabab commit 695ca12
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 2 deletions.
6 changes: 6 additions & 0 deletions XIVComboExpanded/Interface/Changelog.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@ public static Dictionary<string, string[]> GetChangelog()
{
return new Dictionary<string, string[]>()
{
{
"v2.0.2.0",
[
"Added a custom opt-out theme setting for better visibility.",
]
},
{
"v2.0.1.4",
[
Expand Down
29 changes: 29 additions & 0 deletions XIVComboExpanded/Interface/ConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -24,6 +25,26 @@ namespace XIVComboExpandedPlugin.Interface;
/// </summary>
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+fRNBp3H2aWTFoyoCKjTFE9qd3zaG4/Lyxtad/Fo138Y8GpBdNOxLPdrezzBTShPU2WATjtvtaDLFc7Wuqv/6rtTrEGzFyDlBYWG1hsLc9vlst3+/yBrDPPAT8HBQphPyf2c2J8WitTX6MH+b0FU+1+9/xqn5+7p6LXhJNyLR4rOduV3gG6JwI+l8tZ/e1yjsQxLdI45txiYpqlBaEW6TaRwdWirGYeHo2yEKOdMfKuXm1Wviy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jl6wIUkKPSOnaoMzBVLqu4Rahs7ox2MoSqZPuZLdEMn04QEddUXlLiAeMlUU1bK+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,
Expand Down Expand Up @@ -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))
{
Expand Down
14 changes: 12 additions & 2 deletions XIVComboExpanded/Interface/OneTimeModal.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using Dalamud.Interface;
using Dalamud.Interface.Colors;
using Dalamud.Interface.Style;
using Dalamud.Interface.Windowing;
using ImGuiNET;
using XIVComboExpandedPlugin;
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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))
Expand Down
6 changes: 6 additions & 0 deletions XIVComboExpanded/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,12 @@ static PluginConfiguration()
[JsonProperty("Secret")]
public bool EnableSecretCombos { get; set; } = false;

/// <summary>
/// Gets or sets a value indicating whether to allow and display secret combos.
/// </summary>
[JsonProperty("Theme")]
public bool EnableTheme { get; set; } = true;

/// <summary>
/// Gets or sets a value indicating whether to allow and display secret combos.
/// </summary>
Expand Down

0 comments on commit 695ca12

Please sign in to comment.