fix #115: when pause is resumed, it now only captures the mouse while player is on top of the focus stack.

This commit is contained in:
betalars 2025-04-27 13:03:07 +02:00
parent f3a8ef6e46
commit c9416492e3
2 changed files with 4 additions and 2 deletions

View File

@ -1,4 +1,4 @@
extends RigidBody3D class_name Player extends RigidBody3D
var has_stage: bool = false: var has_stage: bool = false:
set(on_stage): set(on_stage):

View File

@ -69,7 +69,9 @@ func toggle_pause_menu():
get_tree().paused = false get_tree().paused = false
var state_machine = menu_animation["parameters/playback"] var state_machine = menu_animation["parameters/playback"]
state_machine.travel("start_game") state_machine.travel("start_game")
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED #FIXME: this may need a more generic implementation
if State.stage_list[0] is Player:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
func debug_youth(): func debug_youth():
get_child(1).hide() get_child(1).hide()