Add /craftretry

This commit is contained in:
Asriel Camora
2024-11-28 14:13:41 -08:00
parent 8451572a79
commit e86ca2aed4
2 changed files with 11 additions and 1 deletions
+4
View File
@@ -118,6 +118,10 @@ public sealed class Plugin : IDalamudPlugin
public void ExecuteSuggestedSynthHelperAction() => public void ExecuteSuggestedSynthHelperAction() =>
SynthHelperWindow.ExecuteNextAction(); SynthHelperWindow.ExecuteNextAction();
[Command(name: "/craftretry", description: "Clicks \"Retry\" in the synthesis helper. Can also be run inside a macro. This command is useful for controller players.")]
public void ExecuteRetrySynthHelper() =>
SynthHelperWindow.AttemptRetry();
[Command(name: "/craftimizer", description: "Open the settings window.")] [Command(name: "/craftimizer", description: "Open the settings window.")]
private void OpenSettingsWindowForced() => private void OpenSettingsWindowForced() =>
OpenSettingsWindow(true); OpenSettingsWindow(true);
+7 -1
View File
@@ -459,7 +459,7 @@ public sealed unsafe class SynthHelper : Window, IDisposable
else else
{ {
if (ImGui.Button("Retry", new(-1, 0))) if (ImGui.Button("Retry", new(-1, 0)))
CalculateBestMacro(); AttemptRetry();
if (ImGui.IsItemHovered()) if (ImGui.IsItemHovered())
ImGuiUtils.TooltipWrapped("Suggest a way to finish the crafting recipe. " + ImGuiUtils.TooltipWrapped("Suggest a way to finish the crafting recipe. " +
"Results aren't perfect, and levels of success " + "Results aren't perfect, and levels of success " +
@@ -482,6 +482,12 @@ public sealed unsafe class SynthHelper : Window, IDisposable
return false; return false;
} }
public void AttemptRetry()
{
if (!SolverRunning)
CalculateBestMacro();
}
private void OnStartCrafting(ushort recipeId) private void OnStartCrafting(ushort recipeId)
{ {
var shouldUpdateInput = false; var shouldUpdateInput = false;