diff --git a/Resources/InputConfig.json b/Resources/InputConfig.json new file mode 100644 index 000000000..6e5d5c963 --- /dev/null +++ b/Resources/InputConfig.json @@ -0,0 +1,80 @@ +{ + "KeyState": {}, + "KeySpecial": {}, + "KeyDoAction": null, + "ButtonState": { + "Auto": { + "button": 128, + "l2": false, + "r2": true + }, + "Manual": { + "button": 16, + "l2": false, + "r2": true + }, + "Cancel": { + "button": 32, + "l2": false, + "r2": true + } + }, + "ButtonSpecial": { + "EndSpecial": { + "button": 64, + "l2": false, + "r2": true + }, + "EsunaStanceNorth": { + "button": 8, + "l2": false, + "r2": true + }, + "MoveForward": { + "button": 1, + "l2": false, + "r2": true + }, + "MoveBack": { + "button": 2, + "l2": false, + "r2": true + }, + "RaiseShirk": { + "button": 4, + "l2": false, + "r2": true + }, + "DefenseArea": { + "button": 16, + "l2": true, + "r2": false + }, + "DefenseSingle": { + "button": 128, + "l2": true, + "r2": false + }, + "HealArea": { + "button": 32, + "l2": true, + "r2": false + }, + "HealSingle": { + "button": 64, + "l2": true, + "r2": false + }, + "Burst": { + "button": 2, + "l2": true, + "r2": false + }, + "AntiKnockback": { + "button": 1, + "l2": true, + "r2": false + } + }, + "ButtonDoAction": null +} \ No newline at end of file diff --git a/RotationSolver.Basic/Actions/BaseAction_Target.cs b/RotationSolver.Basic/Actions/BaseAction_Target.cs index ee4aeed84..c745db515 100644 --- a/RotationSolver.Basic/Actions/BaseAction_Target.cs +++ b/RotationSolver.Basic/Actions/BaseAction_Target.cs @@ -259,7 +259,7 @@ private bool TargetDeath(out BattleChara target) private bool TargetHostile(float range, bool mustUse, int aoeCount, out BattleChara target) { //如果不用自动找目标,那就直接返回。 - if (DataCenter.StateType == StateCommandType.ManualTarget) + if (DataCenter.StateType == StateCommandType.Manual) { if (Service.TargetManager.Target is BattleChara b && b.IsNPCEnemy() && b.DistanceToPlayer() <= range) { @@ -335,7 +335,7 @@ private bool TargetSelf(bool mustUse, int aoeCount) } //not use when aoe. - if (DataCenter.StateType == StateCommandType.ManualTarget) + if (DataCenter.StateType == StateCommandType.Manual) { if (!Service.Config.GetValue(SettingsCommand.UseAOEWhenManual) && !mustUse) return false; } diff --git a/RotationSolver.Basic/Configuration/OtherConfiguration.cs b/RotationSolver.Basic/Configuration/OtherConfiguration.cs index 7ddb8cba2..048c2901c 100644 --- a/RotationSolver.Basic/Configuration/OtherConfiguration.cs +++ b/RotationSolver.Basic/Configuration/OtherConfiguration.cs @@ -10,8 +10,8 @@ public class InputConfiguration public KeyRecord KeyDoAction { get; set; } = null; public Dictionary ButtonState { get; set; } = new Dictionary() { - {StateCommandType.AutoTarget, new ButtonRecord( GamepadButtons.East, false, true) }, - {StateCommandType.ManualTarget, new ButtonRecord( GamepadButtons.North, false, true) }, + {StateCommandType.Auto, new ButtonRecord( GamepadButtons.East, false, true) }, + {StateCommandType.Manual, new ButtonRecord( GamepadButtons.North, false, true) }, {StateCommandType.Cancel, new ButtonRecord( GamepadButtons.South, false, true) }, }; public Dictionary ButtonSpecial { get; set; } = new Dictionary() diff --git a/RotationSolver.Basic/Data/RSCommandType.cs b/RotationSolver.Basic/Data/RSCommandType.cs index d8883ee48..54cf1c171 100644 --- a/RotationSolver.Basic/Data/RSCommandType.cs +++ b/RotationSolver.Basic/Data/RSCommandType.cs @@ -20,8 +20,8 @@ public enum SpecialCommandType : byte public enum StateCommandType : byte { Cancel, - AutoTarget, - ManualTarget, + Auto, + Manual, None, } diff --git a/RotationSolver/Commands/RSCommands_Actions.cs b/RotationSolver/Commands/RSCommands_Actions.cs index ced9e4a9d..ce4ea5538 100644 --- a/RotationSolver/Commands/RSCommands_Actions.cs +++ b/RotationSolver/Commands/RSCommands_Actions.cs @@ -146,7 +146,7 @@ internal static void UpdateRotationState() _lastCountdownTime = Service.CountDownTime; if (DataCenter.StateType == StateCommandType.Cancel) { - DoStateCommandType(StateCommandType.AutoTarget); + DoStateCommandType(StateCommandType.Auto); } } } diff --git a/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs b/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs index ed4521f9e..611633f98 100644 --- a/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs +++ b/RotationSolver/Commands/RSCommands_StateSpecialCommand.cs @@ -5,7 +5,7 @@ namespace RotationSolver.Commands public static partial class RSCommands { private static string _stateString = "Off", _specialString = string.Empty; - private static string _aoeString => "AOE " + (Service.Config.GetValue(SettingsCommand.UseAOEAction) && (DataCenter.StateType != StateCommandType.ManualTarget || Service.Config.GetValue(SettingsCommand.UseAOEWhenManual)) ? "on" : "off"); + private static string _aoeString => "AOE " + (Service.Config.GetValue(SettingsCommand.UseAOEAction) && (DataCenter.StateType != StateCommandType.Manual || Service.Config.GetValue(SettingsCommand.UseAOEWhenManual)) ? "on" : "off"); private static string _preventString => "Prevent " + (Service.Config.GetValue(SettingsCommand.PreventActions) ? "on" : "off"); @@ -24,16 +24,16 @@ private static void UpdateToast() private static unsafe void DoStateCommandType(StateCommandType stateType) => DoOneCommandType(stateType, EnumTranslations.ToSayout, role => { - if (DataCenter.StateType == StateCommandType.AutoTarget - && stateType == StateCommandType.AutoTarget) + if (DataCenter.StateType == StateCommandType.Auto + && stateType == StateCommandType.Auto) { Service.Config.TargetingIndex += 1; Service.Config.TargetingIndex %= Service.Config.TargetingTypes.Count; } if (Service.Config.ToggleManual - && DataCenter.StateType == StateCommandType.ManualTarget - && stateType == StateCommandType.ManualTarget) + && DataCenter.StateType == StateCommandType.Manual + && stateType == StateCommandType.Manual) { stateType = StateCommandType.Cancel; } diff --git a/RotationSolver/Localization/EnumTranslations.cs b/RotationSolver/Localization/EnumTranslations.cs index c56661800..911474652 100644 --- a/RotationSolver/Localization/EnumTranslations.cs +++ b/RotationSolver/Localization/EnumTranslations.cs @@ -146,8 +146,8 @@ internal static class EnumTranslations internal static string ToStateString(this StateCommandType type, JobRole role) => type switch { - StateCommandType.AutoTarget => LocalizationManager.RightLang.SpecialCommandType_Smart + RSCommands.TargetingType.ToName(), - StateCommandType.ManualTarget => LocalizationManager.RightLang.SpecialCommandType_Manual, + StateCommandType.Auto => LocalizationManager.RightLang.SpecialCommandType_Smart + RSCommands.TargetingType.ToName(), + StateCommandType.Manual => LocalizationManager.RightLang.SpecialCommandType_Manual, StateCommandType.Cancel => LocalizationManager.RightLang.SpecialCommandType_Off, _ => string.Empty, }; @@ -170,8 +170,8 @@ internal static class EnumTranslations internal static string ToHelp(this StateCommandType type) => type switch { - StateCommandType.AutoTarget => LocalizationManager.RightLang.ConfigWindow_HelpItem_AttackSmart, - StateCommandType.ManualTarget => LocalizationManager.RightLang.ConfigWindow_HelpItem_AttackManual, + StateCommandType.Auto => LocalizationManager.RightLang.ConfigWindow_HelpItem_AttackAuto, + StateCommandType.Manual => LocalizationManager.RightLang.ConfigWindow_HelpItem_AttackManual, StateCommandType.Cancel => LocalizationManager.RightLang.ConfigWindow_HelpItem_AttackCancel, _ => string.Empty, }; diff --git a/RotationSolver/Localization/Localization.json b/RotationSolver/Localization/Localization.json index ed8b011b1..a2dbc1ed1 100644 --- a/RotationSolver/Localization/Localization.json +++ b/RotationSolver/Localization/Localization.json @@ -15,8 +15,8 @@ "ConfigWindow_HelpItem": "Help", "ConfigWindow_ActionItem_Description": "Modify the usage for each action.", "ConfigWindow_HelpItem_Description": "In this window, you can see all Rotation Solver built-in commands for combat. ", - "ConfigWindow_HelpItem_AttackSmart": "Start attacking in smart mode(auto-targeting) when out of combat, otherwise switch the target according to the conditions.", - "ConfigWindow_HelpItem_AttackManual": "Start attacking in manual mode. You need to choose the target manually.", + "ConfigWindow_HelpItem_AttackAuto": "Start attacking in auto target mode when out of combat, otherwise switch the target according to the conditions.", + "ConfigWindow_HelpItem_AttackManual": "Start attacking in manual target mode. You need to choose the target manually.", "ConfigWindow_HelpItem_AttackCancel": "Stop attacking. Remember to turn it off when not in use!", "ConfigWindow_HelpItem_HealArea": "Open a window to use AoE heal.", "ConfigWindow_HelpItem_HealSingle": "Open a window to use single heal.", diff --git a/RotationSolver/Localization/Strings.cs b/RotationSolver/Localization/Strings.cs index 5c1101802..d466dda8c 100644 --- a/RotationSolver/Localization/Strings.cs +++ b/RotationSolver/Localization/Strings.cs @@ -30,11 +30,11 @@ internal partial class Strings public string ConfigWindow_HelpItem_Description { get; set; } = "In this window, you can see all Rotation Solver built-in commands for combat. "; - public string ConfigWindow_HelpItem_AttackSmart { get; set; } - = "Start attacking in smart mode(auto-targeting) when out of combat, otherwise switch the target according to the conditions."; + public string ConfigWindow_HelpItem_AttackAuto { get; set; } + = "Start attacking in auto target mode when out of combat, otherwise switch the target according to the conditions."; public string ConfigWindow_HelpItem_AttackManual { get; set; } - = "Start attacking in manual mode. You need to choose the target manually."; + = "Start attacking in manual target mode. You need to choose the target manually."; public string ConfigWindow_HelpItem_AttackCancel { get; set; } = "Stop attacking. Remember to turn it off when not in use!"; diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs index c273d2de4..89e64a472 100644 --- a/RotationSolver/UI/ControlWindow.cs +++ b/RotationSolver/UI/ControlWindow.cs @@ -19,7 +19,7 @@ internal class ControlWindow : Window public ControlWindow() : base(nameof(ControlWindow), BaseFlags) { - Size = new Vector2(540f, 300f); + Size = new Vector2(570f, 300f); SizeCondition = ImGuiCond.FirstUseEver; } @@ -55,30 +55,43 @@ public override void Draw() var ability = Service.Config.ControlWindow0GCDSize * Service.Config.ControlWindowNextSizeRatio; var width = gcd + ability + ImGui.GetStyle().ItemSpacing.X; - ImGui.SetColumnWidth(0, width + ImGui.GetStyle().ColumnsMinSpacing * 2); ImGui.SetColumnWidth(1, 8); DrawNextAction(gcd, ability, width); + ImGui.SameLine(); + var columnWidth = ImGui.GetCursorPosX(); + ImGui.NewLine(); + ImGui.Spacing(); - DrawCommandAction(61751, StateCommandType.ManualTarget, ImGuiColors.DPSRed); + DrawCommandAction(61751, StateCommandType.Manual, ImGuiColors.DPSRed); ImGui.SameLine(); DrawCommandAction(61764, StateCommandType.Cancel, ImGuiColors.DalamudWhite2); - DrawCommandAction(61822, StateCommandType.AutoTarget, ImGuiColors.DPSRed); + ImGui.SameLine(); + columnWidth = Math.Max(columnWidth, ImGui.GetCursorPosX()); + ImGui.NewLine(); + + DrawCommandAction(61822, StateCommandType.Auto, ImGuiColors.DPSRed); ImGui.SameLine(); ImGui.BeginGroup(); - ImGui.Text(DataCenter.TargetingType.ToName()); + ImGui.TextColored(ImGuiColors.DPSRed, DataCenter.TargetingType.ToName()); RotationConfigWindow.DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoMove, ref Service.Config.IsControlWindowLock, Service.Default.IsControlWindowLock); ImGui.EndGroup(); + ImGui.SameLine(); + columnWidth = Math.Max(columnWidth, ImGui.GetCursorPosX()); + ImGui.NewLine(); + + ImGui.SetColumnWidth(0, columnWidth); + ImGui.NextColumn(); ImGui.NextColumn(); diff --git a/RotationSolver/UI/RotationConfigWindow_Control.cs b/RotationSolver/UI/RotationConfigWindow_Control.cs index 23d04140b..045e05af5 100644 --- a/RotationSolver/UI/RotationConfigWindow_Control.cs +++ b/RotationSolver/UI/RotationConfigWindow_Control.cs @@ -35,7 +35,7 @@ private void DrawControlTab() DrawColor4(LocalizationManager.RightLang.ConfigWindow_Control_InfoWindowBg, ref Service.Config.InfoWindowBg, Service.Default.InfoWindowBg); - DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoInputs, + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoInputs + "##Info", ref Service.Config.IsInfoWindowNoInputs, Service.Default.IsInfoWindowNoInputs); DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoMove, @@ -68,7 +68,7 @@ private void DrawControlTab() if (Service.Config.ShowControlWindow) { - DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoInputs, + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsInfoWindowNoInputs + "##Control", ref Service.Config.IsControlWindowLock, Service.Default.IsControlWindowLock); if (Service.Config.IsControlWindowLock) diff --git a/RotationSolver/UI/RotationConfigWindow_Help.cs b/RotationSolver/UI/RotationConfigWindow_Help.cs index 074f167fa..5a3e36121 100644 --- a/RotationSolver/UI/RotationConfigWindow_Help.cs +++ b/RotationSolver/UI/RotationConfigWindow_Help.cs @@ -50,9 +50,9 @@ private void DrawHelpTab() { ImGui.PushStyleVar(ImGuiStyleVar.ItemSpacing, new Vector2(0f, 5f)); - StateCommandType.AutoTarget.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp); + StateCommandType.Auto.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp); - StateCommandType.ManualTarget.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp); + StateCommandType.Manual.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp); StateCommandType.Cancel.DisplayCommandHelp(getHelp: EnumTranslations.ToHelp);