about summary refs log tree commit diff stats
path: root/Archipelago/multiplayer.gd
blob: 2704af7866706ee1d14450d0af9d78e89b542c82 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
extends "res://scripts/multiplayer.gd"


func _request_lobby_list():
	var apclient = global.get_node("Archipelago")
	Steam.addRequestLobbyListStringFilter(
		"archipelago", apclient._seed, Steam.LOBBY_COMPARISON_EQUAL
	)

	._request_lobby_list()


func _on_lobby_created(result: int, lobby_id: int) -> void:
	if result != Steam.RESULT_OK:
		return

	var apclient = global.get_node("Archipelago")
	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
t = ExtResource( 2 ) text = "BACK" script = ExtResource( 4 ) [node name="credit2" parent="Panel" instance=ExtResource( 1 )] margin_left = -105.0 margin_top = 346.0 margin_right = 485.0 margin_bottom = 410.0 custom_fonts/font = ExtResource( 2 ) custom_styles/normal = SubResource( 1 ) text = "SERVER" align = 2 [node name="credit5" parent="Panel" instance=ExtResource( 1 )] margin_left = 1239.0 margin_top = 271.0 margin_right = 1829.0 margin_bottom = 335.0 custom_fonts/font = ExtResource( 2 ) custom_styles/normal = SubResource( 1 ) text = "OPTIONS" [node name="credit3" parent="Panel" instance=ExtResource( 1 )] margin_left = -105.0 margin_top = 519.0 margin_right = 485.0 margin_bottom = 583.0 custom_fonts/font = ExtResource( 2 ) custom_styles/normal = SubResource( 1 ) text = "PLAYER" align = 2 [node name="credit4" parent="Panel" instance=ExtResource( 1 )] margin_left = -105.0 margin_top = 704.0 margin_right = 485.0 margin_bottom = 768.0 custom_fonts/font = ExtResource( 2 ) custom_styles/normal = SubResource( 1 ) text = "PASSWORD" align = 2 [node name="server_box" type="LineEdit" parent="Panel"] margin_left = 502.0 margin_top = 295.0 margin_right = 1144.0 margin_bottom = 445.0 custom_colors/selection_color = Color( 0.482353, 0, 0, 1 ) custom_colors/cursor_color = Color( 0, 0, 0, 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_styles/focus = SubResource( 2 ) align = 1 caret_blink = true [node name="player_box" type="LineEdit" parent="Panel"] margin_left = 502.0 margin_top = 477.0 margin_right = 1144.0 margin_bottom = 627.0 custom_colors/selection_color = Color( 0.482353, 0, 0, 1 ) custom_colors/cursor_color = Color( 0, 0, 0, 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_styles/focus = SubResource( 2 ) align = 1 caret_blink = true [node name="password_box" type="LineEdit" parent="Panel"] margin_left = 502.0 margin_top = 659.0 margin_right = 1144.0 margin_bottom = 809.0 custom_colors/selection_color = Color( 0.482353, 0, 0, 1 ) custom_colors/cursor_color = Color( 0, 0, 0, 1 ) custom_colors/font_color = Color( 0, 0, 0, 1 ) custom_styles/focus = SubResource( 2 ) align = 1 caret_blink = true [node name="AcceptDialog" type="AcceptDialog" parent="Panel"] margin_right = 83.0 margin_bottom = 58.0 [node name="confusing_box" type="CheckBox" parent="Panel"] margin_left = 1227.0 margin_top = 351.0 margin_right = 1832.0 margin_bottom = 439.0 custom_fonts/font = ExtResource( 6 ) custom_icons/checked = ExtResource( 8 ) custom_icons/unchecked = ExtResource( 7 ) text = "Make world more confusing" [node name="multiplayer_box" type="CheckBox" parent="Panel"] margin_left = 1227.0 margin_top = 461.0 margin_right = 1832.0 margin_bottom = 549.0 custom_fonts/font = ExtResource( 6 ) custom_icons/checked = ExtResource( 8 ) custom_icons/unchecked = ExtResource( 7 ) text = "Show other players" [connection signal="pressed" from="Panel/connect_button" to="Panel/connect_button" method="_connect_pressed"] [connection signal="pressed" from="Panel/quit_button" to="Panel/quit_button" method="_back_pressed"]