aboutsummaryrefslogtreecommitdiff
path: root/client/gui/menus/game.gd
diff options
context:
space:
mode:
Diffstat (limited to 'client/gui/menus/game.gd')
-rw-r--r--client/gui/menus/game.gd11
1 files changed, 11 insertions, 0 deletions
diff --git a/client/gui/menus/game.gd b/client/gui/menus/game.gd
index a730e385..0466d287 100644
--- a/client/gui/menus/game.gd
+++ b/client/gui/menus/game.gd
@@ -25,6 +25,8 @@ func _ready():
get_tree().get_root().go_back_requested.connect(open_ingame_menu)
super()
transition.set_loading_text(tr("c.menu.game.connecting"))
+
+ Settings.hook_changed_init("gameplay.first_person", "mouse_lock", func (_a): update_mouse_capture())
func _input(_event):
if Input.is_action_just_pressed("ui_menu"):
@@ -55,8 +57,17 @@ func get_shot_path(template: String) -> String:
return "%s/%s" % [path, filename]
func _menu_cover(state):
+ super(state)
game.follow_camera.disable_input_menu = state
game.follow_camera.update_disable_input()
+ update_mouse_capture()
+func _menu_exit():
+ super()
+ Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
+
+func update_mouse_capture():
+ var cap = Settings.read("gameplay.first_person") and not covered
+ Input.mouse_mode = Input.MOUSE_MODE_CAPTURED if cap else Input.MOUSE_MODE_VISIBLE
func open_ingame_menu():
if popup != null: return