Skip to content

Commit

Permalink
Minor imgui index issue with enum. Not sure exactly what caused it bu…
Browse files Browse the repository at this point in the history
…t ...
  • Loading branch information
isadorasophia committed Aug 7, 2023
1 parent 773b25c commit dc65783
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Murder.Editor/Utilities/Gui/ImGuiHelpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,11 @@ public static (bool modified, int result) DrawEnumField(string id, Type enumType
var values = Enum.GetValues(enumType);

bool modified = ImGui.Combo(id, ref result, fields, fields.Length);
if (result < 0)
{
return (false, 0);
}

return (modified, (int)values.GetValue(result)!);
}

Expand Down

0 comments on commit dc65783

Please sign in to comment.