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

Commit

Permalink
fix: add condition target name.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Oct 26, 2023
1 parent 502ce8c commit 54099e0
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 2 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": 19146,
"ClickingCount": 21505,
"SaidUsers": []
}
10 changes: 10 additions & 0 deletions RotationSolver.Basic/Configuration/Conditions/TargetCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,15 @@ public override bool IsTrueInside(ICustomRotation rotation)
case TargetConditionType.MP:
result = tar.CurrentMp > GCD;
break;

case TargetConditionType.TargetName:
if (string.IsNullOrEmpty(CastingActionName))
{
result = false;
break;
}
result = tar.Name.TextValue == CastingActionName;
break;
}

return Condition ? !result : result;
Expand All @@ -125,4 +134,5 @@ internal enum TargetConditionType : byte
TimeToKill,
HP,
MP,
TargetName,
}
1 change: 1 addition & 0 deletions RotationSolver/Localization/EnumTranslations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ internal static class EnumTranslations
TargetConditionType.TimeToKill => LocalizationManager.RightLang.TargetConditionType_TimeToKill,
TargetConditionType.HP => LocalizationManager.RightLang.TargetConditionType_HP,
TargetConditionType.MP => LocalizationManager.RightLang.TargetConditionType_MP,
TargetConditionType.TargetName => LocalizationManager.RightLang.TargetConditionType_TargetName,
_ => string.Empty,
};

Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Localization.json
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,7 @@
"TargetConditionType_CastingActionTimeUntil": "Casting Action Time Until",
"TargetConditionType_HP": "HP",
"TargetConditionType_MP": "MP",
"TargetConditionType_TargetName": "Target Name",
"DescType_BurstActions": "Burst Actions",
"DescType_MoveForwardGCD": "Move Forward GCD",
"DescType_HealAreaGCD": "Area Healing GCD",
Expand Down
1 change: 1 addition & 0 deletions RotationSolver/Localization/Strings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,7 @@ internal class Strings
public string TargetConditionType_CastingActionTimeUntil { get; set; } = "Casting Action Time Until";
public string TargetConditionType_HP { get; set; } = "HP";
public string TargetConditionType_MP { get; set; } = "MP";
public string TargetConditionType_TargetName { get; set; } = "Target Name";

#endregion

Expand Down
15 changes: 14 additions & 1 deletion RotationSolver/UI/ConditionDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -719,6 +719,7 @@ private static void DrawAfter(this TargetCondition targetCondition, ICustomRotat
case TargetConditionType.IsBoss:
case TargetConditionType.InCombat:
case TargetConditionType.CastingAction:
case TargetConditionType.TargetName:
combos = new string[]
{
LocalizationManager.RightLang.ActionSequencer_Is,
Expand Down Expand Up @@ -833,7 +834,7 @@ void DrawStatusIcon()
case TargetConditionType.CastingAction:
ImGui.SameLine();
ImGuiHelper.SetNextWidthWithName(targetCondition.CastingActionName);
ImGui.InputText($"Ability name##CastingActionName{targetCondition.GetHashCode()}", ref targetCondition.CastingActionName, 128);
ImGui.InputText($"Ability Name##CastingActionName{targetCondition.GetHashCode()}", ref targetCondition.CastingActionName, 128);
break;

case TargetConditionType.CastingActionTimeUntil:
Expand All @@ -848,6 +849,18 @@ void DrawStatusIcon()
ImGui.SetNextItemWidth(Math.Max(150 * ImGuiHelpers.GlobalScale, ImGui.CalcTextSize(targetCondition.GCD.ToString()).X));
ImGui.DragInt($"##HPorMP{targetCondition.GetHashCode()}", ref targetCondition.GCD, .1f);
break;

case TargetConditionType.TimeToKill:
ImGui.SameLine();
ImGui.SetNextItemWidth(Math.Max(150 * ImGuiHelpers.GlobalScale, ImGui.CalcTextSize(targetCondition.DistanceOrTime.ToString()).X));
ImGui.DragFloat($"##TimeToKill{targetCondition.GetHashCode()}", ref targetCondition.DistanceOrTime, .1f);
break;

case TargetConditionType.TargetName:
ImGui.SameLine();
ImGuiHelper.SetNextWidthWithName(targetCondition.CastingActionName);
ImGui.InputText($"Name##TargetName{targetCondition.GetHashCode()}", ref targetCondition.CastingActionName, 128);
break;
}
}
#endregion
Expand Down

0 comments on commit 54099e0

Please sign in to comment.