|
1234567891011121314151617181920212223242526 |
- extends VBoxContainer
- class_name ChoicesBox
-
- signal choice_made
-
- export var button_template : PackedScene
-
- func on_choice_made(marker):
- emit_signal("choice_made", marker)
-
- func on_choices(choices_list):
- show()
- for choice in choices_list:
- var choiceButton = button_template.instance()
- choiceButton.text = choice["text"]
- choiceButton.connect("pressed", self, "on_choice_made", [choice])
- add_child(choiceButton)
- var res = yield(self, "choice_made")
- hide()
-
- clear()
- return res
-
- func clear():
- for child in get_children():
- child.queue_free()
|