mirror of
https://github.com/Ottermandias/Glamourer.git
synced 2026-02-23 07:57:46 +01:00
Add NPC appearance tab.
This commit is contained in:
parent
4b242bb3cf
commit
0c1dd50890
18 changed files with 684 additions and 35 deletions
|
|
@ -47,9 +47,15 @@ public static class UiHelpers
|
|||
|
||||
public static bool DrawCheckbox(string label, string tooltip, bool value, out bool on, bool locked)
|
||||
{
|
||||
using var disabled = ImRaii.Disabled(locked);
|
||||
var ret = ImGuiUtil.Checkbox(label, string.Empty, value, v => value = v);
|
||||
ImGuiUtil.HoverTooltip(tooltip);
|
||||
bool ret;
|
||||
using (var disabled = ImRaii.Disabled(locked))
|
||||
{
|
||||
ret = ImGuiUtil.Checkbox("##" + label, string.Empty, value, v => value = v);
|
||||
}
|
||||
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted(label);
|
||||
ImGuiUtil.HoverTooltip(tooltip, ImGuiHoveredFlags.AllowWhenDisabled);
|
||||
on = value;
|
||||
return ret;
|
||||
}
|
||||
|
|
@ -58,7 +64,6 @@ public static class UiHelpers
|
|||
out bool newApply, bool locked)
|
||||
{
|
||||
var flags = (sbyte)(currentApply ? currentValue ? 1 : -1 : 0);
|
||||
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemInnerSpacing);
|
||||
using (_ = ImRaii.Disabled(locked))
|
||||
{
|
||||
if (new TristateCheckbox(ColorId.TriStateCross.Value(), ColorId.TriStateCheck.Value(), ColorId.TriStateNeutral.Value()).Draw(
|
||||
|
|
@ -80,7 +85,8 @@ public static class UiHelpers
|
|||
|
||||
ImGuiUtil.HoverTooltip($"This attribute will be {(currentApply ? currentValue ? "enabled." : "disabled." : "kept as is.")}");
|
||||
|
||||
ImGui.SameLine();
|
||||
ImGui.SameLine(0, ImGui.GetStyle().ItemInnerSpacing.X);
|
||||
ImGui.AlignTextToFramePadding();
|
||||
ImGui.TextUnformatted(label);
|
||||
|
||||
return (currentValue != newValue, currentApply != newApply);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue