diff --git a/lobby.tscn b/lobby.tscn index ec16a04..4e522c7 100644 --- a/lobby.tscn +++ b/lobby.tscn @@ -1,7 +1,7 @@ [gd_scene load_steps=3 format=3 uid="uid://b0cqo3qo62y6n"] [ext_resource type="Script" uid="uid://chu1htrspx5su" path="res://lobby.gd" id="1_ob30c"] -[ext_resource type="PackedScene" uid="uid://dy51wny4x53f4" path="res://scenes/data/data_bridge.tscn" id="2_h8t3n"] +[ext_resource type="PackedScene" uid="uid://dy51wny4x53f4" path="res://scripts/data/data_bridge.tscn" id="2_h8t3n"] [node name="lobby" type="Node"] editor_description = "Note: The root node needs to match game's client root node in order for proper sync talk." diff --git a/scenes/screens/lobby_screen/lobby.tscn b/scenes/screens/lobby_screen/lobby.tscn index 1c728dc..43e5c35 100644 --- a/scenes/screens/lobby_screen/lobby.tscn +++ b/scenes/screens/lobby_screen/lobby.tscn @@ -1,13 +1,13 @@ [gd_scene load_steps=4 format=3 uid="uid://dkes5cdu45q6e"] [ext_resource type="Script" uid="uid://dk7afnf7ol7dy" path="res://scenes/screens/lobby_screen/lobby.gd" id="1_hhiik"] -[ext_resource type="PackedScene" uid="uid://rb6av5eg4u0" path="res://scenes/ui_controls/lobby/ui.tscn" id="2_lqt48"] +[ext_resource type="PackedScene" uid="uid://rb6av5eg4u0" path="res://scenes/ui/lobby/lobby_ui.tscn" id="2_lqt48"] [ext_resource type="Script" uid="uid://crbm3v4td6du6" path="res://scenes/screens/lobby_screen/lobby_server.gd" id="4_glu7g"] [node name="lobby" type="Node"] script = ExtResource("1_hhiik") -[node name="ui" parent="." instance=ExtResource("2_lqt48")] +[node name="lobby_ui" parent="." instance=ExtResource("2_lqt48")] theme_override_constants/margin_left = 10 theme_override_constants/margin_top = 10 theme_override_constants/margin_right = 10 @@ -16,8 +16,8 @@ theme_override_constants/margin_bottom = 10 [node name="server" type="Node" parent="."] script = ExtResource("4_glu7g") -[connection signal="pressed" from="ui/body/left_body/server_host_hbox/host_start_bttn" to="." method="_on_host_start_bttn_pressed"] -[connection signal="pressed" from="ui/body/left_body/server_host_hbox/host_stop_bttn" to="." method="_on_host_stop_bttn_pressed"] -[connection signal="pressed" from="ui/body/left_body/search_vbox/search_hbox/match_search_bttn" to="." method="_on_match_search_bttn_pressed"] +[connection signal="pressed" from="lobby_ui/body/left_body/server_host_hbox/host_start_bttn" to="." method="_on_host_start_bttn_pressed"] +[connection signal="pressed" from="lobby_ui/body/left_body/server_host_hbox/host_stop_bttn" to="." method="_on_host_stop_bttn_pressed"] +[connection signal="pressed" from="lobby_ui/body/left_body/search_vbox/search_hbox/match_search_bttn" to="." method="_on_match_search_bttn_pressed"] -[editable path="ui"] +[editable path="lobby_ui"] diff --git a/scenes/screens/lobby_screen/lobby_base.gd b/scenes/screens/lobby_screen/lobby_base.gd index 5641b3c..fb8c735 100644 --- a/scenes/screens/lobby_screen/lobby_base.gd +++ b/scenes/screens/lobby_screen/lobby_base.gd @@ -3,14 +3,14 @@ class_name LobbyBase extends Node const MATCH_ENTRY = preload("res://scenes/screens/lobby_screen/match_entry.tscn") -@onready var host_start_bttn: Button = $ui/body/left_body/server_host_hbox/host_start_bttn -@onready var host_stop_bttn: Button = $ui/body/left_body/server_host_hbox/host_stop_bttn -@onready var host_address_input: LineEdit = $ui/body/left_body/server_host_hbox/host_address_input -@onready var host_port_range: SpinBox = $ui/body/left_body/server_host_hbox/host_port_range +@onready var host_start_bttn: Button = $lobby_ui/body/left_body/server_host_hbox/host_start_bttn +@onready var host_stop_bttn: Button = $lobby_ui/body/left_body/server_host_hbox/host_stop_bttn +@onready var host_address_input: LineEdit = $lobby_ui/body/left_body/server_host_hbox/host_address_input +@onready var host_port_range: SpinBox = $lobby_ui/body/left_body/server_host_hbox/host_port_range -@onready var search_vbox: VBoxContainer = $ui/body/left_body/search_vbox -@onready var match_search_input: LineEdit = $ui/body/left_body/search_vbox/search_hbox/match_search_input -@onready var match_list: VBoxContainer = $ui/body/left_body/search_vbox/scroll_container/match_list +@onready var search_vbox: VBoxContainer = $lobby_ui/body/left_body/search_vbox +@onready var match_search_input: LineEdit = $lobby_ui/body/left_body/search_vbox/search_hbox/match_search_input +@onready var match_list: VBoxContainer = $lobby_ui/body/left_body/search_vbox/scroll_container/match_list @onready var server: Node = $server diff --git a/scenes/ui_controls/lobby/ui.tscn b/scenes/ui/lobby/lobby_ui.tscn similarity index 98% rename from scenes/ui_controls/lobby/ui.tscn rename to scenes/ui/lobby/lobby_ui.tscn index 301d630..25a3523 100644 --- a/scenes/ui_controls/lobby/ui.tscn +++ b/scenes/ui/lobby/lobby_ui.tscn @@ -22,7 +22,7 @@ corner_radius_top_right = 3 corner_radius_bottom_right = 3 corner_radius_bottom_left = 3 -[node name="margin" type="MarginContainer"] +[node name="lobby_ui" type="MarginContainer"] anchors_preset = 15 anchor_right = 1.0 anchor_bottom = 1.0 diff --git a/scenes/data/data_bridge.tscn b/scripts/data/data_bridge.tscn similarity index 79% rename from scenes/data/data_bridge.tscn rename to scripts/data/data_bridge.tscn index 8ef7c85..77de9a8 100644 --- a/scenes/data/data_bridge.tscn +++ b/scripts/data/data_bridge.tscn @@ -1,9 +1,9 @@ [gd_scene load_steps=5 format=3 uid="uid://dy51wny4x53f4"] -[ext_resource type="Script" uid="uid://dbnl4tjahkoun" path="res://scenes/data/game_data.gd" id="1_l6w8l"] -[ext_resource type="Script" uid="uid://65x4bq2wsh8k" path="res://scenes/data/game_state.gd" id="2_6ash1"] -[ext_resource type="Script" uid="uid://dyq4p5e06ib14" path="res://scenes/data/lobby_data.gd" id="3_l6w8l"] -[ext_resource type="Script" uid="uid://uyimqfjmuc34" path="res://scenes/data/multiplayer_data.gd" id="4_gcm58"] +[ext_resource type="Script" uid="uid://dbnl4tjahkoun" path="res://scripts/data/game_data.gd" id="1_l6w8l"] +[ext_resource type="Script" uid="uid://65x4bq2wsh8k" path="res://scripts/data/game_state.gd" id="2_6ash1"] +[ext_resource type="Script" uid="uid://dyq4p5e06ib14" path="res://scripts/data/lobby_data.gd" id="3_l6w8l"] +[ext_resource type="Script" uid="uid://uyimqfjmuc34" path="res://scripts/data/multiplayer_data.gd" id="4_gcm58"] [node name="data_bridge" type="Node"] diff --git a/scenes/data/game_data.gd b/scripts/data/game_data.gd similarity index 100% rename from scenes/data/game_data.gd rename to scripts/data/game_data.gd diff --git a/scenes/data/game_data.gd.uid b/scripts/data/game_data.gd.uid similarity index 100% rename from scenes/data/game_data.gd.uid rename to scripts/data/game_data.gd.uid diff --git a/scenes/data/game_state.gd b/scripts/data/game_state.gd similarity index 100% rename from scenes/data/game_state.gd rename to scripts/data/game_state.gd diff --git a/scenes/data/game_state.gd.uid b/scripts/data/game_state.gd.uid similarity index 100% rename from scenes/data/game_state.gd.uid rename to scripts/data/game_state.gd.uid diff --git a/scenes/data/lobby_data.gd b/scripts/data/lobby_data.gd similarity index 100% rename from scenes/data/lobby_data.gd rename to scripts/data/lobby_data.gd diff --git a/scenes/data/lobby_data.gd.uid b/scripts/data/lobby_data.gd.uid similarity index 100% rename from scenes/data/lobby_data.gd.uid rename to scripts/data/lobby_data.gd.uid diff --git a/scenes/data/multiplayer_data.gd b/scripts/data/multiplayer_data.gd similarity index 100% rename from scenes/data/multiplayer_data.gd rename to scripts/data/multiplayer_data.gd diff --git a/scenes/data/multiplayer_data.gd.uid b/scripts/data/multiplayer_data.gd.uid similarity index 100% rename from scenes/data/multiplayer_data.gd.uid rename to scripts/data/multiplayer_data.gd.uid diff --git a/scripts/server_networking.gd b/scripts/server_networking.gd index 9ccf98b..ef7848a 100644 --- a/scripts/server_networking.gd +++ b/scripts/server_networking.gd @@ -35,6 +35,7 @@ func start_server(address: String = "0.0.0.0", port: int = 8080) -> void: func close_connection() -> void: if not peer: return + if not multiplayer: return push_warning("Server Closed...")