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

Commit

Permalink
feat: New Prevention option to prevent actions until duty ring disapp…
Browse files Browse the repository at this point in the history
…ears.
  • Loading branch information
RiotNOR committed May 14, 2023
1 parent e086fed commit 3d50368
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 8 deletions.
1 change: 1 addition & 0 deletions RotationSolver.Basic/Configuration/PluginConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ public class PluginConfiguration : IPluginConfiguration
public bool AutoOffCutScene = true;
public bool AutoOffWhenDead = true;
public bool PreventActionsIfOutOfCombat = false;
public bool PreventActionsIfDutyRing = false;
public bool ChangeTargetForFate = true;
public bool MoveTowardsScreenCenter = true;

Expand Down
4 changes: 3 additions & 1 deletion RotationSolver.Basic/Data/RSCommandType.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ public enum SettingsCommand : byte
UseGroundBeneficialAbility,
UseAOEAction,
UseAOEWhenManual,
PreventActions
PreventActions,
PreventActionsDuty
}

public static class SettingsCommandExtension
Expand All @@ -64,6 +65,7 @@ public static class SettingsCommandExtension
SettingsCommand.UseAOEAction => true,
SettingsCommand.UseAOEWhenManual => false,
SettingsCommand.PreventActions => false,
SettingsCommand.PreventActionsDuty => false,
_ => false,
};
}
3 changes: 2 additions & 1 deletion RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"ConfigWindow_Param_AutoOffBetweenArea": "Auto turn off when player is between area.",
"ConfigWindow_Param_AutoOffCutScene": "Auto turn off during cut scene.",
"ConfigWindow_Param_AutoOffWhenDead": "Auto turn off when dead.",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range.",
"ConfigWindow_Param_PreventActionsIfDutyRing": "Also prevent if in duty until duty start.",
"ConfigWindow_Param_UseWorkTask": "Use work task for acceleration.",
"ConfigWindow_Param_ToggleManual": "Make Manual Command as toggle.",
"ConfigWindow_Param_Delay": "Delay",
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ internal partial class Strings
public string ConfigWindow_Param_AutoOffCutScene { get; set; } = "Auto turn off during cut scene.";

public string ConfigWindow_Param_AutoOffWhenDead { get; set; } = "Auto turn off when dead.";
public string ConfigWindow_Param_PreventActionsIfOutOfCombat { get; set; } = "Prevent Actions if no hostiles in range";
public string ConfigWindow_Param_PreventActionsIfOutOfCombat { get; set; } = "Prevent Actions if no hostiles in range.";
public string ConfigWindow_Param_PreventActionsIfDutyRing { get; set; } = "Also prevent if in duty until duty start.";

public string ConfigWindow_Param_UseWorkTask { get; set; } = "Use work task for acceleration.";
public string ConfigWindow_Param_ToggleManual { get; set; } = "Make Manual Command as toggle.";
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"ConfigWindow_Param_AutoOffBetweenArea": "Auto turn off when player is between area.",
"ConfigWindow_Param_AutoOffCutScene": "Auto turn off during cut scene.",
"ConfigWindow_Param_AutoOffWhenDead": "Auto turn off when dead.",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range.",
"ConfigWindow_Param_PreventActionsIfDutyRing": "Also prevent if in duty until duty start.",
"ConfigWindow_Param_UseWorkTask": "Use work task for acceleration.",
"ConfigWindow_Param_ToggleManual": "Make Manual Command as toggle.",
"ConfigWindow_Param_Delay": "Delay",
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"ConfigWindow_Param_AutoOffBetweenArea": "Auto turn off when player is between area.",
"ConfigWindow_Param_AutoOffCutScene": "Auto turn off during cut scene.",
"ConfigWindow_Param_AutoOffWhenDead": "Auto turn off when dead.",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range.",
"ConfigWindow_Param_PreventActionsIfDutyRing": "Also prevent if in duty until duty start.",
"ConfigWindow_Param_UseWorkTask": "Use work task for acceleration.",
"ConfigWindow_Param_ToggleManual": "Make Manual Command as toggle.",
"ConfigWindow_Param_Delay": "Delay",
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"ConfigWindow_Param_AutoOffBetweenArea": "Auto turn off when player is between area.",
"ConfigWindow_Param_AutoOffCutScene": "Auto turn off during cut scene.",
"ConfigWindow_Param_AutoOffWhenDead": "Auto turn off when dead.",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range.",
"ConfigWindow_Param_PreventActionsIfDutyRing": "Also prevent if in duty until duty start.",
"ConfigWindow_Param_UseWorkTask": "Use work task for acceleration.",
"ConfigWindow_Param_ToggleManual": "Make Manual Command as toggle.",
"ConfigWindow_Param_Delay": "Delay",
Expand Down
3 changes: 2 additions & 1 deletion RotationSolver/Localization/ja.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
"ConfigWindow_Param_AutoOffBetweenArea": "Auto turn off when player is between area.",
"ConfigWindow_Param_AutoOffCutScene": "Auto turn off during cut scene.",
"ConfigWindow_Param_AutoOffWhenDead": "Auto turn off when dead.",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range",
"ConfigWindow_Param_PreventActionsIfOutOfCombat": "Prevent Actions if no hostiles in range.",
"ConfigWindow_Param_PreventActionsIfDutyRing": "Also prevent if in duty until duty start.",
"ConfigWindow_Param_UseWorkTask": "Use work task for acceleration.",
"ConfigWindow_Param_ToggleManual": "Make Manual Command as toggle.",
"ConfigWindow_Param_Delay": "Delay",
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 @@ -290,6 +290,12 @@ private void DrawParamAction()
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_PreventActionsIfOutOfCombat,
SettingsCommand.PreventActions);

if (Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions))
{
DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_PreventActionsIfDutyRing,
SettingsCommand.PreventActionsDuty);
}

ImGui.Separator();

DrawCheckBox(LocalizationManager.RightLang.ConfigWindow_Param_AutoBurst, SettingsCommand.AutoBurst);
Expand Down
7 changes: 6 additions & 1 deletion RotationSolver/Updaters/MajorUpdater.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using Dalamud.Game;
using Dalamud.Game.ClientState.Conditions;
using Dalamud.Logging;
using RotationSolver.Commands;

Expand All @@ -8,7 +9,11 @@ internal static class MajorUpdater
{
public static bool IsValid => Service.Conditions.Any() && Service.Player != null && !SocialUpdater.InPvp;
public static bool ShouldPreventActions => Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions)
&& !DataCenter.HasHostilesInMaxRange;
&& Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActionsDuty)
&& Service.Conditions[ConditionFlag.BoundByDuty]
&& !Service.DutyState.IsDutyStarted
|| Basic.Configuration.PluginConfiguration.GetValue(SettingsCommand.PreventActions)
&& !DataCenter.HasHostilesInMaxRange;

#if DEBUG
private static readonly Dictionary<int, bool> _values = new();
Expand Down

0 comments on commit 3d50368

Please sign in to comment.