diff --git a/RotationSolver.Basic/Data/NextAct.cs b/RotationSolver.Basic/Data/NextAct.cs index 58f2ed87b..382d65f37 100644 --- a/RotationSolver.Basic/Data/NextAct.cs +++ b/RotationSolver.Basic/Data/NextAct.cs @@ -2,4 +2,4 @@ namespace RotationSolver.Basic.Data; -public record NextAct(IBaseAction act, DateTime deadTime); +public record NextAct(IAction act, DateTime deadTime); diff --git a/RotationSolver.Basic/DataCenter.cs b/RotationSolver.Basic/DataCenter.cs index 1e473aec4..a40a4f179 100644 --- a/RotationSolver.Basic/DataCenter.cs +++ b/RotationSolver.Basic/DataCenter.cs @@ -32,7 +32,7 @@ public static bool SetAutoStatus(AutoStatus status, bool keep) private static List NextActs = new List(); public static IBaseAction TimeLineAction { internal get; set; } - internal static IBaseAction CommandNextAction + internal static IAction CommandNextAction { get { @@ -49,7 +49,7 @@ internal static IBaseAction CommandNextAction } } - public static void AddOneTimelineAction(IBaseAction act, double time) + public static void AddCommandAction(IAction act, double time) { var index = NextActs.FindIndex(i => i.act.ID == act.ID); var newItem = new NextAct(act, DateTime.Now.AddSeconds(time)); diff --git a/RotationSolver/Commands/RSCommands_OtherCommand.cs b/RotationSolver/Commands/RSCommands_OtherCommand.cs index 178a72a20..ecb93c769 100644 --- a/RotationSolver/Commands/RSCommands_OtherCommand.cs +++ b/RotationSolver/Commands/RSCommands_OtherCommand.cs @@ -80,7 +80,7 @@ private static void DoActionCommand(string str) if (actName == act.Name) { - DataCenter.AddOneTimelineAction(act, time); + DataCenter.AddCommandAction(act, time); Service.ToastGui.ShowQuest(string.Format(LocalizationManager.RightLang.Commands_InsertAction, time), new Dalamud.Game.Gui.Toast.QuestToastOptions() diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs index 9cd833b8a..debebd88f 100644 --- a/RotationSolver/UI/ControlWindow.cs +++ b/RotationSolver/UI/ControlWindow.cs @@ -3,6 +3,7 @@ using Dalamud.Interface.Windowing; using ImGuiNET; using ImGuiScene; +using Lumina.Excel.GeneratedSheets; using RotationSolver.Basic; using RotationSolver.Basic.Actions; using RotationSolver.Basic.Data; @@ -404,6 +405,10 @@ static void DrawIAction(nint handle, string id, float width, StateCommandType co internal static void DrawIAction(IAction action, float width, float percent) { DrawIAction(GetTexture(action).ImGuiHandle, width, action == null ? -1 : percent); + if(ImGui.IsItemHovered() && ImGui.IsMouseClicked(ImGuiMouseButton.Left)) + { + DataCenter.AddCommandAction(action, 5); + } } static void DrawIAction(nint handle, float width, float percent)