41 lines
1.3 KiB
GDScript
41 lines
1.3 KiB
GDScript
extends Control
|
|
|
|
func _ready() -> void:
|
|
hide()
|
|
Session.session_started.connect(%LeaveButton.show)
|
|
Session.session_ended.connect(%LeaveButton.hide)
|
|
Session.session_ended.connect(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:
|
|
MouseConfiner.borrow()
|
|
else:
|
|
MouseConfiner.stop_borrow()
|
|
|
|
|
|
func _on_gameplay_main_slider_value_changed(value: float) -> void:
|
|
AudioServer.set_bus_volume_linear(1,value)
|
|
|
|
func _on_fullscreen_button_toggled(toggled_on: bool) -> void:
|
|
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN if toggled_on else DisplayServer.WINDOW_MODE_WINDOWED)
|
|
|
|
func _on_sensitivity_slider_value_changed(value: float) -> void:
|
|
%SensitivityBox.set_value_no_signal(value)
|
|
ClientSettings.SENSITIVITY = value
|
|
|
|
func _on_sensitivity_box_value_changed(value: float) -> void:
|
|
%SensitivitySlider.set_value_no_signal(value)
|
|
ClientSettings.SENSITIVITY = value
|
|
|
|
func _on_leave_button_pressed() -> void:
|
|
Session.quit_session()
|
|
|
|
func _on_stop_session_pressed() -> void:
|
|
if multiplayer.is_server():
|
|
Session.end_session()
|