Allow editor to show children of custom class, tool scripts that add child nodes on _ready() #9238
data-overflow
started this conversation in
Editor
Replies: 1 comment
-
If you set their About the signals in the error log you show... I do not know. At least I can tell you that in tool scripts I'm used to check if a signal is connected before conecting it, and the equivalent for disconnection, that is because the signal connections would also get saved. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hi! So I'm working at an app with Godot that heavily requires the use of UI. Almost all my UI elements require margins, paddings, panels or layout to so make things easier I wanted to create a node that stacks all these functions together into a single node.
I want a node which can do this to make my development time faster and reduce the complexity of my deeply nested scene tree.
So my approach was to create a script (extends MarginContainer for margin) with the
class_name
andtool
keyword so that it shows up in the nodes list and allows me to preview the changes live on the editor. On the_ready()
function, I'm adding aPanel
and aMarginContainer
as its child (for padding). The margins work as expected -Any children I add to this node via the editor makes it its immediate children only. But now for the padding to work I need the nodes I add to this to automatically move to be the children of the
MarginContainer
instead. I did this using the following script -But then I faced a new problem. When I add nodes to my Div (custom node) it immediately becomes the child of the MarginContainer but also makes it inaccessible from the editor.
Error Log
Is it possible to include this feature to show editor added children nodes to tool scripts?
Beta Was this translation helpful? Give feedback.
All reactions