SaintsField
SaintsField copied to clipboard
An attribute to Show/Hide/Enable/Disable an entire LayoutGroup
I tried a few combination but they don't seem to work
No at this point as ShowIf is only a PropertyDrawer which only works on a single field.
np
Hi,
this feature has been implemented in 3.7.0
using SaintsField.Playa;
public bool editableMain;
public bool visibleMain;
[LayoutEnableIf(nameof(editableMain))]
[LayoutShowIf(nameof(visibleMain))]
[LayoutStart("Main", ELayout.FoldoutBox)]
public bool editable1;
public bool visible1;
[LayoutEnableIf(nameof(editable1))]
[LayoutShowIf(nameof(visible1))]
[LayoutStart("./1", ELayout.FoldoutBox, marginBottom: 10)]
public int int1;
public string string1;
[LayoutStart("..", ELayout.FoldoutBox)]
public bool editable2;
public bool visible2;
[LayoutEnableIf(nameof(editable2))]
[LayoutShowIf(nameof(visible2))]
[LayoutStart("./2", ELayout.FoldoutBox)]
public int int2;
public string string2;
Fantastic, I just removed a trove of individual HideIf with one for layout. So useful.
I noticed that the lists ident well in your example. Is this because UITK moved the fold triangle inside the block? I suppose proper indentation in IMGUI is still not possible.
Yes, UI Toolkit got this issue fixed in 3.4.11, which has not been implemented in IMGUI yet. It'll be processed in the feature (but not sure when tho... depending on how much free time I got...)