From b02f3e471a0c4d2e332889faea33f05f1a9125cc Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 29 Nov 2023 13:01:15 -0500 Subject: Multiplayer shows slot name above players --- Archipelago/multiplayer.gd | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'Archipelago') diff --git a/Archipelago/multiplayer.gd b/Archipelago/multiplayer.gd index 07b63b8..2704af7 100644 --- a/Archipelago/multiplayer.gd +++ b/Archipelago/multiplayer.gd @@ -18,3 +18,26 @@ func _on_lobby_created(result: int, lobby_id: int) -> void: var _ignore = Steam.setLobbyData(lobby_id, "archipelago", apclient._seed) ._on_lobby_created(result, lobby_id) + + +func _on_lobby_joined(lobby_id: int, permissions: int, locked: bool, result: int) -> void: + if result != Steam.RESULT_OK: + return + + var apclient = global.get_node("Archipelago") + Steam.setLobbyMemberData(lobby_id, "slot_name", apclient.ap_user) + + ._on_lobby_joined(lobby_id, permissions, locked, result) + + +func _update_lobby_members(): + ._update_lobby_members() + + if active_lobby_id == 0: + return + var lobby_size: int = Steam.getNumLobbyMembers(active_lobby_id) + for i in range(0, lobby_size): + var member_id: int = Steam.getLobbyMemberByIndex(active_lobby_id, i) + if member_id != player_steam_id and member_id in active_lobby_members: + var slot_name = Steam.getLobbyMemberData(active_lobby_id, member_id, "slot_name") + active_lobby_members[member_id].steam_name = slot_name -- cgit 1.4.1