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

Commit

Permalink
feat: new UI!
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Aug 14, 2023
1 parent d96c29d commit edb3187
Show file tree
Hide file tree
Showing 63 changed files with 530 additions and 3,532 deletions.
12 changes: 6 additions & 6 deletions RotationSolver.Basic/Actions/BaseAction_BasicInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@ public partial class BaseAction : IBaseAction
/// </summary>
public bool IsEnabled
{
get => !Service.Config.DisabledActions.Contains(ID);
get => !Service.Config.GlobalConfig.DisabledActions.Contains(ID);
set
{
if (value)
{
Service.Config.DisabledActions.Remove(ID);
Service.Config.GlobalConfig.DisabledActions.Remove(ID);
}
else
{
Service.Config.DisabledActions.Add(ID);
Service.Config.GlobalConfig.DisabledActions.Add(ID);
}
}
}
Expand All @@ -113,16 +113,16 @@ public bool IsEnabled
/// </summary>
public bool IsInCooldown
{
get => !Service.Config.NotInCoolDownActions.Contains(ID);
get => !Service.Config.GlobalConfig.NotInCoolDownActions.Contains(ID);
set
{
if (value)
{
Service.Config.NotInCoolDownActions.Remove(ID);
Service.Config.GlobalConfig.NotInCoolDownActions.Remove(ID);
}
else
{
Service.Config.NotInCoolDownActions.Add(ID);
Service.Config.GlobalConfig.NotInCoolDownActions.Add(ID);
}
}
}
Expand Down
33 changes: 17 additions & 16 deletions RotationSolver.Basic/Actions/BaseAction_Target.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using ECommons.GameHelpers;
using FFXIVClientStructs.FFXIV.Client.Game;
using FFXIVClientStructs.FFXIV.Common.Component.BGCollision;
using RotationSolver.Basic.Configuration;

namespace RotationSolver.Basic.Actions;

Expand Down Expand Up @@ -154,7 +155,7 @@ private bool TargetAreaHostile(int aoeCount)

private bool TargetAreaMove(float range, bool mustUse)
{
if (Service.Config.MoveAreaActionFarthest)
if (Service.Config.GetValue(PluginConfigBool.MoveAreaActionFarthest))
{
Vector3 pPosition = Player.Object.Position;
float rotation = Player.Object.Rotation;
Expand All @@ -174,9 +175,9 @@ private bool TargetAreaMove(float range, bool mustUse)

private bool TargetAreaFriend(float range, bool mustUse, PlayerCharacter player)
{
if (!Service.Config.GetValue(SettingsCommand.UseGroundBeneficialAbility)) return false;
if (!Service.Config.GetValue(PluginConfigBool.UseGroundBeneficialAbility)) return false;

if (Service.Config.BeneficialAreaOnTarget && Svc.Targets.Target != null)
if (Service.Config.GetValue(PluginConfigBool.BeneficialAreaOnTarget) && Svc.Targets.Target != null)
{
Position = Svc.Targets.Target.Position;
}
Expand Down Expand Up @@ -236,7 +237,7 @@ private bool TargetParty(float range, int aoeCount, bool mustUse, out BattleChar

var availableCharas = DataCenter.PartyMembers.Where(player => player.CurrentHp != 0);

if (Service.Config.GetValue(SettingsCommand.TargetAllForFriendly) ? _action.CanTargetFriendly : (ActionID)ID == ActionID.AethericMimicry)
if (Service.Config.GetValue(PluginConfigBool.TargetAllForFriendly) ? _action.CanTargetFriendly : (ActionID)ID == ActionID.AethericMimicry)
{
availableCharas = availableCharas.Union(DataCenter.AllianceMembers);
}
Expand All @@ -256,7 +257,7 @@ private bool TargetParty(float range, int aoeCount, bool mustUse, out BattleChar
}
else
{
if(Service.Config.OnlyHotOnTanks && IsEot)
if (Service.Config.GetValue(PluginConfigBool.OnlyHotOnTanks) && IsEot)
{
availableCharas = availableCharas.Where(b => b.IsJobCategory(JobRole.Tank));
}
Expand Down Expand Up @@ -297,10 +298,10 @@ private bool TargetHostile(float range, bool mustUse, int aoeCount, out BattleCh
return false;
}

if (Service.Config.ChooseAttackMark)
if (Service.Config.GetValue(PluginConfigBool.ChooseAttackMark))
{
var b = MarkingHelper.GetAttackMarkChara(DataCenter.HostileTargets);
if (b != null && ChoiceTarget(GetMostObjects(TargetFilterFuncEot(new BattleChara[] { b }, mustUse), Service.Config.CanAttackMarkAOE ? aoeCount : int.MaxValue), mustUse) != null)
if (b != null && ChoiceTarget(GetMostObjects(TargetFilterFuncEot(new BattleChara[] { b }, mustUse), Service.Config.GetValue(PluginConfigBool.CanAttackMarkAOE) ? aoeCount : int.MaxValue), mustUse) != null)
{
target = b;
return true;
Expand Down Expand Up @@ -332,8 +333,8 @@ private bool TargetHostileManual(BattleChara b, bool mustUse, int aoeCount, out
return true;
}

if (Service.Config.GetValue(SettingsCommand.UseAOEAction)
&& Service.Config.GetValue(SettingsCommand.UseAOEWhenManual) || mustUse)
if (Service.Config.GetValue(PluginConfigBool.UseAOEAction)
&& Service.Config.GetValue(PluginConfigBool.UseAOEWhenManual) || mustUse)
{
if (GetMostObjects(TargetFilterFuncEot(DataCenter.HostileTargets, mustUse), aoeCount).Contains(b))
{
Expand Down Expand Up @@ -361,13 +362,13 @@ private bool TargetSelf(bool mustUse, int aoeCount)
//not use when aoe.
if (DataCenter.IsManual)
{
if (!Service.Config.GetValue(SettingsCommand.UseAOEWhenManual) && !mustUse) return false;
if (!Service.Config.GetValue(PluginConfigBool.UseAOEWhenManual) && !mustUse) return false;
}

var tars = TargetFilter.GetObjectInRadius(TargetFilterFuncEot(DataCenter.HostileTargets, mustUse), EffectRange);
if (tars.Count() < aoeCount) return false;

if (Service.Config.NoNewHostiles && TargetFilter.GetObjectInRadius(DataCenter.AllHostileTargets, EffectRange)
if (Service.Config.GetValue(PluginConfigBool.NoNewHostiles) && TargetFilter.GetObjectInRadius(DataCenter.AllHostileTargets, EffectRange)
.Any(t => t.TargetObject == null)) return false;
}

Expand Down Expand Up @@ -418,7 +419,7 @@ private int CanGetTargetCount(BattleChara target, IEnumerable<BattleChara> canAt
count++;
}
}
if (Service.Config.NoNewHostiles)
if (Service.Config.GetValue(PluginConfigBool.NoNewHostiles))
{
if (DataCenter.AllHostileTargets.Where(t => t.TargetObject == null)
.Any(t => CanGetTarget(target, t))) return 0;
Expand Down Expand Up @@ -506,7 +507,7 @@ bool CheckStatus(BattleChara tar)

if (TargetStatus == null) return true;

return tar.WillStatusEndGCD(GetDotGcdCount?.Invoke() ?? (uint)Service.Config.AddDotGCDCount,
return tar.WillStatusEndGCD(GetDotGcdCount?.Invoke() ?? (uint)Service.Config.GetValue(DataCenter.Job, JobConfigInt.AddDotGCDCount),
0, true, TargetStatus);
}

Expand Down Expand Up @@ -537,10 +538,10 @@ private static bool NoAOE
{
get
{
if (!Service.Config.GetValue(SettingsCommand.UseAOEAction)) return true;
if (!Service.Config.GetValue(PluginConfigBool.UseAOEAction)) return true;

return Service.Config.ChooseAttackMark
&& !Service.Config.CanAttackMarkAOE
return Service.Config.GetValue(PluginConfigBool.ChooseAttackMark)
&& !Service.Config.GetValue(PluginConfigBool.CanAttackMarkAOE)
&& MarkingHelper.HaveAttackChara(DataCenter.HostileTargets);
}
}
Expand Down
12 changes: 6 additions & 6 deletions RotationSolver.Basic/Actions/BaseItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,16 +44,16 @@ public class BaseItem : IBaseItem
/// </summary>
public bool IsEnabled
{
get => !Service.Config.DisabledItems.Contains(ID);
get => !Service.Config.GlobalConfig.DisabledItems.Contains(ID);
set
{
if (value)
{
Service.Config.DisabledItems.Remove(ID);
Service.Config.GlobalConfig.DisabledItems.Remove(ID);
}
else
{
Service.Config.DisabledItems.Add(ID);
Service.Config.GlobalConfig.DisabledItems.Add(ID);
}
}
}
Expand All @@ -63,16 +63,16 @@ public bool IsEnabled
/// </summary>
public bool IsInCooldown
{
get => !Service.Config.NotInCoolDownItems.Contains(ID);
get => !Service.Config.GlobalConfig.NotInCoolDownItems.Contains(ID);
set
{
if (value)
{
Service.Config.NotInCoolDownItems.Remove(ID);
Service.Config.GlobalConfig.NotInCoolDownItems.Remove(ID);
}
else
{
Service.Config.NotInCoolDownItems.Add(ID);
Service.Config.GlobalConfig.NotInCoolDownItems.Add(ID);
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/HealPotionItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public uint MaxHealHp
}
}

protected override bool CanUseThis => Service.Config.UseHealPotions;
protected override bool CanUseThis => Service.Config.GetValue(Configuration.PluginConfigBool.UseHealPotions);

public HealPotionItem(Item item, uint a4 = 65535) : base(item, a4)
{
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver.Basic/Actions/MedicineItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal class MedicineItem : BaseItem
{
private readonly MedicineType _type;

protected override bool CanUseThis => Service.Config.UseTinctures;
protected override bool CanUseThis => Service.Config.GetValue(Configuration.PluginConfigBool.UseTinctures);

public MedicineItem(uint row, MedicineType type, uint a4 = 65535) : base(row, a4)
{
Expand Down
3 changes: 3 additions & 0 deletions RotationSolver.Basic/Configuration/Configs.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ public enum PluginConfigInt : byte
[Default(0)] ActionSequencerIndex,
[Default(0)] PoslockModifier,
[Default(0, 0, 10000)] LessMPNoRaise,

[Default(2, 0, 5)] KeyBoardNoiseMin,
[Default(3)] KeyBoardNoiseMax,

Expand Down Expand Up @@ -299,6 +300,8 @@ public enum PluginConfigBool : byte
[Default(false)] TargetAllForFriendly,
[Default(false)] ShowCooldownWindow,

[Default(true)] RecordCastingArea,

[Default(true)] AutoOpenChest,
[Default(true)] AutoCloseChestWindow,
}
Expand Down
Loading

0 comments on commit edb3187

Please sign in to comment.