From d7cd205aa2d63be49a86e000d8b18efa9380adce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A7=8B=E6=B0=B4?= <1123993881@qq.com> Date: Wed, 8 Nov 2023 08:38:48 +0800 Subject: [PATCH] fix: fixed percent condition. --- Resources/Supporters.json | 2 ++ RotationSolver.Basic/Actions/BaseAction_Target.cs | 2 +- RotationSolver.Basic/Actions/IBaseAction.cs | 2 +- RotationSolver/UI/ConditionDrawer.cs | 4 ++-- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Resources/Supporters.json b/Resources/Supporters.json index ce29858fb..8aea1d52c 100644 --- a/Resources/Supporters.json +++ b/Resources/Supporters.json @@ -1,4 +1,6 @@ [ + "Vipps", + "LuckyTM", "Vain", "Abuse", "Constantinescu Marius", diff --git a/RotationSolver.Basic/Actions/BaseAction_Target.cs b/RotationSolver.Basic/Actions/BaseAction_Target.cs index 3a564506f..3a81d2f00 100644 --- a/RotationSolver.Basic/Actions/BaseAction_Target.cs +++ b/RotationSolver.Basic/Actions/BaseAction_Target.cs @@ -66,7 +66,7 @@ public float TimeToKill /// Is this action's target is a boss? /// [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Please use Target.IsBossFromTTK() or Target.IsBossFromIcon instead.", true)] + [Obsolete("Please use Target.IsBossFromTTK() or Target.IsBossFromIcon() instead.", true)] public bool IsTargetBoss => Target?.IsBossFromTTK() ?? false; /// diff --git a/RotationSolver.Basic/Actions/IBaseAction.cs b/RotationSolver.Basic/Actions/IBaseAction.cs index fa57e5cef..52625a266 100644 --- a/RotationSolver.Basic/Actions/IBaseAction.cs +++ b/RotationSolver.Basic/Actions/IBaseAction.cs @@ -195,7 +195,7 @@ public interface IBaseAction : IAction /// Is target a boss. /// [EditorBrowsable(EditorBrowsableState.Never)] - [Obsolete("Please use Target.IsBossFromTTK() or Target.IsBossFromIcon instead.", true)] + [Obsolete("Please use Target.IsBossFromTTK() or Target.IsBossFromIcon() instead.", true)] bool IsTargetBoss { get; } /// diff --git a/RotationSolver/UI/ConditionDrawer.cs b/RotationSolver/UI/ConditionDrawer.cs index 02a5e59f4..6e6cd38ac 100644 --- a/RotationSolver/UI/ConditionDrawer.cs +++ b/RotationSolver/UI/ConditionDrawer.cs @@ -101,10 +101,10 @@ public static void DrawByteEnum(string name, ref T value, Func fun public static bool DrawDragFloat(ConfigUnitType type, string name, ref float value) { ImGui.SameLine(); - var show = type == ConfigUnitType.Percent ? $"{value:F1}{type.ToSymbol()}" : $"{value:F2}{type.ToSymbol()}"; + var show = type == ConfigUnitType.Percent ? $"{value * 100:F1}{type.ToSymbol()}" : $"{value:F2}{type.ToSymbol()}"; ImGui.SetNextItemWidth(Math.Max(50 * ImGuiHelpers.GlobalScale, ImGui.CalcTextSize(show).X)); - var result = ImGui.DragFloat(name, ref value, 0.1f, 0, 0, show); + var result = ImGui.DragFloat(name, ref value, type == ConfigUnitType.Percent ? 0.001f : 0.1f, 0, 0, show); ImguiTooltips.HoveredTooltip(type.ToDesc()); return result; }