From 53c8ee86fd6fb82a8b692bb25f5991c0b9bc628e Mon Sep 17 00:00:00 2001 From: unfa Date: Thu, 3 Jun 2021 19:03:43 +0200 Subject: [PATCH] Refactored Menu state and added states for typing or AFK in the Enum --- Game/Main.gd | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Game/Main.gd b/Game/Main.gd index 37fec47..817026f 100644 --- a/Game/Main.gd +++ b/Game/Main.gd @@ -1,18 +1,18 @@ extends Node -enum Gamemode {IN_MENU, PLAYING} +enum GameFocus {IN_MENU, PLAYING, TYPING, AFK} -var mode = Gamemode.IN_MENU +var mode = GameFocus.IN_MENU func _input(event) -> void: if Input.is_action_just_pressed("ui_cancel"): - if mode == Gamemode.PLAYING: + if mode == GameFocus.PLAYING: Input.set_mouse_mode(Input.MOUSE_MODE_VISIBLE) $CanvasLayer/GUI.show() $Level/Player.input_active = false - mode = Gamemode.IN_MENU - elif mode == Gamemode.IN_MENU: + mode = GameFocus.IN_MENU + elif mode == GameFocus.IN_MENU: Input.set_mouse_mode(Input.MOUSE_MODE_CAPTURED) $CanvasLayer/GUI.hide() $Level/Player.input_active = true - mode = Gamemode.PLAYING + mode = GameFocus.PLAYING