20 lines
591 B
GDScript
20 lines
591 B
GDScript
extends VBoxContainer
|
|
|
|
var _custom_button = preload("res://UI/LimbButton.tscn")
|
|
|
|
onready var delete = get_node("Delete")
|
|
|
|
|
|
# Called when the node enters the scene tree for the first time.
|
|
func _ready():
|
|
for entry in BodyPartLoader.bodyparts:
|
|
var button = _custom_button.instance()
|
|
button.text = entry
|
|
add_child(button)
|
|
button.connect("pressed", get_parent().get_parent().get_parent(), "body_part_chosen", [button.text])
|
|
|
|
delete.connect("pressed", get_parent().get_parent().get_parent(), "delete_body_part")
|
|
|
|
func button_pressed(params):
|
|
emit_signal("choose_bodypart", params[0])
|