diff --git a/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs b/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs index eb87e7e72..dd3770303 100644 --- a/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs +++ b/RotationSolver.Basic/Actions/BaseAction/BaseAction_ActionInfo.cs @@ -132,7 +132,17 @@ public unsafe bool Use() { var loc = new FFXIVClientStructs.FFXIV.Common.Math.Vector3() { X = _position.X, Y = _position.Y, Z = _position.Z }; - return _action.TargetArea ? ActionManager.Instance()->UseActionLocation(ActionType.Spell, ID, Service.Player.ObjectId, &loc) : - ActionManager.Instance()->UseAction(ActionType.Spell, AdjustedID, _targetId); + if (_action.TargetArea) + { + return ActionManager.Instance()->UseActionLocation(ActionType.Spell, ID, Service.Player.ObjectId, &loc); + } + else if(Service.ObjectTable.SearchById(_targetId) == null) + { + return false; + } + else + { + return ActionManager.Instance()->UseAction(ActionType.Spell, AdjustedID, _targetId); + } } } diff --git a/RotationSolver/RotationHelper.cs b/RotationSolver/RotationHelper.cs index a861500eb..b1263fcc2 100644 --- a/RotationSolver/RotationHelper.cs +++ b/RotationSolver/RotationHelper.cs @@ -16,7 +16,7 @@ internal static class RotationHelper }; public static bool IsDefault(this ICustomRotation rotation) - => DefaultAssembly == GetId(rotation); + => DefaultAssembly == rotation.GetType().Assembly.GetName().Name; public static bool IsAllowed(this ICustomRotation rotation, out string name) { @@ -26,12 +26,7 @@ public static bool IsAllowed(this ICustomRotation rotation, out string name) return false; } name = rotation.GetType().Assembly.GetName().Name; - return _allowedAssembly.Contains(GetId(rotation)); - } - - internal static string GetId(this ICustomRotation rotation) - { - return Convert.ToBase64String(rotation.GetType().Assembly.GetName().GetPublicKeyToken()); + return _allowedAssembly.Contains(name); } public static Vector4 GetColor(this ICustomRotation rotation) diff --git a/RotationSolver/UI/ControlWindow.cs b/RotationSolver/UI/ControlWindow.cs index 17952c37e..9ab7002fb 100644 --- a/RotationSolver/UI/ControlWindow.cs +++ b/RotationSolver/UI/ControlWindow.cs @@ -93,15 +93,15 @@ public override void Draw() ImGui.Text(pair.Key); - bool started = false; + uint started = 0; foreach(var item in showItems) { - if (started) + if (started % 14 != 0) { ImGui.SameLine(); } DrawActionCooldown(item); - started = true; + started ++; } } } diff --git a/RotationSolver/UI/ImGuiHelper.cs b/RotationSolver/UI/ImGuiHelper.cs index b9c92ccfe..1213ff163 100644 --- a/RotationSolver/UI/ImGuiHelper.cs +++ b/RotationSolver/UI/ImGuiHelper.cs @@ -477,8 +477,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation ImGui.SameLine(); Spacing(); - var display = ImGui.GetIO().DisplaySize; - var displayS = Math.Min(display.X, display.Y) * 0.8f; + var display = ImGui.GetIO().DisplaySize * 0.7f; foreach (var texture in attrs) { @@ -491,7 +490,7 @@ public unsafe static void Display(this ICustomRotation rotation, ICustomRotation { DrawTooltip(() => { - var ratio = Math.Min(1, displayS / Math.Max(texture.Texture.Width, texture.Texture.Height)); + var ratio = Math.Min(1, Math.Min(display.X / texture.Texture.Width, display.Y / texture.Texture.Height)); var size = new Vector2(texture.Texture.Width * ratio, texture.Texture.Height * ratio); ImGui.Image(texture.Texture.ImGuiHandle, size); diff --git a/RotationSolver/UI/RotationConfigWindow_Control.cs b/RotationSolver/UI/RotationConfigWindow_Control.cs index efa2bae46..7e3e4b158 100644 --- a/RotationSolver/UI/RotationConfigWindow_Control.cs +++ b/RotationSolver/UI/RotationConfigWindow_Control.cs @@ -1,12 +1,7 @@ using ImGuiNET; using RotationSolver.Basic; using RotationSolver.Localization; -using System; -using System.Collections.Generic; -using System.Linq; using System.Numerics; -using System.Text; -using System.Threading.Tasks; namespace RotationSolver.UI; @@ -14,6 +9,15 @@ internal partial class RotationConfigWindow { private void DrawControlTab() { + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_UseGamepadCommand, + ref Service.Config.UseGamepadCommand); + + + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_UseKeyboardCommand, + ref Service.Config.UseKeyboardCommand); + + ImGui.Separator(); + DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_ShowControlWindow, ref Service.Config.ShowControlWindow); @@ -22,12 +26,6 @@ private void DrawControlTab() DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_IsControlWindowLock, ref Service.Config.IsControlWindowLock); - DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_UseKeyboardCommand, - ref Service.Config.UseKeyboardCommand); - - DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_UseGamepadCommand, - ref Service.Config.UseGamepadCommand); - DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Control_ControlShowCooldown, ref Service.Config.ControlShowCooldown); diff --git a/RotationSolver/UI/RotationConfigWindow_Debug.cs b/RotationSolver/UI/RotationConfigWindow_Debug.cs index e4ff83ee4..7dafabd53 100644 --- a/RotationSolver/UI/RotationConfigWindow_Debug.cs +++ b/RotationSolver/UI/RotationConfigWindow_Debug.cs @@ -23,17 +23,6 @@ private void DrawDebugTab() if (ImGui.BeginTabBar("Debug Items")) { - -#if DEBUG - if(RotationUpdater.Plugins != null) - { - foreach (var p in RotationUpdater.Plugins) - { - var s = p; - ImGui.InputText($"##{p}", ref s, 512); - } - } -#endif DrawParamTabItem("Status", DrawStatus); DrawParamTabItem("Party", DrawParty); DrawParamTabItem("Target Data", DrawTargetData); @@ -106,7 +95,7 @@ private unsafe void DrawTargetData() foreach (var status in b.StatusList) { - var source = Service.ObjectTable.SearchById(status.SourceId)?.Name ?? "None"; + var source = status.SourceId == Service.Player.ObjectId ? "You" : Service.ObjectTable.SearchById(status.SourceId) == null ? "None" : "Others"; ImGui.Text($"{status.GameData.Name}: {status.StatusId} From: {source}"); } } diff --git a/RotationSolver/UI/RotationConfigWindow_RotationDev.cs b/RotationSolver/UI/RotationConfigWindow_RotationDev.cs index 8293e1f55..d622d0bdc 100644 --- a/RotationSolver/UI/RotationConfigWindow_RotationDev.cs +++ b/RotationSolver/UI/RotationConfigWindow_RotationDev.cs @@ -56,6 +56,7 @@ private void DrawRotationDevTab() var list = Service.Config.OtherLibs.ToList(); list.RemoveAt(removeIndex); Service.Config.OtherLibs = list.ToArray(); + Service.Config.Save(); } ImGui.EndChild();