Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions BossMod/Autorotation/AutorotationConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,12 @@ public sealed class AutorotationConfig : ConfigNode
{
[PropertyDisplay("Show in-game UI")]
public bool ShowUI = false;
[PropertyDisplay("Disable Timers inside Autorotation window")]
public bool DisableTimers = false;
[PropertyDisplay("Show explicitly which GCD & OGCD is being queued next as well as last action used inside Autorotation window")]
public bool EnableGCDs = false;
[PropertyDisplay("Show if ability is a GCD or an OGCD when queuing actions inside Autorotation window")]
public bool ShowGCDs = false;

public enum DtrStatus
{
Expand Down
118 changes: 109 additions & 9 deletions BossMod/Autorotation/UIRotationWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,12 +51,17 @@ public override void Draw()
if (player == null)
return;

#region Presets
DrawRotationSelector(_mgr);
ImGui.Spacing();
#endregion

#region Cooldown Plans
var activeModule = _mgr.Bossmods.ActiveModule;
if (activeModule != null)
{
ImGui.TextUnformatted($"CD Plan:");
ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted($"Current CD Plan:");

if (activeModule.Info?.PlanLevel > 0)
{
Expand Down Expand Up @@ -89,8 +94,11 @@ public override void Draw()
}
}
}
ImGui.Spacing();
#endregion

ImGui.TextUnformatted("Modules: ");
#region Modules
ImGui.TextUnformatted("Modules Active:");

var dups = _mgr.DuplicateModules.ToList();
if (dups.Count > 0)
Expand Down Expand Up @@ -124,27 +132,119 @@ public override void Draw()
}
}
}

ImGui.SameLine();
ImGui.TextUnformatted(_mgr.ToString());
ImGui.Spacing();
ImGui.Separator();
ImGui.Spacing();
#endregion

#region Timers
if (!_config.DisableTimers)
{
ImGui.TextUnformatted($"GCD={_mgr.WorldState.Client.Cooldowns[ActionDefinitions.GCDGroup].Remaining:f3}, AnimLock={_amex.EffectiveAnimationLock:f3}+{_amex.AnimationLockDelayEstimate:f3}, Combo={_amex.ComboTimeLeft:f3}, RBIn={_mgr.Bossmods.RaidCooldowns.NextDamageBuffIn():f3}");
ImGui.Spacing();
ImGui.Separator();
ImGui.Spacing();
}
#endregion

if (_config.EnableGCDs)
{
#region Next GCD
var isGCD = _mgr.Hints.ActionsToExecute.Entries.FirstOrDefault(a => a.Action.IsGCD);
if (isGCD.Action)
{
ImGui.TextUnformatted("Next GCD: ");
ImGui.SameLine(0f, 0f);
ImGui.TextColored(new Vector4(1.0f, 0.7f, 0.2f, 1f), isGCD.Action.Name());
ImGui.SameLine(0f, 0f);
ImGui.TextUnformatted($" [{isGCD.Action.ID}] ({isGCD.Priority:F2}) @ ({isGCD.Target?.Name ?? "<none>"})");
}
else
{
ImGui.TextUnformatted("Next GCD: <none>");
}
#endregion

#region Next OGCD
var isOGCD = _mgr.Hints.ActionsToExecute.Entries.FirstOrDefault(a => !a.Action.IsGCD);
if (isOGCD.Action)
{
ImGui.TextUnformatted("Next OGCD: ");
ImGui.SameLine(0f, 0f);
ImGui.TextColored(new Vector4(0.2f, 0.9f, 0.9f, 1f), isOGCD.Action.Name());
ImGui.SameLine(0f, 0f);
ImGui.TextUnformatted($" [{isOGCD.Action.ID}] ({isOGCD.Priority:F2}) @ ({isOGCD.Target?.Name ?? "<none>"})");
}
else
{
ImGui.TextUnformatted("Next OGCD: <none>");
}
#endregion

#region Last Action Used
var lastCast = _mgr.LastCast;
var action = lastCast.Data!.Action;
if (action)
{
ImGui.TextUnformatted("Last Action Used: ");
ImGui.SameLine(0f, 0f);
ImGui.TextColored(new Vector4(0.6f, 0.6f, 1.0f, 1f), action.Name());
ImGui.SameLine(0f, 0f);
ImGui.TextUnformatted($" [{action.ID}]");
}
else
{
ImGui.TextUnformatted("Last Action Used: <none>");
}
#endregion

ImGui.TextUnformatted($"GCD={_mgr.WorldState.Client.Cooldowns[ActionDefinitions.GCDGroup].Remaining:f3}, AnimLock={_amex.EffectiveAnimationLock:f3}+{_amex.AnimationLockDelayEstimate:f3}, Combo={_amex.ComboTimeLeft:f3}, RBIn={_mgr.Bossmods.RaidCooldowns.NextDamageBuffIn():f3}");
foreach (var a in _mgr.Hints.ActionsToExecute.Entries)
ImGui.Spacing();
ImGui.Separator();
ImGui.Spacing();
}

#region Action Queue
ImGui.TextUnformatted("Actions in Queue:");

var queue = _mgr.Hints.ActionsToExecute.Entries;
if (queue == null || queue.Count == 0)
{
ImGui.TextUnformatted("> <none>");
}
else
{
ImGui.TextUnformatted($"> {a.Action} ({a.Priority:f2}) @ ({a.Target?.Name ?? "<none>"})");
foreach (var e in queue)
{
if (_config.ShowGCDs)
{
ImGui.TextUnformatted("> [");
ImGui.SameLine(0f, 0f);
ImGui.TextUnformatted(e.Action.CDType);
ImGui.SameLine(0f, 0f);
ImGui.TextUnformatted("] ");
ImGui.SameLine(0f, 0f);
}
if (!_config.ShowGCDs)
ImGui.TextUnformatted("> ");
ImGui.SameLine(0f, 0f);
ImGui.TextColored(new Vector4(1.0f, 0.843f, 0.0f, 1.0f), e.Action.Name());
ImGui.SameLine(0f, 0f);
ImGui.TextUnformatted($" [{e.Action.ID}] ({e.Priority:F2}) @ ({e.Target?.Name ?? "<none>"})");
}
}
#endregion
}

public override void OnClose() => SetVisible(false);

public static bool DrawRotationSelector(RotationModuleManager mgr)
{
var modified = false;
if (mgr.Player == null)
return modified;

ImGui.AlignTextToFramePadding();
ImGui.TextUnformatted("Presets:");

ImGui.SameLine();

using (ImRaii.PushColor(ImGuiCol.Button, 0xff000080, mgr.IsForceDisabled))
Expand Down
5 changes: 5 additions & 0 deletions BossMod/Data/ActionID.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ public ActionID(ActionType type, uint id) : this(((uint)type << 24) | id) { }
_ => 0
};

public readonly bool CDGroupCheck() => Service.LuminaRow<Lumina.Excel.Sheets.Action>(ID)?.CooldownGroup == ActionDefinitions.GCDGroup + 1;
public readonly bool AdditionalCDGroupCheck() => Service.LuminaRow<Lumina.Excel.Sheets.Action>(ID)?.AdditionalCooldownGroup == ActionDefinitions.GCDGroup + 1;
public readonly bool IsGCD => CDGroupCheck() || AdditionalCDGroupCheck();
public readonly string? CDType => IsGCD ? "GCD" : "OGCD";

public readonly float CastTime() => Type switch
{
ActionType.Spell => (Service.LuminaRow<Lumina.Excel.Sheets.Action>(ID)?.Cast100ms ?? 0) * 0.1f,
Expand Down