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
|
|
|
|
|
|
|
|
2020-02-11 20:15:29 +01:00
|
|
|
# warning-ignore:unused_signal
|
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:
|
2020-02-11 20:36:06 +01:00
|
|
|
# warning-ignore:return_value_discarded
|
2020-02-08 16:36:06 +01:00
|
|
|
list.connect("demo_selected", self, "set_demo_path")
|
2020-02-11 20:36:06 +01:00
|
|
|
# warning-ignore:return_value_discarded
|
2020-02-08 16:36:06 +01:00
|
|
|
list.connect("item_activated", self, "emit_signal", ["demo_requested"])
|
2020-02-11 20:36:06 +01:00
|
|
|
# warning-ignore:return_value_discarded
|
2020-02-08 16:36:06 +01:00
|
|
|
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
|