Skip to content

Add Autoloads to the Scene tree for easier signal connection management #4993

@Flynsarmy

Description

@Flynsarmy

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:
GlobalEventBus

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions