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

Commit

Permalink
fix: add a feature of command desc highlight when in that command.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 22, 2023
1 parent b7f604b commit 45ecef0
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
47 changes: 46 additions & 1 deletion RotationSolver/Attributes/RotationDescAttribute.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
using ImGuiNET;
using Dalamud.Interface.Colors;
using ImGuiNET;
using Lumina.Excel.GeneratedSheets;
using RotationSolver.Actions;
using RotationSolver.Actions.BaseAction;
using RotationSolver.Commands;
using RotationSolver.Data;
using RotationSolver.Helpers;
using RotationSolver.Localization;
Expand Down Expand Up @@ -41,6 +43,45 @@ internal class RotationDescAttribute : Attribute
_ => 62144,
};

private bool IsOnCommand
{
get
{
var command = RSCommands.SpecialType;
switch(Type)
{
case DescType.BurstActions:
return command == SpecialCommandType.Burst;

case DescType.HealAreaAbility:
case DescType.HealAreaGCD:
return command == SpecialCommandType.HealArea;

case DescType.HealSingleAbility:
case DescType.HealSingleGCD:
return command == SpecialCommandType.HealSingle;

case DescType.DefenseAreaGCD:
case DescType.DefenceAreaAbility:
return command == SpecialCommandType.DefenseArea;

case DescType.DefenseSingleGCD:
case DescType.DefenceSingleAbility:
return command == SpecialCommandType.DefenseSingle;

case DescType.MoveForwardGCD:
case DescType.MoveForwardAbility:
return command == SpecialCommandType.MoveForward;

case DescType.MoveBackAbility:
return command == SpecialCommandType.MoveBack;

default:
return false;
}
}
}

public RotationDescAttribute(DescType descType)
{
Type = descType;
Expand Down Expand Up @@ -77,7 +118,11 @@ public bool Display(ICustomRotation rotation)
ImGui.Columns(2, this.GetHashCode().ToString(), false);
ImGui.SetColumnWidth(0, 170);
ImGui.Image(IconSet.GetTexture(IconID).ImGuiHandle, PIC_SIZE);

var isOnCommand = IsOnCommand;
if (isOnCommand) ImGui.PushStyleColor(ImGuiCol.Text, ImGuiColors.DalamudYellow);
ImGui.Text(" " + Type.ToName());
if (isOnCommand) ImGui.PopStyleColor();

ImGui.NextColumn();

Expand Down
2 changes: 0 additions & 2 deletions RotationSolver/Windows/RotationConfigWindow_Help.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,6 @@ private void DrawHelpTab()
ImGui.Separator();

SpecialCommandType.Burst.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp);
ImGui.Separator();


ImGui.PopStyleVar();
}
Expand Down

0 comments on commit 45ecef0

Please sign in to comment.