-
Notifications
You must be signed in to change notification settings - Fork 0
/
Popup.gd
28 lines (20 loc) · 819 Bytes
/
Popup.gd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
extends PopupPanel
var currentOkConnection = {}
func _ready() -> void:
pass
func update_content(data : Dictionary):
get_node("%Image").texture = load(data["Image"])
get_node("%Title").text = data["Title"]
get_node("%Message").bbcode_text = data["Message"]
get_node("%NoThanks").visible = data["NoThanks"]
if currentOkConnection.has("node"):
get_node("%OK").disconnect("pressed", currentOkConnection["node"], currentOkConnection["func"])
currentOkConnection = {}
if data.has("callFunc"):
currentOkConnection["node"] = data["callNode"]
currentOkConnection["func"] = data["callFunc"]
var _result = get_node("%OK").connect("pressed", data["callNode"], data["callFunc"], [data["args"]])
func _on_NoThanks_pressed() -> void:
self.visible = false
func _on_OK_pressed() -> void:
self.visible = false