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

Commit

Permalink
fix: add an option for showing Ping ans set max Ping.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 25, 2023
1 parent d002ec8 commit 19570f8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 1 addition & 0 deletions RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public class PluginConfiguration : IPluginConfiguration
public float MeleeRangeOffset = 1;
public bool TargetFriendly = false;
public float AlphaInFill = 0.15f;
public int MaxPing = 200;

public SortedSet<uint> DangerousStatus { get; set; } = new SortedSet<uint>()
{
Expand Down
8 changes: 4 additions & 4 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -310,10 +310,10 @@ public static float DPSTaken
public static ActionID LastGCD { get; private set; } = 0;

public static ActionID LastAbility { get; private set; } = 0;
public static float Ping { get; private set; } = 0.07f;
public static float Ping => Math.Min(RealPing, Service.Config.MaxPing);
public static float RealPing { get; private set; } = 0.07f;

public const float MinAnimationLock = 0.6f;
const float MAX_PING = 0.2f;
public static unsafe void AddActionRec(Action act)
{
var id = (ActionID)act.RowId;
Expand All @@ -326,15 +326,15 @@ public static unsafe void AddActionRec(Action act)
LastAction = LastGCD = id;
if (ActionManager.GetAdjustedCastTime(ActionType.Spell, (uint)id) == 0)
{
Ping = Math.Min(MAX_PING, WeaponElapsed);
RealPing = WeaponElapsed;
}
break;
case ActionCate.Ability:
LastAction = LastAbility = id;

if (!act.IsRealGCD() && ActionManager.GetMaxCharges((uint)id, Service.Player.Level) < 2)
{
Ping = Math.Min(MAX_PING, ActionManager.Instance()->GetRecastGroupDetail(act.CooldownGroup - 1)->Elapsed);
RealPing = ActionManager.Instance()->GetRecastGroupDetail(act.CooldownGroup - 1)->Elapsed;
}
break;
default:
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ internal partial class Strings
public string ConfigWindow_Param_UseOverlayWindow { get; set; } = "Display Top Overlay";
public string ConfigWindow_Param_UseOverlayWindowDesc { get; set; } = "This top window is used to display some extra information on your game window, such as target's positional, target and sub-target, etc.";
public string ConfigWindow_Param_Basic { get; set; } = "Basic";
public string ConfigWindow_Param_MaxPing { get; set; } = "Set your max Ping. If it is too low, may clip.";

public string ConfigWindow_Param_ActionAhead { get; set; } = "Set the time advance of using actions";
public string ConfigWindow_Param_CountDownAhead { get; set; } = "Set the time advance of using casting actions on counting down.";
Expand Down
6 changes: 6 additions & 0 deletions RotationSolver/UI/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,12 @@ private void DrawParamTab()

private void DrawParamBasic()
{
DrawIntNumber(LocalizationManager.RightLang.ConfigWindow_Param_MaxPing,
ref Service.Config.MaxPing, Service.Default.MaxPing, min: 100, max: 500);

ImGui.SameLine();
ImGui.Text(" Your Ping: " + DataCenter.Ping.ToString("F3"));

DrawFloatNumber(LocalizationManager.RightLang.ConfigWindow_Param_ActionAhead,
ref Service.Config.ActionAhead, Service.Default.ActionAhead, max: 0.4f);

Expand Down

0 comments on commit 19570f8

Please sign in to comment.