Allow restricting only the options forcing redraw in customize drawer and do this for screen actors.

This commit is contained in:
Ottermandias 2023-07-14 20:33:31 +02:00
parent 506f4b887e
commit 27281bedfb
7 changed files with 63 additions and 30 deletions

View file

@ -55,18 +55,23 @@ public static class UiHelpers
return ret;
}
public static DataChange DrawMetaToggle(string label, string tooltip, bool currentValue, bool currentApply, out bool newValue, out bool newApply,
public static DataChange DrawMetaToggle(string label, string tooltip, bool currentValue, bool currentApply, out bool newValue,
out bool newApply,
bool locked)
{
var flags = currentApply ? currentValue ? 3 : 0 : 2;
bool ret;
var flags = currentApply ? currentValue ? 3 : 0 : 2;
bool ret;
using var style = ImRaii.PushStyle(ImGuiStyleVar.ItemSpacing, ImGui.GetStyle().ItemInnerSpacing);
using (var disabled = ImRaii.Disabled(locked))
{
ret = ImGui.CheckboxFlags(label, ref flags, 3);
ret = ImGui.CheckboxFlags("##" + label, ref flags, 3);
}
ImGuiUtil.HoverTooltip(tooltip);
ImGui.SameLine();
ImGui.TextUnformatted(label);
if (ret)
{
(newValue, newApply, var change) = (currentValue, currentApply) switch