diff options
author | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-29 13:01:15 -0500 |
---|---|---|
committer | Star Rauchenberger <fefferburbia@gmail.com> | 2023-11-29 13:01:15 -0500 |
commit | b02f3e471a0c4d2e332889faea33f05f1a9125cc (patch) | |
tree | 8b013d5ad722926b62b01ba28a682143fbebaf0b /Archipelago | |
parent | 59e44bbb2a89dd2228b6f39e6964f8dd456d33c9 (diff) | |
download | lingo-archipelago-b02f3e471a0c4d2e332889faea33f05f1a9125cc.tar.gz lingo-archipelago-b02f3e471a0c4d2e332889faea33f05f1a9125cc.tar.bz2 lingo-archipelago-b02f3e471a0c4d2e332889faea33f05f1a9125cc.zip |
Multiplayer shows slot name above players
Diffstat (limited to 'Archipelago')
-rw-r--r-- | Archipelago/multiplayer.gd | 23 |
1 files changed, 23 insertions, 0 deletions
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: | |||
18 | var _ignore = Steam.setLobbyData(lobby_id, "archipelago", apclient._seed) | 18 | var _ignore = Steam.setLobbyData(lobby_id, "archipelago", apclient._seed) |
19 | 19 | ||
20 | ._on_lobby_created(result, lobby_id) | 20 | ._on_lobby_created(result, lobby_id) |
21 | |||
22 | |||
23 | func _on_lobby_joined(lobby_id: int, permissions: int, locked: bool, result: int) -> void: | ||
24 | if result != Steam.RESULT_OK: | ||
25 | return | ||
26 | |||
27 | var apclient = global.get_node("Archipelago") | ||
28 | Steam.setLobbyMemberData(lobby_id, "slot_name", apclient.ap_user) | ||
29 | |||
30 | ._on_lobby_joined(lobby_id, permissions, locked, result) | ||
31 | |||
32 | |||
33 | func _update_lobby_members(): | ||
34 | ._update_lobby_members() | ||
35 | |||
36 | if active_lobby_id == 0: | ||
37 | return | ||
38 | var lobby_size: int = Steam.getNumLobbyMembers(active_lobby_id) | ||
39 | for i in range(0, lobby_size): | ||
40 | var member_id: int = Steam.getLobbyMemberByIndex(active_lobby_id, i) | ||
41 | if member_id != player_steam_id and member_id in active_lobby_members: | ||
42 | var slot_name = Steam.getLobbyMemberData(active_lobby_id, member_id, "slot_name") | ||
43 | active_lobby_members[member_id].steam_name = slot_name | ||