trimmer
trimmer copied to clipboard
Variant that has child looks weird
In ProfileEditor, changing the order of iterating child first than variant seems working
From this
protected void OptionGUIRecursive(Option option, int depth = 0)
{
if (!OptionGUI(option, depth)) return;
if (option.IsDefaultVariant) {
if (!OptionGUI(option, depth + 1, showDefaultVariant: true)) return;
}
foreach (var variant in option.Variants) {
OptionGUIRecursive(variant, depth + 1);
}
foreach (var child in option.Children) {
OptionGUIRecursive(child, depth + 1);
}
}
To this
protected void OptionGUIRecursive(Option option, int depth = 0)
{
if (!OptionGUI(option, depth)) return;
if (option.IsDefaultVariant) {
if (!OptionGUI(option, depth + 1, showDefaultVariant: true)) return;
}
foreach (var child in option.Children) {
OptionGUIRecursive(child, depth + 1);
}
foreach (var variant in option.Variants) {
OptionGUIRecursive(variant, depth + 1);
}
}
It seems variants with children are a bit broken. The child options should be shown as part of the default variant, not a level higher up as they are now and identical to how they are shown for non-default variants.
Ah I see... but functionally, it works... just a little inconvenience