Merge pull request #57 from PYRiTEmonark/main
Added new option to automatically collapse the Synth Helper window
This commit is contained in:
@@ -203,6 +203,7 @@ public partial class Configuration
|
|||||||
public ProgressBarType ProgressType { get; set; } = ProgressBarType.Colorful;
|
public ProgressBarType ProgressType { get; set; } = ProgressBarType.Colorful;
|
||||||
|
|
||||||
public bool PinSynthHelperToWindow { get; set; } = true;
|
public bool PinSynthHelperToWindow { get; set; } = true;
|
||||||
|
public bool CollapseSynthHelper { get; set; }
|
||||||
public bool PinRecipeNoteToWindow { get; set; } = true;
|
public bool PinRecipeNoteToWindow { get; set; } = true;
|
||||||
|
|
||||||
public MacroCopyConfiguration MacroCopy { get; set; } = new();
|
public MacroCopyConfiguration MacroCopy { get; set; } = new();
|
||||||
|
|||||||
@@ -920,6 +920,15 @@ public sealed class Settings : Window, IDisposable
|
|||||||
ref isDirty
|
ref isDirty
|
||||||
);
|
);
|
||||||
|
|
||||||
|
DrawOption(
|
||||||
|
"Always Collapse Helper Window",
|
||||||
|
"Enabling this will cause the Helper Window to be collapsed whenever you start " +
|
||||||
|
"a new craft, preventing the solver from running automatically.",
|
||||||
|
Config.CollapseSynthHelper,
|
||||||
|
v => Config.CollapseSynthHelper = v,
|
||||||
|
ref isDirty
|
||||||
|
);
|
||||||
|
|
||||||
DrawOption(
|
DrawOption(
|
||||||
"Automatically Suggest Macro",
|
"Automatically Suggest Macro",
|
||||||
"(Can cause frame drops!) When navigating to a new recipe or changing your gear " +
|
"(Can cause frame drops!) When navigating to a new recipe or changing your gear " +
|
||||||
|
|||||||
@@ -112,6 +112,11 @@ public sealed unsafe class SynthHelper : Window, IDisposable
|
|||||||
private bool WasOpen { get; set; }
|
private bool WasOpen { get; set; }
|
||||||
private bool WasCollapsed { 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 ShouldCalculate => !IsCollapsed && ShouldOpen;
|
||||||
private bool WasCalculatable { get; set; }
|
private bool WasCalculatable { get; set; }
|
||||||
|
|
||||||
@@ -203,6 +208,8 @@ public sealed unsafe class SynthHelper : Window, IDisposable
|
|||||||
{
|
{
|
||||||
OnStartCrafting(recipeId);
|
OnStartCrafting(recipeId);
|
||||||
OnStateUpdated();
|
OnStateUpdated();
|
||||||
|
|
||||||
|
if (Service.Configuration.CollapseSynthHelper) ShouldCollapse = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (IsRecalculateQueued)
|
if (IsRecalculateQueued)
|
||||||
@@ -266,6 +273,13 @@ public sealed unsafe class SynthHelper : Window, IDisposable
|
|||||||
|
|
||||||
public override void Draw()
|
public override void Draw()
|
||||||
{
|
{
|
||||||
|
|
||||||
|
if (ShouldCollapse)
|
||||||
|
{
|
||||||
|
ImGui.SetWindowCollapsed(true);
|
||||||
|
ShouldCollapse = false;
|
||||||
|
}
|
||||||
|
|
||||||
IsCollapsed = false;
|
IsCollapsed = false;
|
||||||
|
|
||||||
DrawMacro();
|
DrawMacro();
|
||||||
@@ -285,6 +299,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
|
|||||||
|
|
||||||
private SimulationState? hoveredState;
|
private SimulationState? hoveredState;
|
||||||
private SimulationState DisplayedState => hoveredState ?? (Service.Configuration.SynthHelperDisplayOnlyFirstStep ? Macro.FirstState : Macro.State);
|
private SimulationState DisplayedState => hoveredState ?? (Service.Configuration.SynthHelperDisplayOnlyFirstStep ? Macro.FirstState : Macro.State);
|
||||||
|
|
||||||
private void DrawMacro()
|
private void DrawMacro()
|
||||||
{
|
{
|
||||||
var spacing = ImGui.GetStyle().ItemSpacing.X;
|
var spacing = ImGui.GetStyle().ItemSpacing.X;
|
||||||
|
|||||||
Reference in New Issue
Block a user