bodypartfighter/BodyConfig/LoadBodyParts.gd

20 lines
591 B
GDScript3
Raw Normal View History

2020-02-01 12:45:12 +01:00
extends VBoxContainer
2020-02-02 14:54:22 +01:00
var _custom_button = preload("res://UI/LimbButton.tscn")
2020-02-01 12:45:12 +01:00
2020-02-01 15:47:56 +01:00
onready var delete = get_node("Delete")
2020-02-01 12:45:12 +01:00
# Called when the node enters the scene tree for the first time.
func _ready():
for entry in BodyPartLoader.bodyparts:
2020-02-02 14:54:22 +01:00
var button = _custom_button.instance()
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 15:47:56 +01:00
delete.connect("pressed", get_parent().get_parent().get_parent(), "delete_body_part")
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])