Allow turn in window to be minimized if no turn-in is running

This commit is contained in:
Liza 2024-02-20 20:10:49 +01:00
parent f0eab9cdbe
commit a5ce0e1aa8
Signed by: liza
GPG Key ID: 7199F8D727D55F67
2 changed files with 16 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<TargetFramework>net7.0-windows</TargetFramework> <TargetFramework>net7.0-windows</TargetFramework>
<Version>3.1</Version> <Version>3.2</Version>
<LangVersion>11.0</LangVersion> <LangVersion>11.0</LangVersion>
<Nullable>enable</Nullable> <Nullable>enable</Nullable>
<CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies> <CopyLocalLockFileAssemblies>true</CopyLocalLockFileAssemblies>

View File

@ -50,6 +50,8 @@ internal sealed class TurnInWindow : LImGui.LWindow
private readonly GcRewardsCache _gcRewardsCache; private readonly GcRewardsCache _gcRewardsCache;
private readonly IconCache _iconCache; private readonly IconCache _iconCache;
private bool _state;
public TurnInWindow(DeliverooPlugin plugin, DalamudPluginInterface pluginInterface, Configuration configuration, public TurnInWindow(DeliverooPlugin plugin, DalamudPluginInterface pluginInterface, Configuration configuration,
ICondition condition, IClientState clientState, GcRewardsCache gcRewardsCache, ConfigWindow configWindow, ICondition condition, IClientState clientState, GcRewardsCache gcRewardsCache, ConfigWindow configWindow,
IconCache iconCache) IconCache iconCache)
@ -72,7 +74,7 @@ internal sealed class TurnInWindow : LImGui.LWindow
MaximumSize = new Vector2(500, 999), MaximumSize = new Vector2(500, 999),
}; };
Flags = ImGuiWindowFlags.AlwaysAutoResize | ImGuiWindowFlags.NoCollapse; State = false;
ShowCloseButton = false; ShowCloseButton = false;
AllowClickthrough = 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 decimal Multiplier { private get; set; }
public string Error { private get; set; } = string.Empty; public string Error { private get; set; } = string.Empty;