Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: add click button to control the rotation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 2, 2023
1 parent faef1be commit bb73310
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Data/NextAct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

namespace RotationSolver.Basic.Data;

public record NextAct(IBaseAction act, DateTime deadTime);
public record NextAct(IAction act, DateTime deadTime);
4 changes: 2 additions & 2 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public static bool SetAutoStatus(AutoStatus status, bool keep)

private static List<NextAct> NextActs = new List<NextAct>();
public static IBaseAction TimeLineAction { internal get; set; }
internal static IBaseAction CommandNextAction
internal static IAction CommandNextAction
{
get
{
Expand All @@ -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));
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Commands/RSCommands_OtherCommand.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 5 additions & 0 deletions RotationSolver/UI/ControlWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bb73310

Please sign in to comment.