Client menu QoL
This commit is contained in:
parent
75427dd336
commit
edbe11324c
3 changed files with 9 additions and 7 deletions
|
|
@ -37,9 +37,9 @@ custom_minimum_size = Vector2(256, 0)
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
min_value = 0.001
|
min_value = 0.001
|
||||||
max_value = 0.1
|
max_value = 0.02
|
||||||
step = 0.001
|
step = 0.001
|
||||||
value = 0.02
|
value = 0.001
|
||||||
|
|
||||||
[node name="SensitivityBox" type="SpinBox" parent="CenterContainer/PanelContainer/VBoxContainer/Sensitivity"]
|
[node name="SensitivityBox" type="SpinBox" parent="CenterContainer/PanelContainer/VBoxContainer/Sensitivity"]
|
||||||
unique_name_in_owner = true
|
unique_name_in_owner = true
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
extends Node
|
extends Node
|
||||||
|
|
||||||
|
|
||||||
var SENSITIVITY: float = 0.02
|
var SENSITIVITY: float = 0.004
|
||||||
var TOGGLE_CROUCH: bool = false
|
var TOGGLE_CROUCH: bool = false
|
||||||
var TOGGLE_SCOPE: bool = false
|
var TOGGLE_SCOPE: bool = false
|
||||||
var TOGGLE_WALK: bool = false
|
var TOGGLE_WALK: bool = false
|
||||||
|
|
|
||||||
|
|
@ -1,22 +1,24 @@
|
||||||
extends Control
|
extends Control
|
||||||
|
|
||||||
var cached_mouse_state: Input.MouseMode
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
hide()
|
hide()
|
||||||
Session.session_started.connect(%LeaveButton.show)
|
Session.session_started.connect(%LeaveButton.show)
|
||||||
Session.session_ended.connect(%LeaveButton.hide)
|
Session.session_ended.connect(%LeaveButton.hide)
|
||||||
Lobby.lobby_created.connect(%StopSession.show)
|
Lobby.lobby_created.connect(%StopSession.show)
|
||||||
Lobby.lobby_closed.connect(%StopSession.hide)
|
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:
|
func _input(event: InputEvent) -> void:
|
||||||
if event.is_action_pressed("menu_settings"):
|
if event.is_action_pressed("menu_settings"):
|
||||||
visible = not visible
|
visible = not visible
|
||||||
if visible:
|
if visible:
|
||||||
cached_mouse_state = Input.mouse_mode
|
|
||||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||||
else:
|
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:
|
func _on_gameplay_main_slider_value_changed(value: float) -> void:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue