Allow transparent nesting templates to simulate inheritance

We’re making a UI heavy app, and as such we want to define UI elements in one place and use them throughout our GUI objects. We can do this pretty well with templates today. However, sometimes I would like to nest templates to avoid duplicate information.

Here’s an example: I want to define a button GUI object. Then define a big version of it (e.g. changing size and corner curving). Finally I want to define a version of the big button with an arrow icon on it.

This can be done right now and results in something like this:

There’s a minor issue with this though where the nesting results in a somewhat messy node structure. This makes it a bit cumbersome to have scripts access nodes as the code needs to take into account a variable nesting depth.

1 Like

This is a question for @Andreas_Tadic to answer. He did the implementation of GUI templates and knows all the ins and outs of the system.

@Eddie_Willman, can you please elaborate what it is you’re looking for in terms of additional api functions / functionality for navigating gui-nodes, which is what I assume you are looking for?

It’s about how the template node and sub-nodes appear where it’s used. In the example above I would prefer if the nested template nodes (right_navigation_button and big_button) wasn’t visible in the hierarchy. That way I could access the button_top node with continue_button/button/button_top even if I later switch continue_button to big_button instead of right_navigation_button.