feat: server discovery
This commit is contained in:
parent
498604499a
commit
3521732cd2
3 changed files with 273 additions and 26 deletions
34
main.tscn
34
main.tscn
|
|
@ -1,6 +1,7 @@
|
|||
[gd_scene load_steps=2 format=3 uid="uid://c7gn46af6whf8"]
|
||||
[gd_scene load_steps=3 format=3 uid="uid://c7gn46af6whf8"]
|
||||
|
||||
[ext_resource type="Script" path="res://main.gd" id="1_e0ud3"]
|
||||
[ext_resource type="Script" path="res://server_discovery.gd" id="2_hed18"]
|
||||
|
||||
[node name="Main" type="Control"]
|
||||
layout_mode = 3
|
||||
|
|
@ -33,12 +34,31 @@ layout_mode = 2
|
|||
size_flags_vertical = 3
|
||||
placeholder_text = "192.168.*.*"
|
||||
|
||||
[node name="RefreshButton" type="Button" parent="BeforeConnect"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 64)
|
||||
layout_mode = 2
|
||||
text = "Refresh"
|
||||
|
||||
[node name="HostButton" type="Button" parent="BeforeConnect"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 64)
|
||||
layout_mode = 2
|
||||
text = "Host"
|
||||
|
||||
[node name="ConnectButton" type="Button" parent="BeforeConnect"]
|
||||
unique_name_in_owner = true
|
||||
custom_minimum_size = Vector2(0, 64)
|
||||
layout_mode = 2
|
||||
text = "Connect"
|
||||
|
||||
[node name="DiscoveryTimer" type="Timer" parent="BeforeConnect"]
|
||||
unique_name_in_owner = true
|
||||
|
||||
[node name="ServerDiscovery" type="Node" parent="BeforeConnect"]
|
||||
unique_name_in_owner = true
|
||||
script = ExtResource("2_hed18")
|
||||
|
||||
[node name="AfterConnect" type="VBoxContainer" parent="."]
|
||||
unique_name_in_owner = true
|
||||
visible = false
|
||||
|
|
@ -64,6 +84,12 @@ text = "1"
|
|||
horizontal_alignment = 1
|
||||
vertical_alignment = 1
|
||||
|
||||
[node name="DisconnectButton" type="Button" parent="AfterConnect"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Disconnect"
|
||||
|
||||
[node name="Actions" type="HBoxContainer" parent="AfterConnect"]
|
||||
layout_mode = 2
|
||||
|
||||
|
|
@ -78,3 +104,9 @@ unique_name_in_owner = true
|
|||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "+"
|
||||
|
||||
[node name="StartGameButton" type="Button" parent="AfterConnect"]
|
||||
unique_name_in_owner = true
|
||||
layout_mode = 2
|
||||
size_flags_horizontal = 3
|
||||
text = "Start Game"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue