PartyDamage/ImGuiHelper.cs

30 lines
664 B
C#
Raw Permalink Normal View History

2024-07-25 06:50:32 +00:00
using ImGuiNET;
namespace PartyDamage;
public static class ImGuiHelper {
public static OnDispose? DisabledIf(bool disabled) {
if (disabled) {
ImGui.BeginDisabled();
return new OnDispose(ImGui.EndDisabled);
}
return null;
}
public static OnDispose? DisabledUnless(bool unless) {
return DisabledIf(!unless);
}
2024-07-28 05:16:47 +00:00
public static bool BeginComboVertical(
string label,
string id,
string preview,
float width = -1
) {
ImGui.TextUnformatted(label);
ImGui.SetNextItemWidth(width);
return ImGui.BeginCombo($"##{id}", preview);
}
}