From 5ba40857cdc770841d216a27e2a9e8bb3ebf3186 Mon Sep 17 00:00:00 2001 From: dam Date: Sun, 9 Jan 2022 01:25:55 +0000 Subject: Split touch logic from database. Prototype of popup with list of options. --- logic/popup_list.gd | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 logic/popup_list.gd (limited to 'logic/popup_list.gd') diff --git a/logic/popup_list.gd b/logic/popup_list.gd new file mode 100644 index 0000000..1dd156c --- /dev/null +++ b/logic/popup_list.gd @@ -0,0 +1,24 @@ +extends Popup + +signal item_selected + +onready var item_list := get_node("list") as TouchItemList + + +func _ready(): + item_list.connect("item_selected", self, "selected") + + +func popup_options(options: Array): + item_list.v_scroll_bar.value = 0.0 + item_list.clear() + for it in options: + item_list.add_item(it) + self.popup_centered_ratio(0.9) + + +func selected(index: int): + self.hide() + emit_signal("item_selected", index) + + -- cgit v1.2.3