Added new option to automatically collapse the Synth Helper window

This commit is contained in:
Iris Scoffin
2025-09-20 13:25:49 +01:00
parent 3359748d13
commit 3b176e68a8
3 changed files with 25 additions and 0 deletions
+15
View File
@@ -112,6 +112,11 @@ public sealed unsafe class SynthHelper : Window, IDisposable
private bool WasOpen { get; set; }
private bool WasCollapsed { get; set; }
/// <summary>
/// Used to automatically collapse the helper window when a new craft starts.
/// </summary>
private bool ShouldCollapse { get; set; }
private bool ShouldCalculate => !IsCollapsed && ShouldOpen;
private bool WasCalculatable { get; set; }
@@ -203,6 +208,8 @@ public sealed unsafe class SynthHelper : Window, IDisposable
{
OnStartCrafting(recipeId);
OnStateUpdated();
if (Service.Configuration.CollapseSynthHelper) ShouldCollapse = true;
}
if (IsRecalculateQueued)
@@ -266,6 +273,13 @@ public sealed unsafe class SynthHelper : Window, IDisposable
public override void Draw()
{
if (ShouldCollapse)
{
ImGui.SetWindowCollapsed(true);
ShouldCollapse = false;
}
IsCollapsed = false;
DrawMacro();
@@ -285,6 +299,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
private SimulationState? hoveredState;
private SimulationState DisplayedState => hoveredState ?? (Service.Configuration.SynthHelperDisplayOnlyFirstStep ? Macro.FirstState : Macro.State);
private void DrawMacro()
{
var spacing = ImGui.GetStyle().ItemSpacing.X;