bodypartfighter/BodyConfig/LoadBodyParts.gd

15 lines
391 B
GDScript3
Raw Normal View History

2020-02-01 12:45:12 +01:00
extends VBoxContainer
# Called when the node enters the scene tree for the first time.
func _ready():
for entry in BodyPartLoader.bodyparts:
var button = Button.new()
2020-02-01 13:44:14 +01:00
button.text = entry
add_child(button)
button.connect("pressed", get_parent().get_parent().get_parent(), "body_part_chosen", [button.text])
2020-02-01 12:45:12 +01:00
2020-02-01 13:44:14 +01:00
func button_pressed(params):
emit_signal("choose_bodypart", params[0])