Co-op pass: host-disconnect handling, spectate, late-join wave sync

- Clients now handle the host closing the arena: bank winnings if
  still alive (retire), reset the HUD, and return to the camp menu
  instead of being stranded in a dead world
- Death in co-op offers Spectate when a teammate is still fighting:
  closes the results overlay and watches the run; the escape menu
  gains a "Back to Camp" option for dead spectators to leave later
- Late joiners receive the current wave number on connect so their
  HUD doesn't sit on "Prepare..." until the next wave starts
This commit is contained in:
2026-07-01 23:57:38 +01:00
parent f5e0642b39
commit fb10f7b042
3 changed files with 56 additions and 4 deletions
+9 -4
View File
@@ -54,14 +54,19 @@ func toggle_menu():
if player and player.is_multiplayer_authority():
Input.mouse_mode = Input.MOUSE_MODE_CAPTURED
## Retiring is only possible while alive with an active run
## Alive with an active run: retire (bank winnings).
## Dead but spectating a live session: plain trip home (settlement already done).
func _update_retire_button():
if not _retire_button:
return
var can_retire = GameState.run_active and player and not player.is_dead
_retire_button.visible = can_retire
if can_retire:
if GameState.run_active and player and not player.is_dead:
_retire_button.visible = true
_retire_button.text = "Retire to Camp (+%dg)" % GameState.run_gold
elif multiplayer.multiplayer_peer != null and player and player.is_dead:
_retire_button.visible = true
_retire_button.text = "Back to Camp"
else:
_retire_button.visible = false
## Called when Resume button is clicked
func _on_resume_pressed():