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

Commit

Permalink
fix: changed the order of target conditions.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Nov 4, 2023
1 parent 38f0dfa commit 3f8b454
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 16 deletions.
2 changes: 1 addition & 1 deletion Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"ClickingCount": 54513,
"ClickingCount": 54546,
"SaidUsers": []
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ protected override bool IsTrueInside(ICustomRotation rotation)
break;

case TargetConditionType.Vfx:
foreach (var effect in DataCenter.VfxNewDatas.Reverse())
foreach (var effect in DataCenter.VfxNewData.Reverse())
{
var time = effect.TimeDuration.TotalSeconds;
if (time > DistanceOrTime && time < TimeEnd
Expand All @@ -170,9 +170,9 @@ protected override bool IsTrueInside(ICustomRotation rotation)

internal enum TargetType : byte
{
Target,
HostileTarget,
Player
Player,
Target,
}

internal enum TargetConditionType : byte
Expand Down
4 changes: 2 additions & 2 deletions RotationSolver.Basic/DataCenter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ internal static BattleChara HostileTarget

internal static Queue<MapEffectData> MapEffects { get; } = new(64);
internal static Queue<ObjectEffectData> ObjectEffects { get; } = new(64);
internal static Queue<VfxNewData> VfxNewDatas { get; } = new(64);
internal static Queue<VfxNewData> VfxNewData { get; } = new(64);

/// <summary>
/// This one never be null.
Expand Down Expand Up @@ -476,7 +476,7 @@ internal static void ResetAllRecords()

MapEffects.Clear();
ObjectEffects.Clear();
VfxNewDatas.Clear();
VfxNewData.Clear();
}

internal static void AddDamageRec(float damageRatio)
Expand Down
10 changes: 4 additions & 6 deletions RotationSolver/UI/ConditionDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -747,19 +747,18 @@ private static void DrawAfter(this TargetCondition targetCondition, ICustomRotat

ActionSelectorPopUp(popUpKey, _actionsList, rotation, item => targetCondition.ID = (ActionID)item.ID, () =>
{
if (ImGui.Selectable(LocalizationManager.RightLang.ActionSequencer_Target))
if (ImGui.Selectable(LocalizationManager.RightLang.ActionSequencer_HostileTarget))
{
targetCondition._action = null;
targetCondition.ID = ActionID.None;
targetCondition.TargetType = TargetType.Target;
targetCondition.TargetType = TargetType.HostileTarget;
}


if (ImGui.Selectable(LocalizationManager.RightLang.ActionSequencer_HostileTarget))
if (ImGui.Selectable(LocalizationManager.RightLang.ActionSequencer_Target))
{
targetCondition._action = null;
targetCondition.ID = ActionID.None;
targetCondition.TargetType = TargetType.HostileTarget;
targetCondition.TargetType = TargetType.Target;
}

if (ImGui.Selectable(LocalizationManager.RightLang.ActionSequencer_Player))
Expand All @@ -768,7 +767,6 @@ private static void DrawAfter(this TargetCondition targetCondition, ICustomRotat
targetCondition.ID = ActionID.None;
targetCondition.TargetType = TargetType.Player;
}

});

if (targetCondition._action != null ? targetCondition._action.GetTexture(out var icon) || IconSet.GetTexture(4, out icon)
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/Updaters/TargetUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ private static bool IsCastingAreaVfx()
private static bool IsCastingVfx(Func<string, bool> isVfx)
{
if (isVfx == null) return false;
foreach (var item in DataCenter.VfxNewDatas.Reverse())
foreach (var item in DataCenter.VfxNewData.Reverse())
{
if (item.TimeDuration.TotalSeconds is > 1 and < 5)
{
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/Watcher.cs
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ private static IntPtr ActorVfxNewHandler(string path, IntPtr a2, IntPtr a3, floa
{
if (!path.StartsWith("vfx/common/eff/", StringComparison.OrdinalIgnoreCase))
{
if (DataCenter.VfxNewDatas.Count >= 64)
if (DataCenter.VfxNewData.Count >= 64)
{
DataCenter.VfxNewDatas.TryDequeue(out _);
DataCenter.VfxNewData.TryDequeue(out _);
}

var obj = Svc.Objects.CreateObjectReference(a2);
var effect = new VfxNewData(obj?.ObjectId ?? Dalamud.Game.ClientState.Objects.Types.GameObject.InvalidGameObjectId, path);
DataCenter.VfxNewDatas.Enqueue(effect);
DataCenter.VfxNewData.Enqueue(effect);
#if DEBUG
Svc.Log.Debug(effect.ToString());
#endif
Expand Down

0 comments on commit 3f8b454

Please sign in to comment.