Team switch
This commit is contained in:
parent
775763a128
commit
59bf07b076
5 changed files with 89 additions and 2 deletions
|
|
@ -5,7 +5,6 @@ var cached_mouse_state: Input.MouseMode
|
|||
func _on_check_button_toggled(toggled_on: bool) -> void:
|
||||
DisplayServer.window_set_mode(DisplayServer.WINDOW_MODE_FULLSCREEN if toggled_on else DisplayServer.WINDOW_MODE_WINDOWED)
|
||||
|
||||
|
||||
func _on_h_slider_value_changed(value: float) -> void:
|
||||
$VBoxContainer/Sensitivity/SpinBox.set_value_no_signal(value)
|
||||
ClientSettings.SENSITIVITY = value
|
||||
|
|
|
|||
37
scripts/gui/team_choice_menu.gd
Normal file
37
scripts/gui/team_choice_menu.gd
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
extends Control
|
||||
|
||||
var cached_mouse_state: Input.MouseMode
|
||||
|
||||
func _on_spectator_button_pressed() -> void:
|
||||
if Lobby.get_team() != Session.TEAMS.SPECTATE:
|
||||
Lobby.switch_team(Session.TEAMS.SPECTATE)
|
||||
visible = false
|
||||
update_mouse()
|
||||
|
||||
func _on_attack_button_pressed() -> void:
|
||||
if Lobby.get_team() != Session.TEAMS.ATTACK:
|
||||
Lobby.switch_team(Session.TEAMS.ATTACK)
|
||||
visible = false
|
||||
update_mouse()
|
||||
|
||||
func _on_defence_button_pressed() -> void:
|
||||
if Lobby.get_team() != Session.TEAMS.DEFENCE:
|
||||
Lobby.switch_team(Session.TEAMS.DEFENCE)
|
||||
visible = false
|
||||
update_mouse()
|
||||
|
||||
func _on_cancel_button_pressed() -> void:
|
||||
visible = false
|
||||
update_mouse()
|
||||
|
||||
func _input(event: InputEvent) -> void:
|
||||
if event.is_action_pressed("menu_team_choice"):
|
||||
visible = not visible
|
||||
update_mouse()
|
||||
|
||||
func update_mouse() -> void:
|
||||
if visible:
|
||||
cached_mouse_state = Input.mouse_mode
|
||||
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE
|
||||
else:
|
||||
Input.mouse_mode = cached_mouse_state
|
||||
1
scripts/gui/team_choice_menu.gd.uid
Normal file
1
scripts/gui/team_choice_menu.gd.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://m8qq2eynls6n
|
||||
Loading…
Add table
Add a link
Reference in a new issue