GdlrModuleManager¶
Autoload that mounts, starts, and queries the module graph.
Description¶
Enabling the Godular plugin registers this script as the GdlrModuleManager autoload. Mount the root module once, start it, and then request tree exports from anywhere in the scene tree:
func _ready() -> void:
await GdlrModuleManager.mount(GameModule)
await GdlrModuleManager.start()
var score: CapScore = GdlrModuleManager.request(CapScore)
Editor. When the project setting godular/editor_root_module_path points at a module script, the manager mounts and starts that module inside the editor. Editor tooling can wait for it with editor_await_graph_started().
Tutorials¶
Methods¶
void |
|
void |
start() |
void |
|
void |
|
Signals¶
graph_mounted(graph: GdlrModuleGraph) 🔗
Emitted after mount() compiles the graph.
graph_started(graph: GdlrModuleGraph) 🔗
Emitted after start() enables every module.
Method Descriptions¶
void mount(root_module: Variant) 🔗
Creates a graph from root_module and compiles it. root_module is a module script or a GdlrModuleDefinition. A later call replaces the current graph.
void start() 🔗
Starts the mounted graph. See GdlrModuleGraph.start().
GdlrModuleGraph get_graph() 🔗
Returns the mounted graph, or null before mount().
bool editor_is_graph_ready() 🔗
Returns true when the editor graph is mounted. Editor only.
void editor_await_graph_ready() 🔗
Waits until the editor graph is mounted. Editor only.
void editor_await_graph_started() 🔗
Waits until the editor graph is started. Editor only.
Variant request(capability: Variant, consumer_node: Node = null) 🔗
Returns the value of a tree export. See GdlrModuleGraph.request(). Fails before mount().