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

Commit

Permalink
fix: fixed with DrawByteEnum
Browse files Browse the repository at this point in the history
  • Loading branch information
ArchiDog1998 committed Apr 28, 2023
1 parent 6419a09 commit d8a3986
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 7 deletions.
18 changes: 17 additions & 1 deletion Resources/AnimationLockTime.json
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
{}
{
"4868": 2.1,
"7503": 0.1,
"7505": 0.6,
"7506": 0.6,
"7507": 0.6,
"7509": 0.6,
"7510": 0.1,
"7511": 0.1,
"7517": 0.6,
"7518": 0.6,
"7561": 0.6,
"7562": 0.6,
"16524": 0.1,
"16525": 0.1,
"16527": 0.6
}
2 changes: 1 addition & 1 deletion RotationSolver/ActionSequencer/ActionCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void Draw(ICustomRotation combo, bool isActionSequencer)

ImGui.SameLine();

ConditionHelper.DrawIntEnum($"##Category{GetHashCode()}", ref ActionConditionType, EnumTranslations.ToName);
ConditionHelper.DrawByteEnum($"##Category{GetHashCode()}", ref ActionConditionType, EnumTranslations.ToName);

var condition = Condition ? 1 : 0;
var combos = new string[0];
Expand Down
6 changes: 3 additions & 3 deletions RotationSolver/ActionSequencer/ConditionHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,16 @@ public static void CheckMemberInfo<T>(ICustomRotation rotation, string name, ref
}
}

public static void DrawIntEnum<T>(string name, ref T value, Func<T, string> function) where T : struct, Enum
public static void DrawByteEnum<T>(string name, ref T value, Func<T, string> function) where T : struct, Enum
{
var type = (int)(object)value;
var type = (int)(byte)(object)value;
var names = Enum.GetValues<T>().Select(function).ToArray();
//ImGui.SetNextItemWidth(100);
ImGui.SetNextItemWidth(Math.Max(80, ImGui.CalcTextSize(name).X + 30));

if (ImGui.Combo(name, ref type, names, names.Length))
{
value = (T)(object)type;
value = (T)(object)(byte)type;
}
}

Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/ActionSequencer/RotationCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public void Draw(ICustomRotation rotation, bool isActionSequencer)
return;
}

ConditionHelper.DrawIntEnum($"##Category{GetHashCode()}", ref ComboConditionType, EnumTranslations.ToName);
ConditionHelper.DrawByteEnum($"##Category{GetHashCode()}", ref ComboConditionType, EnumTranslations.ToName);

switch (ComboConditionType)
{
Expand Down
2 changes: 1 addition & 1 deletion RotationSolver/ActionSequencer/TargetCondition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ public void Draw(ICustomRotation combo, bool isActionSequencer)
}

ImGui.SameLine();
ConditionHelper.DrawIntEnum($"##Category{GetHashCode()}", ref TargetConditionType, EnumTranslations.ToName);
ConditionHelper.DrawByteEnum($"##Category{GetHashCode()}", ref TargetConditionType, EnumTranslations.ToName);

var condition = Condition ? 1 : 0;
var combos = new string[0];
Expand Down

0 comments on commit d8a3986

Please sign in to comment.