Add ability to set initialized sim state if needed

This commit is contained in:
Asriel Camora
2023-11-13 23:15:18 -08:00
parent b9c871f2b2
commit 980613970c
5 changed files with 28 additions and 24 deletions
+5 -3
View File
@@ -1018,7 +1018,7 @@ public sealed class MacroEditor : Window, IDisposable
private void DrawActionHotbars()
{
var sim = CreateSim();
var sim = CreateSim(State);
var imageSize = ImGui.GetFrameHeight() * 2;
var spacing = ImGui.GetStyle().ItemSpacing.Y;
@@ -1283,8 +1283,7 @@ public sealed class MacroEditor : Window, IDisposable
}
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
{
var sim = CreateSim();
ImGui.SetTooltip($"{action.GetName(RecipeData!.ClassJob)}\n{actionBase.GetTooltip(sim, true)}");
ImGui.SetTooltip($"{action.GetName(RecipeData!.ClassJob)}\n{actionBase.GetTooltip(CreateSim(lastState), true)}");
}
lastState = state;
}
@@ -1653,6 +1652,9 @@ public sealed class MacroEditor : Window, IDisposable
private static Sim CreateSim() =>
Service.Configuration.ConditionRandomness ? new Sim() : new SimNoRandom();
private static Sim CreateSim(in SimulationState state) =>
Service.Configuration.ConditionRandomness ? new Sim() { State = state } : new SimNoRandom() { State = state };
private void AddStep(ActionType action, int index = -1, bool isSolver = false)
{
if (index < -1 || index >= Macro.Count)