Skip to content
This repository has been archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
fix: removed mouse movement lock.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 24, 2023
1 parent dadc9a2 commit 68df11e
Show file tree
Hide file tree
Showing 9 changed files with 15 additions and 66 deletions.
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
"ClickingCount": 7157
"ClickingCount": 8844
}
2 changes: 1 addition & 1 deletion RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ internal static class DataCenter
internal static bool NoPoslock => Svc.Condition[ConditionFlag.OccupiedInEvent]
|| !Service.Config.GetValue(Configuration.PluginConfigBool.PoslockCasting)
//Key cancel.
|| Svc.KeyState[ConfigurationHelper.Keys[Service.Config.GetValue(Configuration.PluginConfigInt.PoslockModifier)]]
|| Svc.KeyState[ConfigurationHelper.Keys[Service.Config.GetValue(Configuration.PluginConfigInt.PoslockModifier) % ConfigurationHelper.Keys.Length]]
//Gamepad cancel.
|| Svc.GamepadState.Raw(Dalamud.Game.ClientState.GamePad.GamepadButtons.L2) >= 0.5f;

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Helpers/ConfigurationHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ internal static class ConfigurationHelper
573, //没学会 ?
};

public static readonly VirtualKey[] Keys = new VirtualKey[] { VirtualKey.CONTROL, VirtualKey.SHIFT, VirtualKey.MENU, VirtualKey.LBUTTON, VirtualKey.MBUTTON, VirtualKey.RBUTTON };
public static readonly VirtualKey[] Keys = new VirtualKey[] { VirtualKey.CONTROL, VirtualKey.SHIFT, VirtualKey.MENU };

public static float GetHealthAreaAbility(this Job job)
=> Service.Config.GetValue(job, Configuration.JobConfigFloat.HealthAreaAbility);
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Helpers/ObjectHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public static bool IsDying(this BattleChara b)
public static float GetDeadTime(this BattleChara b, bool wholeTime = false)
{
if (b == null) return float.NaN;
if (b.IsDummy()) return 999f;
if (b.IsDummy()) return 999.99f;

var objectId = b.ObjectId;

Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,8 @@ public static void DoAction()
//Svc.Chat.Print($"{act}, {act.Target.Name}, {ActionUpdater.AbilityRemainCount}, {ActionUpdater.WeaponElapsed}");
#endif
//Change Target
if (act.Target != null && (Service.Config.GetValue(PluginConfigBool.SwitchTargetFriendly) && !DataCenter.IsManual || ((Svc.Targets.Target?.IsNPCEnemy() ?? true)
if (act.Target != null && act.Target != Player.Object && !DataCenter.IsManual
&& (Service.Config.GetValue(PluginConfigBool.SwitchTargetFriendly) || ((Svc.Targets.Target?.IsNPCEnemy() ?? true)
|| Svc.Targets.Target?.GetObjectKind() == Dalamud.Game.ClientState.Objects.Enums.ObjectKind.Treasure)
&& act.Target.IsNPCEnemy()))
{
Expand Down
4 changes: 3 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@
"ConfigWindow_Param_HealOutOfCombat": "Heal party members outside of combat.",
"ConfigWindow_Param_OnlyHotOnTanks": "Use single target healing over time actions only on tanks",
"ConfigWindow_Param_BeneficialAreaOnLocations": "On Listed Position",
"ConfigWindow_Param_BeneficialAreaOnlyOnLocations": "Only On Listed Position",
"ConfigWindow_Param_BeneficialAreaOnTarget": "On target",
"ConfigWindow_Param_BeneficialAreaOnCalculated": "On the calculated Position",
"ConfigWindow_Param_HealthDifference": "HP%% for standard deviation for using AOE heal.",
Expand Down Expand Up @@ -495,5 +496,6 @@
"ConfigWindow_UI_HostileIconSize": "Hostile Icon size",
"ConfigWindow_UI_StateIconHeight": "State Icon height from position",
"ConfigWindow_UI_StateIconSize": "State Icon size",
"ConfigWindow_UI_ShowStateIcon": "Show State Icon"
"ConfigWindow_UI_ShowStateIcon": "Show State Icon",
"ConfigWindow_Auto_UseGroundBeneficialAbilityWhenMoving": "Use beneficial area action when moving."
}
62 changes: 4 additions & 58 deletions RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2144,64 +2144,10 @@ private static void DrawLastAction()

private static unsafe void DrawIcon()
{
//if(ImGui.BeginTable("BLUAction", 4, ImGuiTableFlags.Borders | ImGuiTableFlags.Resizable | ImGuiTableFlags.SizingFixedFit))
//{
// foreach (var item in Svc.Data.GetExcelSheet<Lumina.Excel.GeneratedSheets.Action>())
// {
// if (item == null) continue;
// if (item.ClassJob?.Row != 36) continue;
// //if (item.RowId <= 20000) continue;

// ImGui.TableNextRow();
// ImGui.TableNextColumn();

// ImGui.Text($"{item.Name}");

// ImGui.TableNextColumn();

// try
// {
// var tex = IconSet.GetTexture(item.Icon);
// if (tex != null)
// {
// ImGui.Image(tex.ImGuiHandle, Vector2.One * 32);
// }
// }
// catch
// {

// }
// ImGui.TableNextColumn();

// try
// {
// ImGui.Text($"{(Aspect)item.Aspect}");
// ImGui.SameLine();
// var desc = item.AttackType?.Value?.Name?.ToString();
// if (!string.IsNullOrEmpty(desc)) ImGui.Text(desc);
// }
// catch
// {

// }
// ImGui.TableNextColumn();

// //ImGui.TableNextColumn();

// //try
// //{
// // var desc = Svc.Data.GetExcelSheet<ActionTransient>()?.GetRow(item.RowId)?.Description?.ToString();
// // //ImGui.Text((!string.IsNullOrEmpty(desc)).ToString());
// // //if (!string.IsNullOrEmpty(desc)) ImGui.Text(desc);
// //}
// //catch
// //{

// //}
// }
// ImGui.EndTable();
//}

foreach (var item in Svc.KeyState.GetValidVirtualKeys())
{
ImGui.Text(item.ToString());
}
}

private static void DrawAction(ActionID id, string type)
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/RotationConfigWindow_Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -886,7 +886,7 @@ private static void DrawExtra()
private static readonly ISearchable[] _extraSearchable = new ISearchable[]
{
new CheckBoxSearchPlugin(PluginConfigBool.PoslockCasting,
new DragIntSearchPlugin( PluginConfigInt.PoslockModifier, () => new string[]{ "SHIFT", "CTRL", "ALT", "Left Mouse", "Middle Mouse", "Right Mouse" }),
new DragIntSearchPlugin(PluginConfigInt.PoslockModifier, () => new string[]{ "CTRL", "SHIFT", "ALT" }),
new CheckBoxSearchPlugin(PluginConfigBool.PosPassageOfArms)
{
Action = ActionID.PassageOfArms
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/SearchableConfigs/DragIntSearch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ protected override void DrawMain(Job job)

if(GetNames != null && GetNames() is string[] strs && strs.Length > 0)
{
ImGui.SetNextItemWidth(Math.Max(ImGui.CalcTextSize(strs[value]).X + 30, DRAG_WIDTH) * Scale);
ImGui.SetNextItemWidth(Math.Max(ImGui.CalcTextSize(strs[value % strs.Length]).X + 30, DRAG_WIDTH) * Scale);
if (ImGui.Combo($"##Config_{ID}{GetHashCode()}", ref value, strs, strs.Length))
{
SetValue(job, value);
Expand Down

0 comments on commit 68df11e

Please sign in to comment.