diff --git a/RotationSolver/Localization/Localization.json b/RotationSolver/Localization/Localization.json index 3638b9426..1e5eb1e6d 100644 --- a/RotationSolver/Localization/Localization.json +++ b/RotationSolver/Localization/Localization.json @@ -66,6 +66,7 @@ "Configwindow_Param_StopCastingDelay": "Set the range of random delay for stoping casting when target is dead in second.", "Configwindow_Param_WorkTaskDelay": "Set the work task delay in millisecond. Smaller, more precise, more resource-intensive", "Configwindow_Param_Display": "Display", + "Configwindow_Param_Advanced": "Advanced", "Configwindow_Param_PoslockCasting": "Lock the movement when casting.", "Configwindow_Param_UseStopCasting": "Use stopping casting when target is dead.", "Configwindow_Param_PoslockModifier": "Set the modifier key to unlock the movement temporary", @@ -88,10 +89,11 @@ "Configwindow_Params_LocationWrongTextDesc": "How do you want to be scolded if you have a positional error ?!", "Configwindow_Param_SayOutStateChanged": "Saying the state changes out", "Configwindow_Param_ShowInfoOnDtr": "Display plugin state on dtrbar", + "Configwindow_Param_ShowWorkTaskFPS": "Display Task FPS on dtrbar", "Configwindow_Param_ShowInfoOnToast": "Display plugin state changed on toast", "Configwindow_Param_Action": "Action", "Configwindow_Param_UseAOEWhenManual": "Use AOE actions in manual mode", - "Configwindow_Param_AutoBreak": "Automatic breaking", + "Configwindow_Param_AutoBurst": "Automatic burst", "Configwindow_Param_UseAbility": "Auto-use abilities", "Configwindow_Param_NoNewHostiles": "Don't attack new mobs by aoe", "Configwindow_Params_NoNewHostilesDesc": "Nerver use any AOE action when this action may attack the mobs that not is a hostile target.", diff --git a/RotationSolver/Localization/Strings_Major.cs b/RotationSolver/Localization/Strings_Major.cs index d9dca5bd1..525593d58 100644 --- a/RotationSolver/Localization/Strings_Major.cs +++ b/RotationSolver/Localization/Strings_Major.cs @@ -119,7 +119,6 @@ internal partial class Strings public string Configwindow_Param_WorkTaskDelay { get; set; } = "Set the work task delay in millisecond. Smaller, more precise, more resource-intensive"; public string Configwindow_Param_Display { get; set; } = "Display"; - public string Configwindow_Param_Sound { get; set; } = "Sound"; public string Configwindow_Param_Advanced { get; set; } = "Advanced"; public string Configwindow_Param_PoslockCasting { get; set; } = "Lock the movement when casting."; public string Configwindow_Param_UseStopCasting { get; set; } = "Use stopping casting when target is dead."; @@ -149,7 +148,7 @@ internal partial class Strings public string Configwindow_Param_ShowInfoOnToast { get; set; } = "Display plugin state changed on toast"; public string Configwindow_Param_Action { get; set; } = "Action"; public string Configwindow_Param_UseAOEWhenManual { get; set; } = "Use AOE actions in manual mode"; - public string Configwindow_Param_AutoBreak { get; set; } = "Automatic breaking"; + public string Configwindow_Param_AutoBurst { get; set; } = "Automatic burst"; public string Configwindow_Param_UseAbility { get; set; } = "Auto-use abilities"; public string Configwindow_Param_NoNewHostiles { get; set; } = "Don't attack new mobs by aoe"; public string Configwindow_Params_NoNewHostilesDesc { get; set; } = "Nerver use any AOE action when this action may attack the mobs that not is a hostile target."; diff --git a/RotationSolver/Updaters/MajorUpdater.cs b/RotationSolver/Updaters/MajorUpdater.cs index 29ca1c356..40544df92 100644 --- a/RotationSolver/Updaters/MajorUpdater.cs +++ b/RotationSolver/Updaters/MajorUpdater.cs @@ -51,18 +51,18 @@ private static void FrameworkUpdate(Framework framework) public static void Enable() { Service.Framework.Update += FrameworkUpdate; - Task.Run(() => + Task.Run(async () => { while (_work) { if (!Service.Configuration.UseWorkTask || !Service.Conditions.Any() || Service.ClientState.LocalPlayer == null) { - Task.Delay(200); + await Task.Delay(200); continue; } UpdateWork(); - Task.Delay(Service.Configuration.WorkTaskDelay); + await Task.Delay(Service.Configuration.WorkTaskDelay); CalculateFPS(); } @@ -76,7 +76,7 @@ private static void CalculateFPS() var span = now - _lastUpdate; if (span > _oneSecond) { - FrameCount = (_frameCount / span.TotalSeconds).ToString("F2"); + FrameCount = _frameCount.ToString(); _lastUpdate = now; _frameCount = 0; } diff --git a/RotationSolver/Updaters/PreviewUpdater.cs b/RotationSolver/Updaters/PreviewUpdater.cs index 5a5d1cbfe..5c012c768 100644 --- a/RotationSolver/Updaters/PreviewUpdater.cs +++ b/RotationSolver/Updaters/PreviewUpdater.cs @@ -31,9 +31,9 @@ internal static void UpdatePreview() private static void UpdateEntry() { var showStr = RSCommands.EntryString; - if (Service.Configuration.ShowWorkTaskFPS) + if (Service.Configuration.UseWorkTask && Service.Configuration.ShowWorkTaskFPS) { - showStr += " " + MajorUpdater.FrameCount + "Hz"; + showStr += " - " + MajorUpdater.FrameCount + "Hz"; } if (Service.Configuration.ShowInfoOnDtr && showStr != null) { diff --git a/RotationSolver/Updaters/TargetUpdater_Friends.cs b/RotationSolver/Updaters/TargetUpdater_Friends.cs index 8936aa95d..61ef180ce 100644 --- a/RotationSolver/Updaters/TargetUpdater_Friends.cs +++ b/RotationSolver/Updaters/TargetUpdater_Friends.cs @@ -137,7 +137,13 @@ private unsafe static void UpdateFriends(IEnumerable allTargets) UpdateCanHeal(Service.ClientState.LocalPlayer); } - static RandomDelay _healDelay = new RandomDelay(() => (Service.Configuration.HealDelayMin, Service.Configuration.HealDelayMax)); + static RandomDelay _healDelay1 = new RandomDelay(() => (Service.Configuration.HealDelayMin, Service.Configuration.HealDelayMax)); + + static RandomDelay _healDelay2 = new RandomDelay(() => (Service.Configuration.HealDelayMin, Service.Configuration.HealDelayMax)); + + static RandomDelay _healDelay3 = new RandomDelay(() => (Service.Configuration.HealDelayMin, Service.Configuration.HealDelayMax)); + + static RandomDelay _healDelay4 = new RandomDelay(() => (Service.Configuration.HealDelayMin, Service.Configuration.HealDelayMax)); static void UpdateCanHeal(PlayerCharacter player) { @@ -164,10 +170,10 @@ static void UpdateCanHeal(PlayerCharacter player) } //Delay - CanHealSingleAbility = _healDelay.Delay(CanHealSingleAbility); - CanHealSingleSpell = _healDelay.Delay(CanHealSingleSpell); - CanHealAreaAbility = _healDelay.Delay(CanHealAreaAbility); - CanHealAreaSpell = _healDelay.Delay(CanHealAreaSpell); + CanHealSingleAbility = _healDelay1.Delay(CanHealSingleAbility); + CanHealSingleSpell = _healDelay2.Delay(CanHealSingleSpell); + CanHealAreaAbility = _healDelay3.Delay(CanHealAreaAbility); + CanHealAreaSpell = _healDelay4.Delay(CanHealAreaSpell); PartyMembersMinHP = PartyMembersHP.Any() ? PartyMembersHP.Min() : 0; HPNotFull = PartyMembersMinHP < 1; diff --git a/RotationSolver/Windows/RotationConfigWindow_Param.cs b/RotationSolver/Windows/RotationConfigWindow_Param.cs index fc3ed7cf4..e95114482 100644 --- a/RotationSolver/Windows/RotationConfigWindow_Param.cs +++ b/RotationSolver/Windows/RotationConfigWindow_Param.cs @@ -35,7 +35,6 @@ private void DrawParamTab() DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Basic, DrawParamBasic); DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Delay, DrawParamDelay); DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Display, DrawParamDisplay); - DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Sound, DrawParamSound); DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Action, DrawParamAction); DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Conditon, DrawParamCondition); DrawParamTabItem(LocalizationManager.RightLang.Configwindow_Param_Target, DrawParamTarget); @@ -111,25 +110,23 @@ private void DrawParamDelay() } } - private void DrawParamSound() + private void DrawParamAdvanced() { DrawIntNumber(LocalizationManager.RightLang.Configwindow_Params_VoiceVolume, - ref Service.Configuration.VoiceVolume, max: 100); + ref Service.Configuration.VoiceVolume, max: 100); DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_SayOutStateChanged, ref Service.Configuration.SayOutStateChanged); - DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_SayPositional, ref Service.Configuration.SayPotional); DrawInputText(LocalizationManager.RightLang.Configwindow_Param_PositionaErrorText, ref Service.Configuration.PositionalErrorText, 100, LocalizationManager.RightLang.Configwindow_Params_LocationWrongTextDesc); - } - private void DrawParamAdvanced() - { + ImGui.Separator(); + DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_PoslockCasting, ref Service.Configuration.PoslockCasting); @@ -235,7 +232,7 @@ private void DrawParamAction() ImGui.Separator(); - DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_AutoBreak, + DrawCheckBox(LocalizationManager.RightLang.Configwindow_Param_AutoBurst, ref Service.Configuration.AutoBurst); ImGui.SameLine();