diff options
| author | dam <dam@gudinoff> | 2022-01-09 01:25:55 +0000 |
|---|---|---|
| committer | dam <dam@gudinoff> | 2022-01-09 01:25:55 +0000 |
| commit | 5ba40857cdc770841d216a27e2a9e8bb3ebf3186 (patch) | |
| tree | 2212f9685067270285265c81208fd5122a760d5d /logic/popup_list.gd | |
| parent | 431f042390ad36297a5ec986772c77da23b7fb67 (diff) | |
| download | surgery-log-5ba40857cdc770841d216a27e2a9e8bb3ebf3186.tar.zst surgery-log-5ba40857cdc770841d216a27e2a9e8bb3ebf3186.zip | |
Split touch logic from database. Prototype of popup with list of options.
Diffstat (limited to 'logic/popup_list.gd')
| -rw-r--r-- | logic/popup_list.gd | 24 |
1 files changed, 24 insertions, 0 deletions
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) + + |
