Improve 3+ lobby ready UX with explicit self/others status
This commit is contained in:
@@ -325,13 +325,18 @@ func _on_server_push(type: String, payload: Variant) -> void:
|
||||
i_am_ready = hr
|
||||
partner_ready = gr
|
||||
elif is_additional:
|
||||
# Additional players (3rd+) resolve self-ready from the participant snapshot when present.
|
||||
# Additional players (3rd+) resolve self-ready and overall partner readiness
|
||||
# from the full participant snapshot when present.
|
||||
var others_ready := hr and gr
|
||||
if d.has("additionalPlayers"):
|
||||
for ap: Dictionary in (d.get("additionalPlayers", []) as Array):
|
||||
if str(ap.get("accountId", "")) == Auth.user_id:
|
||||
i_am_ready = bool(ap.get("isReady", false))
|
||||
break
|
||||
partner_ready = hr and gr
|
||||
var aid := str(ap.get("accountId", ""))
|
||||
var ardy := bool(ap.get("isReady", false))
|
||||
if aid == Auth.user_id:
|
||||
i_am_ready = ardy
|
||||
else:
|
||||
others_ready = others_ready and ardy
|
||||
partner_ready = others_ready
|
||||
else:
|
||||
# First guest
|
||||
i_am_ready = gr
|
||||
|
||||
Reference in New Issue
Block a user