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

Commit

Permalink
feat: add disable action sequence.
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed May 9, 2023
1 parent b29999b commit dce3d5a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 14 additions & 2 deletions RotationSolver/UI/RotationConfigWindow_Action.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,22 @@ private static void DrawActionSequencerCondition()
var set = ActionSequencerUpdater.RightSet;
if (set == null) return;

if (!set.Conditions.TryGetValue(ActiveAction.ID, out var conditionSet))
ConditionSet conditionSet;
if (ActionSequencerUpdater.IsDisableCondition)
{
conditionSet = set.Conditions[ActiveAction.ID] = new ConditionSet();
if (!set.DiableConditions.TryGetValue(ActiveAction.ID, out conditionSet))
{
conditionSet = set.DiableConditions[ActiveAction.ID] = new ConditionSet();
}
}
else
{
if (!set.Conditions.TryGetValue(ActiveAction.ID, out conditionSet))
{
conditionSet = set.Conditions[ActiveAction.ID] = new ConditionSet();
}
}


conditionSet?.Draw(rotation, ActiveAction.IsActionSequencer);
}
Expand Down
4 changes: 4 additions & 0 deletions RotationSolver/Updaters/ActionSequencerUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ internal class ActionSequencerUpdater

public static string[] ConditionSetsName => _conditionSet?.Select(s => s.Name).ToArray() ?? Array.Empty<string>();

public static bool IsDisableCondition = false;

public static void UpdateActionSequencerAction()
{
if (_conditionSet == null) return;
Expand Down Expand Up @@ -116,6 +118,8 @@ public static void DrawHeader()

ImGui.Combo("##MajorConditionCombo", ref Service.Config.ActionSequencerIndex, combos, combos.Length);

ImGui.Checkbox("Is Disabled Condition", ref IsDisableCondition);

if (hasSet)
{
ImGui.SameLine();
Expand Down

0 comments on commit dce3d5a

Please sign in to comment.