a game about throwing hammers made for the github game off
Diffstat (limited to 'ui/cfg.gd')
-rw-r--r--ui/cfg.gd18
1 files changed, 18 insertions, 0 deletions
diff --git a/ui/cfg.gd b/ui/cfg.gd
new file mode 100644
index 0000000..87e6f32
--- /dev/null
+++ b/ui/cfg.gd
@@ -0,0 +1,18 @@
+extends ColorRect
+
+signal close
+
+@export var focus: Control
+
+func open() -> void:
+ show()
+ focus.button.grab_focus()
+
+func _input(event: InputEvent) -> void:
+ if visible and event is InputEventKey and event.keycode == KEY_ESCAPE:
+ close.emit()
+ hide()
+
+func _on_exit_pressed() -> void:
+ close.emit()
+ hide()