diff options
author | Daniel Weipert <git@mail.dweipert.de> | 2024-07-19 14:18:21 +0200 |
---|---|---|
committer | Daniel Weipert <git@mail.dweipert.de> | 2024-07-19 14:18:21 +0200 |
commit | 7ce3593119b399196d71c88e3d1cab08ff38bb80 (patch) | |
tree | cb0abec447ee9d053836b3eefb9a3947f4a2cb6c /Network | |
parent | 7e579ced0b51f98b2c14a0c868bf428c12d4790b (diff) |
Diffstat (limited to 'Network')
-rw-r--r-- | Network/Lobby.gd | 8 | ||||
-rw-r--r-- | Network/Lobby.tscn | 74 |
2 files changed, 49 insertions, 33 deletions
diff --git a/Network/Lobby.gd b/Network/Lobby.gd index 87a3894..4b573cf 100644 --- a/Network/Lobby.gd +++ b/Network/Lobby.gd @@ -15,10 +15,10 @@ func _ready(): Network.connect("game_ended", Callable(self, "_on_game_ended")) $HTTPRequest.connect("request_completed", Callable(self, '_set_remote_ip')) - ConnectNodeContainer = $CenterContainer - ConnectNode = $CenterContainer/Connect - PlayersNodeContainer = $CenterContainer2 - PlayersNode = $CenterContainer2/Players + ConnectNodeContainer = $Connect + ConnectNode = $Connect/CenterContainer/Connect + PlayersNodeContainer = $Players + PlayersNode = $Players/CenterContainer/Players if OS.has_environment("USERNAME"): ConnectNode.get_node("Name").text = OS.get_environment("USERNAME") diff --git a/Network/Lobby.tscn b/Network/Lobby.tscn index 60bf28e..7dccc24 100644 --- a/Network/Lobby.tscn +++ b/Network/Lobby.tscn @@ -12,7 +12,7 @@ grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1") -[node name="CenterContainer" type="CenterContainer" parent="."] +[node name="Connect" type="Control" parent="."] layout_mode = 1 anchors_preset = 15 anchor_right = 1.0 @@ -20,11 +20,19 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Connect" type="Panel" parent="CenterContainer"] +[node name="CenterContainer" type="CenterContainer" parent="Connect"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Connect" type="Panel" parent="Connect/CenterContainer"] custom_minimum_size = Vector2(180, 150) layout_mode = 2 -[node name="Name" type="LineEdit" parent="CenterContainer/Connect"] +[node name="Name" type="LineEdit" parent="Connect/CenterContainer/Connect"] layout_mode = 0 offset_left = 8.0 offset_top = 8.0 @@ -32,7 +40,7 @@ offset_right = 168.0 offset_bottom = 32.0 placeholder_text = "Name" -[node name="IP" type="LineEdit" parent="CenterContainer/Connect"] +[node name="IP" type="LineEdit" parent="Connect/CenterContainer/Connect"] layout_mode = 0 offset_left = 8.0 offset_top = 40.0 @@ -40,7 +48,7 @@ offset_right = 168.0 offset_bottom = 64.0 placeholder_text = "IP" -[node name="Host" type="Button" parent="CenterContainer/Connect"] +[node name="Host" type="Button" parent="Connect/CenterContainer/Connect"] layout_mode = 0 offset_left = 8.0 offset_top = 112.0 @@ -48,7 +56,7 @@ offset_right = 64.0 offset_bottom = 136.0 text = "Host" -[node name="Join" type="Button" parent="CenterContainer/Connect"] +[node name="Join" type="Button" parent="Connect/CenterContainer/Connect"] layout_mode = 0 offset_left = 112.0 offset_top = 112.0 @@ -56,7 +64,7 @@ offset_right = 168.0 offset_bottom = 136.0 text = "Join" -[node name="Error" type="Label" parent="CenterContainer/Connect"] +[node name="Error" type="Label" parent="Connect/CenterContainer/Connect"] layout_mode = 0 offset_left = 8.0 offset_top = 72.0 @@ -64,7 +72,17 @@ offset_right = 168.0 offset_bottom = 104.0 theme_override_colors/font_color = Color(1, 0.137255, 0.137255, 1) -[node name="CenterContainer2" type="CenterContainer" parent="."] +[node name="MenuButton" parent="Connect" instance=ExtResource("2")] +layout_mode = 2 +anchors_preset = 0 +anchor_right = 0.0 +anchor_bottom = 0.0 +offset_left = 6.0 +offset_top = 5.0 +offset_right = 59.0 +offset_bottom = 36.0 + +[node name="Players" type="Control" parent="."] visible = false layout_mode = 1 anchors_preset = 15 @@ -73,11 +91,19 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 -[node name="Players" type="Panel" parent="CenterContainer2"] +[node name="CenterContainer" type="CenterContainer" parent="Players"] +layout_mode = 1 +anchors_preset = 15 +anchor_right = 1.0 +anchor_bottom = 1.0 +grow_horizontal = 2 +grow_vertical = 2 + +[node name="Players" type="Panel" parent="Players/CenterContainer"] custom_minimum_size = Vector2(260, 460) layout_mode = 2 -[node name="Label" type="Label" parent="CenterContainer2/Players"] +[node name="Label" type="Label" parent="Players/CenterContainer/Players"] layout_mode = 0 offset_left = 16.0 offset_top = 16.0 @@ -85,7 +111,7 @@ offset_right = 64.0 offset_bottom = 32.0 text = "Lobby" -[node name="LocalIP" type="Label" parent="CenterContainer2/Players"] +[node name="LocalIP" type="Label" parent="Players/CenterContainer/Players"] layout_mode = 0 offset_left = 128.0 offset_top = 24.0 @@ -93,7 +119,7 @@ offset_right = 240.0 offset_bottom = 38.0 text = "000.000.000.000" -[node name="RemoteIP" type="Label" parent="CenterContainer2/Players"] +[node name="RemoteIP" type="Label" parent="Players/CenterContainer/Players"] layout_mode = 0 offset_left = 128.0 offset_top = 8.0 @@ -101,14 +127,14 @@ offset_right = 240.0 offset_bottom = 22.0 text = "000.000.000.000" -[node name="List" type="ItemList" parent="CenterContainer2/Players"] +[node name="List" type="ItemList" parent="Players/CenterContainer/Players"] layout_mode = 0 offset_left = 16.0 offset_top = 48.0 offset_right = 240.0 offset_bottom = 400.0 -[node name="Start" type="Button" parent="CenterContainer2/Players"] +[node name="Start" type="Button" parent="Players/CenterContainer/Players"] layout_mode = 0 offset_left = 64.0 offset_top = 416.0 @@ -116,7 +142,7 @@ offset_right = 192.0 offset_bottom = 448.0 text = "START!" -[node name="Back" type="Button" parent="CenterContainer2/Players"] +[node name="Back" type="Button" parent="Players/CenterContainer/Players"] layout_mode = 0 offset_left = 16.0 offset_top = 416.0 @@ -126,19 +152,9 @@ text = "<" [node name="ErrorDialog" type="AcceptDialog" parent="."] -[node name="MenuButton" parent="." instance=ExtResource("2")] -layout_mode = 0 -anchors_preset = 0 -anchor_right = 0.0 -anchor_bottom = 0.0 -offset_left = 1.0 -offset_top = 1.0 -offset_right = 54.0 -offset_bottom = 32.0 - [node name="HTTPRequest" type="HTTPRequest" parent="."] -[connection signal="pressed" from="CenterContainer/Connect/Host" to="." method="_on_Host_pressed"] -[connection signal="pressed" from="CenterContainer/Connect/Join" to="." method="_on_Join_pressed"] -[connection signal="pressed" from="CenterContainer2/Players/Start" to="." method="_on_Start_pressed"] -[connection signal="pressed" from="CenterContainer2/Players/Back" to="." method="_on_Back_pressed"] +[connection signal="pressed" from="Connect/CenterContainer/Connect/Host" to="." method="_on_Host_pressed"] +[connection signal="pressed" from="Connect/CenterContainer/Connect/Join" to="." method="_on_Join_pressed"] +[connection signal="pressed" from="Players/CenterContainer/Players/Start" to="." method="_on_Start_pressed"] +[connection signal="pressed" from="Players/CenterContainer/Players/Back" to="." method="_on_Back_pressed"] |