summaryrefslogtreecommitdiff
path: root/pages/ServerBrowser.tscn
diff options
context:
space:
mode:
authorAnson Bridges <bridges.anson@gmail.com>2025-08-11 22:42:00 -0700
committerAnson Bridges <bridges.anson@gmail.com>2025-08-11 22:42:00 -0700
commitd558a9add0e183219a7a9ff482807bdcd677e21a (patch)
tree49e454649a4b45ce02c419894109de55f7f2e465 /pages/ServerBrowser.tscn
Initialize repo from local files
Diffstat (limited to 'pages/ServerBrowser.tscn')
-rw-r--r--pages/ServerBrowser.tscn196
1 files changed, 196 insertions, 0 deletions
diff --git a/pages/ServerBrowser.tscn b/pages/ServerBrowser.tscn
new file mode 100644
index 0000000..c4fcc61
--- /dev/null
+++ b/pages/ServerBrowser.tscn
@@ -0,0 +1,196 @@
+[gd_scene load_steps=6 format=2]
+
+[ext_resource path="res://network/websocket_client.gd" type="Script" id=1]
+[ext_resource path="res://scripts/ServerBrowser.gd" type="Script" id=2]
+
+[sub_resource type="Gradient" id=15]
+offsets = PoolRealArray( 0 )
+colors = PoolColorArray( 0, 0, 0, 1 )
+
+[sub_resource type="GradientTexture2D" id=21]
+gradient = SubResource( 15 )
+width = 32
+height = 32
+
+[sub_resource type="GDScript" id=14]
+resource_name = "set_colors_builtin"
+script/source = "extends OptionButton
+
+
+func _ready():
+ for i in range(get_item_count()):
+ set_item_icon(i, get_item_icon(i).duplicate())
+ var icon = get_item_icon(i)
+ icon.gradient = icon.gradient.duplicate()
+ icon.gradient.set_color(0, Globals.colors[i])
+ print(icon.gradient.colors)
+ icon.gradient.colors.remove(0)
+
+
+"
+
+[node name="ServerBrowser" type="Control"]
+anchor_right = 1.0
+anchor_bottom = 1.0
+script = ExtResource( 2 )
+
+[node name="HostButton" type="Button" parent="."]
+margin_left = 688.0
+margin_top = 349.0
+margin_right = 772.0
+margin_bottom = 369.0
+text = "Host Game"
+
+[node name="UsernameLabel" type="Label" parent="."]
+margin_left = 676.0
+margin_top = 100.0
+margin_right = 1074.0
+margin_bottom = 144.0
+text = "Username:"
+
+[node name="ColorLabel" type="Label" parent="."]
+margin_left = 680.0
+margin_top = 132.0
+margin_right = 1078.0
+margin_bottom = 176.0
+text = "Color:"
+
+[node name="AltColorLabel" type="Label" parent="."]
+margin_left = 681.0
+margin_top = 160.0
+margin_right = 1079.0
+margin_bottom = 204.0
+text = "Alt color:"
+
+[node name="JoinButton" type="Button" parent="."]
+margin_left = 689.0
+margin_top = 316.0
+margin_right = 724.0
+margin_bottom = 336.0
+disabled = true
+text = "Join"
+
+[node name="RefreshButton" type="Button" parent="."]
+margin_left = 420.0
+margin_top = 388.0
+margin_right = 551.0
+margin_bottom = 408.0
+text = "Refresh Server List"
+
+[node name="GameList" type="ItemList" parent="."]
+margin_left = 314.0
+margin_top = 89.0
+margin_right = 614.0
+margin_bottom = 367.0
+
+[node name="Username" type="LineEdit" parent="."]
+margin_left = 756.0
+margin_top = 94.0
+margin_right = 870.0
+margin_bottom = 118.0
+text = "Player"
+max_length = 32
+
+[node name="HostPopup" type="PopupPanel" parent="."]
+margin_left = 383.0
+margin_top = 129.0
+margin_right = 633.0
+margin_bottom = 399.0
+
+[node name="Control" type="Control" parent="HostPopup"]
+margin_left = 4.0
+margin_top = 4.0
+margin_right = 246.0
+margin_bottom = 266.0
+
+[node name="GameName" type="LineEdit" parent="HostPopup/Control"]
+margin_left = 41.0
+margin_top = 22.0
+margin_right = 192.0
+margin_bottom = 55.0
+text = "Player's Game"
+max_length = 39
+
+[node name="HostConfirmButton" type="Button" parent="HostPopup/Control"]
+margin_left = 99.0
+margin_top = 208.0
+margin_right = 212.0
+margin_bottom = 244.0
+text = "Host"
+
+[node name="PlayerCount" type="OptionButton" parent="HostPopup/Control"]
+margin_left = 120.0
+margin_top = 68.0
+margin_right = 216.0
+margin_bottom = 99.0
+text = "2"
+items = [ "2", null, false, 2, null, "3", null, false, 3, null, "4", null, false, 4, null, "5", null, false, 5, null, "6", null, false, 6, null ]
+selected = 0
+
+[node name="CancelHostButton" type="Button" parent="HostPopup/Control"]
+margin_left = 30.0
+margin_top = 209.0
+margin_right = 84.0
+margin_bottom = 243.0
+text = "Cancel"
+
+[node name="PlayerCountLabel" type="Label" parent="HostPopup/Control"]
+margin_left = 26.0
+margin_top = 80.0
+margin_right = 76.0
+margin_bottom = 94.0
+text = "Players:"
+
+[node name="PrivateToggle" type="CheckButton" parent="HostPopup/Control"]
+margin_left = 22.0
+margin_top = 116.0
+margin_right = 228.0
+margin_bottom = 156.0
+size_flags_horizontal = 0
+size_flags_vertical = 0
+text = "Password Protected"
+
+[node name="Password" type="LineEdit" parent="HostPopup/Control"]
+visible = false
+anchor_left = 0.1
+anchor_right = 0.9
+margin_top = 169.0
+margin_bottom = 193.0
+max_length = 16
+placeholder_text = "Password"
+placeholder_alpha = 0.587
+
+[node name="PlayerColor" type="OptionButton" parent="."]
+margin_left = 758.0
+margin_top = 124.0
+margin_right = 804.0
+margin_bottom = 147.0
+icon = SubResource( 21 )
+expand_icon = true
+items = [ "", SubResource( 21 ), false, 0, null, "", SubResource( 21 ), false, 1, null, "", SubResource( 21 ), false, 2, null, "", SubResource( 21 ), false, 3, null, "", SubResource( 21 ), false, 4, null, "", SubResource( 21 ), false, 5, null, "", SubResource( 21 ), false, 6, null, "", SubResource( 21 ), false, 7, null, "", SubResource( 21 ), false, 8, null, "", SubResource( 21 ), false, 9, null ]
+selected = 0
+script = SubResource( 14 )
+
+[node name="AltPlayerColor" type="OptionButton" parent="."]
+margin_left = 758.0
+margin_top = 155.0
+margin_right = 804.0
+margin_bottom = 178.0
+icon = SubResource( 21 )
+expand_icon = true
+items = [ "", SubResource( 21 ), false, 0, null, "", SubResource( 21 ), false, 1, null, "", SubResource( 21 ), false, 2, null, "", SubResource( 21 ), false, 3, null, "", SubResource( 21 ), false, 4, null, "", SubResource( 21 ), false, 5, null, "", SubResource( 21 ), false, 6, null, "", SubResource( 21 ), false, 7, null, "", SubResource( 21 ), false, 8, null, "", SubResource( 21 ), false, 9, null ]
+selected = 0
+script = SubResource( 14 )
+
+[node name="GameCoordinator" type="Node" parent="."]
+script = ExtResource( 1 )
+
+[node name="GameCoordinatorStatus" type="Label" parent="."]
+margin_left = 154.0
+margin_top = 31.0
+margin_right = 354.0
+margin_bottom = 45.0
+text = "Game Coordinator Connection: "
+
+[connection signal="pressed" from="HostButton" to="HostPopup" method="popup_centered" binds= [ Vector2( 250, 270 ) ]]
+[connection signal="pressed" from="HostPopup/Control/CancelHostButton" to="HostPopup" method="set_visible" binds= [ false ]]