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

Commit

Permalink
fix: action list drawing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Feb 29, 2024
1 parent 1884b1f commit 74e2afe
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<TargetFramework>net7.0-windows</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Authors>ArchiTed</Authors>
<Version>4.1.2</Version>
<Version>4.1.2.1</Version>
<PlatformTarget>x64</PlatformTarget>
<Platforms>AnyCPU</Platforms>
<LangVersion>latest</LangVersion>
Expand Down
4 changes: 2 additions & 2 deletions Resources/RotationSolverRecord.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"ClickingCount": 88666,
"SayingHelloCount": 113,
"ClickingCount": 88749,
"SayingHelloCount": 115,
"SaidUsers": []
}
11 changes: 11 additions & 0 deletions RotationSolver.Basic/Helpers/ActionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,15 @@ internal static byte GetCoolDownGroup(this Action action)
if (group == 0) group = GCDCooldownGroup;
return group;
}

internal static bool IsInJob(this Action i)
{
var cate = i.ClassJobCategory.Value;
if (cate != null)
{
var inJob = (bool?)cate.GetType().GetProperty(DataCenter.Job.ToString())?.GetValue(cate);
if (inJob.HasValue && !inJob.Value) return false;
}
return true;
}
}
11 changes: 1 addition & 10 deletions RotationSolver.Basic/Rotations/CustomRotation_Actions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,16 +137,7 @@ static partial void ModifySprintPvP(ref ActionSetting setting)
/// </summary>
public virtual IAction[] AllActions =>
[
.. AllBaseActions.Where(i =>
{
var cate = i.Action.ClassJobCategory.Value;
if (cate != null)
{
var inJob = (bool?)cate.GetType().GetProperty(DataCenter.Job.ToString())?.GetValue(cate);
if (inJob.HasValue && !inJob.Value) return false;
}
return true;
}),
.. AllBaseActions.Where(i => i.Action.IsInJob()),
.. Medicines.Where(i => i.HasIt),
.. MpPotions.Where(i => i.HasIt),
.. HpPotions.Where(i => i.HasIt),
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/ConditionDrawer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public static void ActionSelectorPopUp(string popUpId, CollapsingHeaderGroup gro

group.ClearCollapsingHeader();

foreach (var pair in RotationUpdater.GroupActions(rotation.AllBaseActions)!)
foreach (var pair in RotationUpdater.GroupActions(rotation.AllBaseActions.Where(i => i.Action.IsInJob()))!)
{
group.AddCollapsingHeader(() => pair.Key, () =>
{
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/UI/RotationConfigWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -774,7 +774,7 @@ void Down()
(Down, [VirtualKey.DOWN]));
var time = timeLineItem.Time;
if (ConditionDrawer.DrawDragFloat(ConfigUnitType.Seconds, $"Time##Time{timeLineItem.GetHashCode()}", ref time))
if (ConditionDrawer.DrawDragFloat(ConfigUnitType.Seconds, $" ##Time{timeLineItem.GetHashCode()}", ref time))
{
timeLineItem.Time = time;
}
Expand Down

0 comments on commit 74e2afe

Please sign in to comment.