15 lines
553 B
GDScript3
15 lines
553 B
GDScript3
|
|
extends Node
|
||
|
|
|
||
|
|
@export var avatars: Node2D
|
||
|
|
|
||
|
|
# Called when the node enters the scene tree for the first time.
|
||
|
|
func _ready() -> void:
|
||
|
|
var nodes := get_children()
|
||
|
|
for node in nodes:
|
||
|
|
if node is TwitchCommand:
|
||
|
|
var cmd: TwitchCommand = node
|
||
|
|
if self.has_method("_handle_%s" % cmd.name.to_camel_case()):
|
||
|
|
cmd.command_received.connect(Callable(self, "_handle_%s" % cmd.name.to_camel_case()))
|
||
|
|
if self.has_method("_cooldown_%s" % cmd.name.to_camel_case()):
|
||
|
|
cmd.command_received.connect(Callable(self, "_cooldown_%s" % cmd.name.to_camel_case()))
|