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.gd18
1 files changed, 9 insertions, 9 deletions
diff --git a/client/gui/menus/game.gd b/client/gui/menus/game.gd
index c742796c..5379d32d 100644
--- a/client/gui/menus/game.gd
+++ b/client/gui/menus/game.gd
@@ -1,5 +1,5 @@
# Hurry Curry! - a game about cooking
-# Copyright (C) 2025 Hurry Curry! contributors
+# Copyright (C) 2026 Hurry Curry! Contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
@@ -17,6 +17,7 @@ extends Menu
class_name GameMenu
@onready var game: Game = $Game
+@onready var overlays: Overlays = $Overlays
@onready var popup_message: PopupMessage = $Overlays/PopupMessage
@onready var chat_preview: ChatPreview = $Overlays/ChatPreview
@onready var pinned_items: PinnedItemMessages = $Overlays/PinnedMessages
@@ -25,7 +26,6 @@ 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", self, func (_a): update_mouse_capture())
func _input(_event):
if Input.is_action_just_pressed("ui_menu"):
@@ -59,12 +59,16 @@ func get_shot_path(template: String) -> String:
var filename = template % Time.get_datetime_string_from_system()
return "%s/%s" % [path, filename]
+func _menu_open():
+ await super()
+ Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
+
func _menu_cover(state):
super(state)
+ overlays.visible = not state
game.mp.send_idle(state)
- game.follow_camera.disable_input_menu = state
- game.follow_camera.update_disable_input()
- update_mouse_capture()
+ game.follow_camera._disable_input = state
+ Input.mouse_mode = Input.MOUSE_MODE_CAPTURED if not covered else Input.MOUSE_MODE_VISIBLE
func _menu_exit():
await super()
@@ -72,10 +76,6 @@ func _menu_exit():
func _menu_music(): Sound.set_music(null)
-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
Sound.play_click()