aboutsummaryrefslogtreecommitdiff
path: root/logic/popup_list.gd
blob: 1dd156c081e18154a860ca1fba3bd3e435c60221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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)