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

Commit

Permalink
feat: add more auto off options.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Mar 17, 2023
1 parent 88c805c commit 2c485c9
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 8 deletions.
2 changes: 2 additions & 0 deletions RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ public class PluginConfiguration : IPluginConfiguration
public int TimelineIndex = 0;
public bool AutoBurst = true;
public bool AutoOffBetweenArea = true;
public bool AutoOffCutScene = true;
public bool AutoOffWhenDead = true;
public bool UseAbility = true;
public bool UseDefenseAbility = true;
public bool NeverReplaceIcon = false;
Expand Down
16 changes: 12 additions & 4 deletions RotationSolver/Commands/RSCommands_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,15 +66,23 @@ internal static void CancelState()

internal static void UpdateRotationState()
{
if (Service.Player.CurrentHp == 0
|| Service.Conditions[ConditionFlag.LoggingOut])
if (Service.Conditions[ConditionFlag.LoggingOut])
{
CancelState();
}
else if (Service.Config.AutoOffWhenDead
&& Service.Player.CurrentHp == 0)
{
CancelState();
}
else if (Service.Config.AutoOffCutScene
&& Service.Conditions[ConditionFlag.OccupiedInCutSceneEvent])
{
CancelState();
}
else if (Service.Config.AutoOffBetweenArea && (
Service.Conditions[ConditionFlag.BetweenAreas]
|| Service.Conditions[ConditionFlag.BetweenAreas51])
|| Service.Conditions[ConditionFlag.OccupiedInCutSceneEvent])
|| Service.Conditions[ConditionFlag.BetweenAreas51]))
{
CancelState();
}
Expand Down
4 changes: 4 additions & 0 deletions RotationSolver/Localization/Strings_Major.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ internal partial class Strings
public string ConfigWindow_Param_AddDotGCDCount { get; set; } = "Set GCD advance of DOT refresh";
public string ConfigWindow_Param_AutoOffBetweenArea { get; set; } = "Turn off when player is between area.";

public string ConfigWindow_Param_AutoOffCutScene { get; set; } = "Turn off during cut scene.";

public string ConfigWindow_Param_AutoOffWhenDead { get; set; } = "Turn off when dead.";

public string ConfigWindow_Param_UseWorkTask { get; set; } = "Use work task for acceleration.";
public string ConfigWindow_Param_Delay { get; set; } = "Delay";

Expand Down
12 changes: 9 additions & 3 deletions RotationSolver/UI/RotationConfigWindow_Param.cs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ private void DrawParamBasic()
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_AutoOffBetweenArea,
ref Service.Config.AutoOffBetweenArea);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_AutoOffCutScene,
ref Service.Config.AutoOffCutScene);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_AutoOffWhenDead,
ref Service.Config.AutoOffWhenDead);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_StartOnCountdown,
ref Service.Config.StartOnCountdown);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_UseWorkTask,
ref Service.Config.UseWorkTask);
}
Expand Down Expand Up @@ -319,9 +328,6 @@ private void DrawParamCondition()
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_InterruptibleMoreCheck,
ref Service.Config.InterruptibleMoreCheck);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_StartOnCountdown,
ref Service.Config.StartOnCountdown);

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_EsunaAll,
ref Service.Config.EsunaAll);

Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Updaters/ActionUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,8 @@ internal unsafe static void DoAction()
|| Service.Conditions[ConditionFlag.SufferingStatusAffliction2]
|| Service.Conditions[ConditionFlag.RolePlaying]
|| Service.Conditions[ConditionFlag.InFlight]
|| ActionManager.Instance()->ActionQueued) return;
|| ActionManager.Instance()->ActionQueued
|| Service.Player.CurrentHp == 0) return;

//GCD
var canUseGCD = DataCenter.WeaponRemain <= Service.Config.ActionAhead;
Expand Down

0 comments on commit 2c485c9

Please sign in to comment.