From edbe11324c061f92fe966ffa4b89bf065875b386 Mon Sep 17 00:00:00 2001 From: Rendo Date: Mon, 8 Dec 2025 18:55:04 +0500 Subject: [PATCH] Client menu QoL --- scenes/gui/client_settings.tscn | 4 ++-- scripts/client_settings.gd | 2 +- scripts/gui/client_settings_menu.gd | 10 ++++++---- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/scenes/gui/client_settings.tscn b/scenes/gui/client_settings.tscn index c48dd3e..be3e36e 100644 --- a/scenes/gui/client_settings.tscn +++ b/scenes/gui/client_settings.tscn @@ -37,9 +37,9 @@ custom_minimum_size = Vector2(256, 0) layout_mode = 2 size_flags_horizontal = 3 min_value = 0.001 -max_value = 0.1 +max_value = 0.02 step = 0.001 -value = 0.02 +value = 0.001 [node name="SensitivityBox" type="SpinBox" parent="CenterContainer/PanelContainer/VBoxContainer/Sensitivity"] unique_name_in_owner = true diff --git a/scripts/client_settings.gd b/scripts/client_settings.gd index 1b15ec0..8f1a41e 100644 --- a/scripts/client_settings.gd +++ b/scripts/client_settings.gd @@ -1,7 +1,7 @@ extends Node -var SENSITIVITY: float = 0.02 +var SENSITIVITY: float = 0.004 var TOGGLE_CROUCH: bool = false var TOGGLE_SCOPE: bool = false var TOGGLE_WALK: bool = false diff --git a/scripts/gui/client_settings_menu.gd b/scripts/gui/client_settings_menu.gd index 1a7a281..8f3fc61 100644 --- a/scripts/gui/client_settings_menu.gd +++ b/scripts/gui/client_settings_menu.gd @@ -1,22 +1,24 @@ extends Control -var cached_mouse_state: Input.MouseMode - func _ready() -> void: hide() Session.session_started.connect(%LeaveButton.show) Session.session_ended.connect(%LeaveButton.hide) Lobby.lobby_created.connect(%StopSession.show) Lobby.lobby_closed.connect(%StopSession.hide) + %SensitivitySlider.set_value_no_signal(ClientSettings.SENSITIVITY) + %SensitivityBox.set_value_no_signal(ClientSettings.SENSITIVITY) func _input(event: InputEvent) -> void: if event.is_action_pressed("menu_settings"): visible = not visible if visible: - cached_mouse_state = Input.mouse_mode Input.mouse_mode = Input.MOUSE_MODE_VISIBLE else: - Input.mouse_mode = cached_mouse_state + if Session.session_started_flag: + Input.mouse_mode = Input.MOUSE_MODE_CAPTURED + else: + Input.mouse_mode = Input.MOUSE_MODE_VISIBLE func _on_gameplay_main_slider_value_changed(value: float) -> void: