This commit is contained in:
Rendo 2025-12-08 21:04:18 +05:00
commit 4e8971b12d
12 changed files with 134 additions and 15 deletions

View file

@ -1,7 +1,5 @@
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)
@ -31,7 +29,9 @@ func _input(event: InputEvent) -> void:
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
if Session.session_started_flag:
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
else:
Input.mouse_mode = Input.MOUSE_MODE_VISIBLE

View file

@ -2,13 +2,19 @@ extends Area3D
@export var weapon_spawner: MultiplayerSpawner
@export var weapon_system: WeaponSystem
var disabled: bool
func _ready() -> void:
if is_multiplayer_authority() == false: return
body_entered.connect(on_body_entered)
func disable() -> void:
disabled = true
func on_body_entered(body: Node3D):
if disabled:
return
if body is DroppableWeapon:
if weapon_system.can_add(body.slot) == false or (body.team != Session.TEAMS.UNASSIGNED and get_parent().team != body.team):
return
@ -22,12 +28,16 @@ func on_body_entered(body: Node3D):
Session.despawn(body.get_path())
func start_temp_ignore():
if disabled:
return
if is_multiplayer_authority() == false:
return
monitoring = false
get_tree().create_timer(0.5).timeout.connect(stop_temp_ignore)
func stop_temp_ignore():
if disabled:
return
if is_multiplayer_authority() == false:
return
monitoring = true