diff --git a/ActionTimelineEx/Configurations/Actions/ActionSetting.cs b/ActionTimelineEx/Configurations/Actions/ActionSetting.cs index 9e63b6f..30ba04a 100644 --- a/ActionTimelineEx/Configurations/Actions/ActionSetting.cs +++ b/ActionTimelineEx/Configurations/Actions/ActionSetting.cs @@ -46,7 +46,8 @@ public uint ActionId [UI("Action ID")] public int ActionID { get => (int) ActionId; set => ActionId = (uint)value; } - internal abstract ActionSettingType Type { get; } + [JsonIgnore] + public abstract ActionSettingType Type { get; } [UI("Is this Action Highlight")] public bool Highlight { get; set; } diff --git a/ActionTimelineEx/Configurations/Actions/GCDAction.cs b/ActionTimelineEx/Configurations/Actions/GCDAction.cs index d66f8a3..691c6f7 100644 --- a/ActionTimelineEx/Configurations/Actions/GCDAction.cs +++ b/ActionTimelineEx/Configurations/Actions/GCDAction.cs @@ -10,9 +10,20 @@ namespace ActionTimelineEx.Configurations.Actions; [Description("GCD")] public class GCDAction : ActionSetting { - internal override ActionSettingType Type => ActionSettingType.Action; + public override ActionSettingType Type => ActionSettingType.Action; + + internal float Gcd => GcdOverride != 0 ? GcdOverride + : ActionManager.GetAdjustedRecastTime(FFXIVClientStructs.FFXIV.Client.Game.ActionType.Action, ActionId) / 1000f; + + [JsonIgnore] + [Range(0, 20, ConfigUnitType.Seconds)] + [UI("Recast time override")] + public float GcdOverride + { + get => Plugin.Settings.ActionRecast.TryGetValue(ActionId, out var v) ? v : 0f; + set => Plugin.Settings.ActionRecast[ActionId] = value; + } - internal float Gcd => ActionManager.GetAdjustedRecastTime(FFXIVClientStructs.FFXIV.Client.Game.ActionType.Action, ActionId) / 1000f; [UI] public List oGCDs { get; set; } = []; @@ -22,7 +33,7 @@ public float Draw(ImDrawListPtr drawList, Vector2 point, bool pass, ActionSettin if (Plugin.Settings.DrawTime) { var width = ImGui.CalcTextSize(time.GetString()).X + 5; - drawList.AddText(point, uint.MaxValue, time.GetString() + "s "); + drawList.AddText(point, uint.MaxValue, time.GetString()); point += Vector2.UnitX * width; time += TimeSpan.FromSeconds(Gcd); } diff --git a/ActionTimelineEx/Configurations/Actions/oGCDAction.cs b/ActionTimelineEx/Configurations/Actions/oGCDAction.cs index 16b8ef4..fe73fc2 100644 --- a/ActionTimelineEx/Configurations/Actions/oGCDAction.cs +++ b/ActionTimelineEx/Configurations/Actions/oGCDAction.cs @@ -21,5 +21,5 @@ public ActionSettingType ActionType } } - internal override ActionSettingType Type => ActionType; + public override ActionSettingType Type => ActionType; } diff --git a/ActionTimelineEx/Configurations/Settings.cs b/ActionTimelineEx/Configurations/Settings.cs index 4512b81..fecf402 100644 --- a/ActionTimelineEx/Configurations/Settings.cs +++ b/ActionTimelineEx/Configurations/Settings.cs @@ -52,7 +52,10 @@ public class Settings : IPluginConfiguration public bool DrawRotation { get; set; } = false; [UI("Only Show when Weapon On", Parent = nameof(DrawRotation))] - public bool OnlyShowRotationWhenWeaponOn { get; set; } = true; + public bool OnlyShowRotationWhenWeaponOn { get; set; } = true; + + [UI("Highlight in hot bar", Parent = nameof(DrawRotation))] + public bool HighlightInHotbar { get; set; } = true; [UI("Locked", Parent = nameof(DrawRotation))] public bool RotationLocked { get; set; } = false; @@ -139,6 +142,8 @@ internal RotationsSetting RotationHelper private static readonly RotationsSetting EmptyHolder = new(); + public Dictionary ActionRecast { get; set; } = []; + public int Version { get; set; } = 6; public void Save() diff --git a/ActionTimelineEx/Helpers/ActionHelper.cs b/ActionTimelineEx/Helpers/ActionHelper.cs index a0e9613..fda4501 100644 --- a/ActionTimelineEx/Helpers/ActionHelper.cs +++ b/ActionTimelineEx/Helpers/ActionHelper.cs @@ -70,6 +70,6 @@ internal static bool IsInJob(this Action i) internal static string GetString(this TimeSpan timespan) { - return $"{(int)timespan.TotalMinutes}:{timespan.Seconds:D2}.{timespan.Milliseconds.ToString("000")[0..1]}"; + return $"{(int)timespan.TotalMinutes}:{timespan.Seconds:D2}.{timespan.Milliseconds.ToString("000")[0..2]}s "; } } diff --git a/ActionTimelineEx/Helpers/RotationHelper.cs b/ActionTimelineEx/Helpers/RotationHelper.cs index 7aa70f2..c3f70fb 100644 --- a/ActionTimelineEx/Helpers/RotationHelper.cs +++ b/ActionTimelineEx/Helpers/RotationHelper.cs @@ -41,6 +41,7 @@ private static void Framework_Update(Dalamud.Plugin.Services.IFramework framewor _highLight.HotbarIDs.Clear(); if (!Plugin.Settings.DrawRotation) return; + if (!Plugin.Settings.HighlightInHotbar) return; var action = ActiveAction; if (action == null) return; diff --git a/ActionTimelineEx/Localization/Localization.json b/ActionTimelineEx/Localization/Localization.json index 94de313..907a1d4 100644 --- a/ActionTimelineEx/Localization/Localization.json +++ b/ActionTimelineEx/Localization/Localization.json @@ -165,5 +165,6 @@ "ActionTimelineEx.Configurations.Actions.GCDActionName.RecastOverride": "Recast override time", "ActionTimelineEx.Configurations.SettingsName.GcdTime": "Gcd Time", "ActionTimelineEx.Configurations.Actions.GCDActionName.GcdOverride": "Recast time override", - "ActionTimelineEx.Configurations.SettingsName.DrawTime": "Draw Time" + "ActionTimelineEx.Configurations.SettingsName.DrawTime": "Draw Time", + "ActionTimelineEx.Configurations.SettingsName.HighlightInHotbar": "Highlight in hot bar" } \ No newline at end of file