Extra checks for SolverRunning in macro editor
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"Name": "Craftimizer",
|
"Name": "Craftimizer",
|
||||||
"Punchline": "Simulate crafts, create computer-assisted macros, and get mid-craft suggestions from the comfort of your own game!",
|
"Punchline": "Simulate crafts, create computer-assisted macros, and get mid-craft suggestions from the comfort of your own game!",
|
||||||
"Description": "Allows you to generate macros and simulate all sorts of crafts without having to open another app. Open your crafting log to get started!",
|
"Description": "Allows you to generate macros and simulate all sorts of crafts without having to open another app. Open your crafting log to get started!",
|
||||||
"RepoUrl": "https://github.com/WorkingRobot/craftimizer",
|
"RepoUrl": "https://github.com/WorkingRobot/Craftimizer",
|
||||||
"InternalName": "Craftimizer",
|
"InternalName": "Craftimizer",
|
||||||
"ApplicableVersion": "any",
|
"ApplicableVersion": "any",
|
||||||
"Tags": [
|
"Tags": [
|
||||||
@@ -21,10 +21,10 @@
|
|||||||
"CategoryTags": [
|
"CategoryTags": [
|
||||||
"Jobs"
|
"Jobs"
|
||||||
],
|
],
|
||||||
"IconUrl": "https://git.camora.dev/asriel/craftimizer/raw/branch/main/icon.png",
|
"IconUrl": "https://git.camora.dev/asriel/Craftimizer/raw/branch/main/icon.png",
|
||||||
"ImageUrls": [
|
"ImageUrls": [
|
||||||
"https://git.camora.dev/asriel/craftimizer/raw/branch/main/Images/RecipeNote.png",
|
"https://git.camora.dev/asriel/Craftimizer/raw/branch/main/Images/RecipeNote.png",
|
||||||
"https://git.camora.dev/asriel/craftimizer/raw/branch/main/Images/SynthHelper.png",
|
"https://git.camora.dev/asriel/Craftimizer/raw/branch/main/Images/SynthHelper.png",
|
||||||
"https://git.camora.dev/asriel/craftimizer/raw/branch/main/Images/MacroEditor.png",
|
"https://git.camora.dev/asriel/Craftimizer/raw/branch/main/Images/MacroEditor.png",
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -953,7 +953,7 @@ public sealed class MacroEditor : Window, IDisposable
|
|||||||
{
|
{
|
||||||
var actionBase = actions[i].Base();
|
var actionBase = actions[i].Base();
|
||||||
var canUse = actionBase.CanUse(sim);
|
var canUse = actionBase.CanUse(sim);
|
||||||
if (ImGui.ImageButton(actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize), default, Vector2.One, 0, default, !canUse ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One))
|
if (ImGui.ImageButton(actions[i].GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize), default, Vector2.One, 0, default, !canUse ? new(1, 1, 1, ImGui.GetStyle().DisabledAlpha) : Vector4.One) && !SolverRunning)
|
||||||
AddStep(actions[i]);
|
AddStep(actions[i]);
|
||||||
if (!canUse &&
|
if (!canUse &&
|
||||||
(CharacterStats.Level < actionBase.Level ||
|
(CharacterStats.Level < actionBase.Level ||
|
||||||
@@ -1223,23 +1223,26 @@ public sealed class MacroEditor : Window, IDisposable
|
|||||||
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
if (ImGui.IsItemHovered(ImGuiHoveredFlags.AllowWhenDisabled))
|
||||||
ImGuiUtils.Tooltip($"{action.GetName(RecipeData!.ClassJob)}\n{actionBase.GetTooltip(CreateSim(lastState), true)}");
|
ImGuiUtils.Tooltip($"{action.GetName(RecipeData!.ClassJob)}\n{actionBase.GetTooltip(CreateSim(lastState), true)}");
|
||||||
|
|
||||||
using var _padding = ImRaii.PushStyle(ImGuiStyleVar.WindowPadding, Vector2.Zero);
|
if (!SolverRunning)
|
||||||
using (var _source = ImRaii.DragDropSource())
|
|
||||||
{
|
{
|
||||||
if (_source)
|
using var _padding = ImRaii.PushStyle(ImGuiStyleVar.WindowPadding, Vector2.Zero);
|
||||||
|
using (var _source = ImRaii.DragDropSource())
|
||||||
{
|
{
|
||||||
ImGuiExtras.SetDragDropPayload("macroAction", i);
|
if (_source)
|
||||||
ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize));
|
{
|
||||||
|
ImGuiExtras.SetDragDropPayload("macroAction", i);
|
||||||
|
ImGui.ImageButton(action.GetIcon(RecipeData!.ClassJob).ImGuiHandle, new(imageSize));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
using (var _target = ImRaii.DragDropTarget())
|
||||||
using (var _target = ImRaii.DragDropTarget())
|
|
||||||
{
|
|
||||||
if (_target)
|
|
||||||
{
|
{
|
||||||
if (ImGuiExtras.AcceptDragDropPayload("macroAction", out int j))
|
if (_target)
|
||||||
Macro.Move(j, i);
|
{
|
||||||
else if (ImGuiExtras.AcceptDragDropPayload("macroActionInsert", out ActionType newAction))
|
if (ImGuiExtras.AcceptDragDropPayload("macroAction", out int j))
|
||||||
Macro.Insert(i, newAction);
|
Macro.Move(j, i);
|
||||||
|
else if (ImGuiExtras.AcceptDragDropPayload("macroActionInsert", out ActionType newAction))
|
||||||
|
Macro.Insert(i, newAction);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
lastState = state;
|
lastState = state;
|
||||||
|
|||||||
Reference in New Issue
Block a user