From a5ce0e1aa81e127c864921df3228f7a144a8b7ea Mon Sep 17 00:00:00 2001 From: Liza Carvelli Date: Tue, 20 Feb 2024 20:10:49 +0100 Subject: [PATCH] Allow turn in window to be minimized if no turn-in is running --- Deliveroo/Deliveroo.csproj | 2 +- Deliveroo/Windows/TurnInWindow.cs | 17 +++++++++++++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Deliveroo/Deliveroo.csproj b/Deliveroo/Deliveroo.csproj index a741f4d..a46f067 100644 --- a/Deliveroo/Deliveroo.csproj +++ b/Deliveroo/Deliveroo.csproj @@ -1,7 +1,7 @@ net7.0-windows - 3.1 + 3.2 11.0 enable true diff --git a/Deliveroo/Windows/TurnInWindow.cs b/Deliveroo/Windows/TurnInWindow.cs index 8b2c781..ab16cfc 100644 --- a/Deliveroo/Windows/TurnInWindow.cs +++ b/Deliveroo/Windows/TurnInWindow.cs @@ -50,6 +50,8 @@ internal sealed class TurnInWindow : LImGui.LWindow private readonly GcRewardsCache _gcRewardsCache; private readonly IconCache _iconCache; + private bool _state; + public TurnInWindow(DeliverooPlugin plugin, DalamudPluginInterface pluginInterface, Configuration configuration, ICondition condition, IClientState clientState, GcRewardsCache gcRewardsCache, ConfigWindow configWindow, IconCache iconCache) @@ -72,7 +74,7 @@ internal sealed class TurnInWindow : LImGui.LWindow MaximumSize = new Vector2(500, 999), }; - Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse; + State = false; ShowCloseButton = false; AllowClickthrough = false; @@ -91,7 +93,18 @@ internal sealed class TurnInWindow : LImGui.LWindow }); } - public bool State { get; set; } + public bool State + { + get => _state; + set + { + _state = value; + if (value) + Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse; + else + Flags = ImGuiWindowFlags.AlwaysAutoResize; + } + } public decimal Multiplier { private get; set; } public string Error { private get; set; } = string.Empty;