diff --git a/Craftimizer/Windows/Craft.cs b/Craftimizer/Windows/Craft.cs index 7c1cdfb..06a53ee 100644 --- a/Craftimizer/Windows/Craft.cs +++ b/Craftimizer/Windows/Craft.cs @@ -1,5 +1,6 @@ using Craftimizer.Plugin.Utils; using Craftimizer.Utils; +using Dalamud.Interface; using Dalamud.Interface.Windowing; using FFXIVClientStructs.FFXIV.Client.Game; using ImGuiNET; @@ -16,6 +17,8 @@ public sealed unsafe partial class Craft : Window, IDisposable | ImGuiWindowFlags.NoFocusOnAppearing | ImGuiWindowFlags.NoNavFocus; + public static readonly Vector2 CraftProgressBarSize = new(300, 15); + private static Configuration Config => Service.Configuration; private static Random Random { get; } = new(); @@ -40,6 +43,13 @@ public sealed unsafe partial class Craft : Window, IDisposable ImGui.SameLine(0, 0); ImGui.Dummy(default); + + ImGuiHelpers.ScaledDummy(5); + + Simulator.DrawAllProgressBars(SolverLatestState, CraftProgressBarSize); + + ImGuiHelpers.ScaledDummy(5); + ImGui.BeginDisabled(!(SolverTask?.IsCompleted ?? true)); if (ImGui.Button("Retry")) QueueSolve(GetNextState()!.Value); diff --git a/Craftimizer/Windows/SimulatorDrawerUtils.cs b/Craftimizer/Windows/SimulatorDrawerUtils.cs index f1fb669..7711253 100644 --- a/Craftimizer/Windows/SimulatorDrawerUtils.cs +++ b/Craftimizer/Windows/SimulatorDrawerUtils.cs @@ -118,24 +118,24 @@ public sealed partial class Simulator : Window, IDisposable ImGuiUtils.EndGroupPanel(); } - public static void DrawAllProgressTooltips(SimulationState state) + public static void DrawAllProgressBars(SimulationState state, Vector2 progressBarSize) { - DrawProgressBarTooltip(state.Progress, state.Input.Recipe.MaxProgress, ProgressColor); + DrawProgressBar(state.Progress, state.Input.Recipe.MaxProgress, progressBarSize, ProgressColor); if (ImGui.IsItemHovered()) ImGui.SetTooltip($"Progress: {state.Progress} / {state.Input.Recipe.MaxProgress}"); - DrawProgressBarTooltip(state.Quality, state.Input.Recipe.MaxQuality, QualityColor); + DrawProgressBar(state.Quality, state.Input.Recipe.MaxQuality, progressBarSize, QualityColor); if (ImGui.IsItemHovered()) ImGui.SetTooltip($"Quality: {state.Quality} / {state.Input.Recipe.MaxQuality}"); - DrawProgressBarTooltip(state.Durability, state.Input.Recipe.MaxDurability, DurabilityColor); + DrawProgressBar(state.Durability, state.Input.Recipe.MaxDurability, progressBarSize, DurabilityColor); if (ImGui.IsItemHovered()) ImGui.SetTooltip($"Durability: {state.Durability} / {state.Input.Recipe.MaxDurability}"); - DrawProgressBarTooltip(state.CP, state.Input.Stats.CP, CPColor); + DrawProgressBar(state.CP, state.Input.Stats.CP, progressBarSize, CPColor); if (ImGui.IsItemHovered()) ImGui.SetTooltip($"CP: {state.CP} / {state.Input.Stats.CP}"); } - private static void DrawProgressBarTooltip(int progress, int maxProgress, Vector4 color) => - DrawProgressBar(progress, maxProgress, TooltipProgressBarSize, color); + public static void DrawAllProgressTooltips(SimulationState state) => + DrawAllProgressBars(state, TooltipProgressBarSize); private static void DrawProgressBar(int progress, int maxProgress, Vector2 size, Vector4 color, string overlay = "") {