frame-of-mind/src/ui/prompter/prompter.gd

15 lines
382 B
GDScript

extends Control
## Provides methods and pre-instantiated prompts that can be easily arranged.
class_name Prompter
signal action_performed(action: String)
var _prompts : Dictionary[StringName, Control] = {}
func _ready() -> void:
for prompt in get_tree().get_nodes_in_group("prompts"):
_prompts[prompt.name] = prompt
prompt.get_parent().remove_child(prompt)
print(prompt)