-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
Add Autoloads to the Scene tree for easier signal connection management #4993
Comments
See also #1694 |
I had a proposal idea about having a "root scene" dock displaying a scene view where the root is a Maybe some of these ideas can be salvaged. |
I like the idea to see singletons in the SceneTreeEditor, I also imagine you can work with singletons almost just like with a regular node, like change properties in Inspector especially exported properties (export var). This could make singletons more reusable — you can use a singleton in other projects without changing the script but still tweak something using export vars |
One thing I am worry about is that in the proposed screenshots it kinda looks like singletons belong to scenes, this can be confusing for new users |
(#6927) Another advantage would be that Autoloads could be directly referenced to nodes that have a |
I like this idea. But also, add a tick box in project settings to do this. Some people don't use autoloads regularly and it would bloat their trees. |
The most interesting application of this to me is the enhancement to the "Connect a Signal" dialog. Being able to connect to an event bus or another type of autoload singleton would save time and reduce the need for small scripts. |
Describe the project you are working on
I have an AudioManager, LevelManager, global Event bus, UnlockablesManager all autoloaded. Some of these (namely the global Event bus) have a lot of signals defined. These signals are connected to and used by a large number of scenes in my game.
Describe the problem or limitation you are having in your project
Not so much a limitation as a difficulty. Global event busses are very commonly used pattern in Godot projects however their major downside is that it can be difficult to tell what they're connecting to and all connections must be manually made in code.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I propose adding a collapsible list of autoloads to the top of the Scene tree. These nodes could be clicked on and signal connections made in the same way you currently can with any child node of your scene.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I propose adding a collapsible list of autoloads to the Scene tree like so:
Signals from these autoloads would work identically to signals from any node in your tree. You click the autoload class, go to the Node tab and connect a signal. An autoloads Node tab would only show connections for the currently loaded Scene.
Scene trees can become quite full in more complex scenes and on larger projects there can be a lot of autoloads, so for this reason I've suggested a collapsible list to easily get the new rows out of sight.
If this enhancement will not be used often, can it be worked around with a few lines of script?
This proposal is commonly worked around with the caveat that it's not quite as intuitive or easy to use as the GUI-based signal system.
Is there a reason why this should be core and not an add-on in the asset library?
I'm not familiar enough with the engine to know if it's possible for this to be added with an add-on. I believe the feature should be core because it leverages existing functionality in a new way to make a common use-case more intuitive.
The text was updated successfully, but these errors were encountered: