2020-02-08 16:36:06 +01:00
|
|
|
class_name DemoPickerUI
|
2020-02-08 22:40:43 +01:00
|
|
|
extends Control
|
2020-02-08 16:36:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
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")
|
|
|
|
list.connect("item_activated", self, "emit_signal", ["demo_requested"])
|
|
|
|
button.connect("pressed", self, "emit_signal", ["demo_requested"])
|
2020-02-08 17:44:54 +01:00
|
|
|
demo_path = list.file_paths[0]
|
2020-02-08 16:36:06 +01:00
|
|
|
|
|
|
|
|
|
|
|
func set_demo_path(value: String) -> void:
|
|
|
|
demo_path = value
|