forked from unfa/liblast
Refactored Menu state and added states for typing or AFK in the Enum
parent
4ec9f7974c
commit
53c8ee86fd
12
Game/Main.gd
12
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
|
||||
|
|
Loading…
Reference in New Issue