godot-steering-ai-framework/project/demos/DemoPickerUI.gd
Nathan Lovato 8e04378b1c Refactor and improve the demo picker
Improve the UI styles
Add a button to go back to the demo picker
Simplify the code that handles text
2020-02-08 09:36:06 -06:00

22 lines
581 B
GDScript

class_name DemoPickerUI
extends CenterContainer
signal demo_requested
var demo_path := "" setget set_demo_path
onready var list: ItemList = $VBoxContainer/ItemList
onready var button: Button = $VBoxContainer/Button
func _ready() -> void:
list.connect("demo_selected", self, "set_demo_path")
# I don't emit the demo_path as an argument as I've had type issues doing so
list.connect("item_activated", self, "emit_signal", ["demo_requested"])
button.connect("pressed", self, "emit_signal", ["demo_requested"])
func set_demo_path(value: String) -> void:
demo_path = value