Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow custom property subgroups to be more deeply nested in the inspector #11027

Closed
Oddness-1 opened this issue Oct 25, 2024 · 2 comments
Closed

Comments

@Oddness-1
Copy link

Oddness-1 commented Oct 25, 2024

Describe the project you are working on

A 2D game about vampires

Describe the problem or limitation you are having in your project

You can only nest inspector groups as follows:

Category -> Group -> Subgroup

Describe the feature / enhancement and how it helps to overcome the problem or limitation

Add a depth parameter to Subgroup declaration, and allow the user to manually add additional nesting. If it's visually unappealing, then that's on us. If no parameter is provided, a new group, or new category is added, then collapse the state back to the current implementation (Three levels of Nesting).

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Do what you're doing, but account for more deeply nested Nodes in the Inspector. Take the user-provided parameter, and search to the appropriate parent-child depth.

Alternately, be a little more sophisticated about it, and use dedicated attributes, or additional language in the _GetPropertyList dictionaries, to track and manipulate the nesting depth.

new Dictionary
{
      {"name", "Your Subgroup" },
      {"type", (int)Variant.Type.Nil },
      {"usage",(int)PropertyUsageFlags.Subgroup },
      {"hint", (int)PropertyHint.Depth },
      {"hint_string", "2" }
}

I suppose that my proposal would suggest that you support the above as an option, but if you can do this, then you probably just make them all a 'Group', rather than having 'Group' and 'Subgroup', and then just let the user define the depth of nesting.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No.

Is there a reason why this should be core and not an add-on in the asset library?

In this case, less isn't more.

@Calinou Calinou changed the title More Deeply Nested Subgroups Allow property subgroups to be more deeply nested Oct 25, 2024
@Calinou Calinou changed the title Allow property subgroups to be more deeply nested Allow custom property subgroups to be more deeply nested in the inspector Oct 25, 2024
@Oddness-1
Copy link
Author

Scratch this. I'm incredibly stupid. :)

The following works perfectly well:

        builder.AddGroup("Subsurface");
        builder.AddSubgroup("Strangers");
        builder.Add<Texture2D>("Stranger Eye Hole (Filled)");
        builder.Add<Texture2D>("Stranger Eye Hole (Open)");
        builder.Add<Texture2D>("Stranger Eye Ring (Fleshy)");
        builder.Add<Texture2D>("Stranger Eye Ring (Metallic)");
        builder.Add<Texture2D>("Stranger Eyeball");
        builder.Add<Texture2D>("Stranger Iris");
        builder.Add<Texture2D>("Stranger Pupil");
        builder.AddSubgroup("Strangers/Structure"); <-- This bit here does exactly what I described through naming.
        builder.Add<Texture2D>("Subsurface Background");

Disregard my helper methods for managing Inspector properties. The gist of it is that greater depth can already be controlled just by putting an additional slash in the name.

Issue Closed.

@Oddness-1
Copy link
Author

This is already a feature, and nothing needs done. Ma' bad.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants