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

Commit

Permalink
fix: add a param to control the melee distance.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 30, 2023
1 parent 7f8233f commit f62ad16
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,7 @@ public class PluginConfiguration : IPluginConfiguration
public float ControlWindowNextSizeRatio = 1.5f;
public float ControlProgressHeight = 8;
public bool ShowCooldownWindow = false;
public float DistanceForMoving = 1.2f;

public Dictionary<StateCommandType, KeyRecord> KeyState { get; set; } = new Dictionary<StateCommandType, KeyRecord>();
public Dictionary<SpecialCommandType, KeyRecord> KeySpecial { get; set; } = new Dictionary<SpecialCommandType, KeyRecord>();
Expand All @@ -225,7 +226,6 @@ public class PluginConfiguration : IPluginConfiguration

{SpecialCommandType.Burst, new ButtonRecord( GamepadButtons.DpadDown, true, false) },
{SpecialCommandType.AntiKnockback, new ButtonRecord( GamepadButtons.DpadUp, true, false) },

};

public ButtonRecord ButtonDoAction { get; set; } = null;
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Helpers/TargetFilter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ internal static T FindTargetForMoving<T>(this IEnumerable<T> charas, bool mustUs
{
var tar = charas.OrderBy(ObjectHelper.DistanceToPlayer).FirstOrDefault();
if (tar == null) return null;
if (tar.DistanceToPlayer() < 1) return tar;
if (tar.DistanceToPlayer() < Service.Config.DistanceForMoving) return tar;
return null;
}

Expand Down
2 changes: 2 additions & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ internal partial class Strings
public string ConfigWindow_Param_HealthHealerRatio { get; set; } = "Heal healer first if its HP threshold is lower than this.";

public string ConfigWindow_Param_HealthTankRatio { get; set; } = "Heal tank first if its HP threshold is lower than this.";

public string ConfigWindow_Param_DistanceForMoving { get; set; } = "If the distance between Melee or Tank to target is less than this, using moving ability as attack ability.";
public string ConfigWindow_Param_HealingOfTimeSubtractSingle { get; set; } = "Set the HP threshold reduce with hot effect(single)";
public string ConfigWindow_Param_HealthForDyingTank { get; set; } = "Set the HP threshold for tank to use invincibility";

Expand Down
23 changes: 13 additions & 10 deletions RotationSolver/UI/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ private void DrawParamDisplay()
ref Service.Config.ShowInfoOnToast, Service.Default.ShowInfoOnToast);

DrawIntNumber(LocalizationManager.RightLang.ConfigWindow_Param_NamePlateIconId,
ref Service.Config.NamePlateIconId, 5, 0, 150000, otherThing: RSCommands.UpdateStateNamePlate);
ref Service.Config.NamePlateIconId, Service.Default.NamePlateIconId, 5, 0, 150000, otherThing: RSCommands.UpdateStateNamePlate);

ImGui.Spacing();

Expand Down Expand Up @@ -332,7 +332,7 @@ private void DrawParamAction()
ref Service.Config.UseHealWhenNotAHealer, Service.Default.UseHealWhenNotAHealer);

DrawIntNumber(LocalizationManager.RightLang.ConfigWindow_Param_LessMPNoRaise,
ref Service.Config.LessMPNoRaise, 200, 0, 2000000);
ref Service.Config.LessMPNoRaise, Service.Default.LessMPNoRaise, 200, 0, 2000000);
}

private void DrawParamCondition()
Expand All @@ -357,30 +357,33 @@ private void DrawParamCondition()

const float speed = 0.005f;

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_DistanceForMoving,
ref Service.Config.DistanceForMoving, Service.Default.DistanceForMoving, speed * 3);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_MeleeRangeOffset,
ref Service.Config.MeleeRangeOffset, 5 * speed, max: 5);
ref Service.Config.MeleeRangeOffset, Service.Default.MeleeRangeOffset, 5 * speed, max: 5);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_HealthDifference,
ref Service.Config.HealthDifference,
ref Service.Config.HealthDifference, Service.Default.HealthDifference,
speed * 2, 0, 0.5f);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_HealthAreaAbility,
ref Service.Config.HealthAreaAbility, speed);
ref Service.Config.HealthAreaAbility, Service.Default.HealthAreaAbility, speed);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_HealthAreaSpell,
ref Service.Config.HealthAreaSpell, speed);
ref Service.Config.HealthAreaSpell, Service.Default.HealthAreaSpell, speed);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_HealthSingleAbility,
ref Service.Config.HealthSingleAbility, speed);
ref Service.Config.HealthSingleAbility, Service.Default.HealthSingleAbility, speed);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_HealthSingleSpell,
ref Service.Config.HealthSingleSpell, speed);
ref Service.Config.HealthSingleSpell, Service.Default.HealthSingleSpell, speed);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_HealthHealerRatio,
ref Service.Config.HealthHealerRatio, speed);
ref Service.Config.HealthHealerRatio, Service.Default.HealthHealerRatio, speed);

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_HealthTankRatio,
ref Service.Config.HealthTankRatio, speed);
ref Service.Config.HealthTankRatio, Service.Default.HealthTankRatio, speed);
}

private void DrawParamTarget()
Expand Down

0 comments on commit f62ad16

Please sign in to comment.