aboutsummaryrefslogtreecommitdiff
path: root/tutorial/popup.gd
diff options
context:
space:
mode:
Diffstat (limited to 'tutorial/popup.gd')
-rw-r--r--tutorial/popup.gd25
1 files changed, 25 insertions, 0 deletions
diff --git a/tutorial/popup.gd b/tutorial/popup.gd
new file mode 100644
index 0000000..1d4c59c
--- /dev/null
+++ b/tutorial/popup.gd
@@ -0,0 +1,25 @@
+extends Label
+class_name TutorialPopup
+
+export var identifier = ""
+
+func _input(event):
+ if not is_visible_in_tree():
+ return
+ if event is InputEventMouseButton:
+ if event.pressed and event.button_index == BUTTON_LEFT:
+ SaveState.tutorial[identifier] = true
+ hide()
+ get_tree().paused = false
+
+func _trigger() -> bool:
+ return false
+func _ready():
+ hide() # like the goblin you are
+
+func _process(delta):
+ if SaveState.tutorial[identifier]:
+ return
+ if _trigger():
+ show()
+ get_tree().paused = true