diff --git a/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs b/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs index 7be6b1ac9..d462d195d 100644 --- a/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs +++ b/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs @@ -1,5 +1,6 @@ using Lumina.Excel.GeneratedSheets; using RotationSolver.Data; +using RotationSolver.Helpers; using RotationSolver.Localization; using RotationSolver.SigReplacers; using System; @@ -32,7 +33,7 @@ private static void UpdateToast() }); } - private static void DoStateCommandType(StateCommandType stateType) => DoOneCommandType(stateType, EnumTranslations.ToSayout, role => + private static unsafe void DoStateCommandType(StateCommandType stateType) => DoOneCommandType(stateType, EnumTranslations.ToSayout, role => { if (StateType == StateCommandType.Smart && stateType == StateCommandType.Smart) @@ -43,10 +44,20 @@ private static void DoStateCommandType(StateCommandType stateType) => DoOneComma StateType = stateType; + UpdateStateNamePlate(); + _stateString = stateType.ToStateString(role); UpdateToast(); }); + public static unsafe void UpdateStateNamePlate() + { + Service.ClientState.LocalPlayer.GetAddress()->NamePlateIconId = + !Service.Configuration.ShowStateOnNamePlate ? 0u : + StateType == StateCommandType.Cancel + ? 71214u : 71204u; + } + private static void DoSpecialCommandType(SpecialCommandType specialType, bool sayout = true) => DoOneCommandType(specialType, sayout ? EnumTranslations.ToSayout : (s, r) => string.Empty, role => { _specialType = specialType; diff --git a/RotationSolver/Configuration/PluginConfiguration.cs b/RotationSolver/Configuration/PluginConfiguration.cs index f4ea2ed5c..a8f67e683 100644 --- a/RotationSolver/Configuration/PluginConfiguration.cs +++ b/RotationSolver/Configuration/PluginConfiguration.cs @@ -127,6 +127,7 @@ public class PluginConfiguration : IPluginConfiguration public bool UseStopCasting = false; public bool EsunaAll = false; public bool OnlyAttackInView = false; + public bool ShowStateOnNamePlate = true; public string PositionalErrorText = string.Empty; public float CountDownAhead = 0.6f; diff --git a/RotationSolver/Localization/Localization.json b/RotationSolver/Localization/Localization.json index a67a1d49e..e671ce288 100644 --- a/RotationSolver/Localization/Localization.json +++ b/RotationSolver/Localization/Localization.json @@ -50,8 +50,9 @@ "Configwindow_Param_UseOverlayWindow": "Display top overlay", "Configwindow_Param_UseOverlayWindowDesc": "This window is currently used to cue the body position in advance.", "Configwindow_Param_Basic": "Basic", - "Configwindow_Param_WeaponFaster": "Set the time advance of use actions", + "Configwindow_Param_WeaponAhead": "Set the time advance of use actions", "Configwindow_Param_WeaponInterval": "Set the interval between abilities using", + "Configwindow_Param_CountDownAhead": "Set the time advance of use casting actions on counting down.", "Configwindow_Param_SpecialDuration": "Set the duration of special windows set by commands", "Configwindow_Param_AddDotGCDCount": "Set GCD advance of DOT refresh", "Configwindow_Param_AutoOffBetweenArea": "Turn off when player is between area.", @@ -91,7 +92,8 @@ "Configwindow_Param_SayOutStateChanged": "Saying the state changes out", "Configwindow_Param_ShowInfoOnDtr": "Display plugin state on dtrbar", "Configwindow_Param_ShowWorkTaskFPS": "Display Task FPS on dtrbar", - "Configwindow_Param_ShowInfoOnToast": "Display plugin state changed on toast", + "Configwindow_Param_ShowInfoOnToast": "Display plugin state on toast", + "Configwindow_Param_ShowStateOnNamePlate": "Display plugin state on player's name plate.", "Configwindow_Param_Action": "Action", "Configwindow_Param_UseAOEWhenManual": "Use AOE actions in manual mode", "Configwindow_Param_AutoBurst": "Automatic burst", diff --git a/RotationSolver/Localization/Strings_Major.cs b/RotationSolver/Localization/Strings_Major.cs index a45e395b9..ed2efdf8a 100644 --- a/RotationSolver/Localization/Strings_Major.cs +++ b/RotationSolver/Localization/Strings_Major.cs @@ -146,7 +146,8 @@ internal partial class Strings public string Configwindow_Param_ShowWorkTaskFPS { get; set; } = "Display Task FPS on dtrbar"; - public string Configwindow_Param_ShowInfoOnToast { get; set; } = "Display plugin state changed on toast"; + public string Configwindow_Param_ShowInfoOnToast { get; set; } = "Display plugin state on toast"; + public string Configwindow_Param_ShowStateOnNamePlate { get; set; } = "Display plugin state on player's name plate."; public string Configwindow_Param_Action { get; set; } = "Action"; public string Configwindow_Param_UseAOEWhenManual { get; set; } = "Use AOE actions in manual mode"; public string Configwindow_Param_AutoBurst { get; set; } = "Automatic burst"; diff --git a/RotationSolver/Windows/RotationConfigWindow_Param.cs b/RotationSolver/Windows/RotationConfigWindow_Param.cs index 5e26b4d58..1bc0853c5 100644 --- a/RotationSolver/Windows/RotationConfigWindow_Param.cs +++ b/RotationSolver/Windows/RotationConfigWindow_Param.cs @@ -211,6 +211,9 @@ private void DrawParamDisplay() ref Service.Configuration.ShowWorkTaskFPS); } + DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_ShowStateOnNamePlate, + ref Service.Configuration.ShowStateOnNamePlate, otherThing: RSCommands.UpdateStateNamePlate); + ImGui.Spacing(); DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_CastingDisplay, @@ -423,11 +426,12 @@ private void DrawParamHostile() } } - private static void DrawCheckBox(string name, ref bool value, string description = "") + private static void DrawCheckBox(string name, ref bool value, string description = "", Action otherThing = null) { if (ImGui.Checkbox(name, ref value)) { Service.Configuration.Save(); + otherThing?.Invoke(); } if (!string.IsNullOrEmpty(description) && ImGui.IsItemHovered()) {