diff --git a/scene/GameScene.tscn b/scene/GameScene.tscn index 34c79f9..b8a5a71 100644 --- a/scene/GameScene.tscn +++ b/scene/GameScene.tscn @@ -1,4 +1,4 @@ -[gd_scene load_steps=8 format=2] +[gd_scene load_steps=9 format=2] [ext_resource path="res://scene/EscapeMenu.tscn" type="PackedScene" id=1] [ext_resource path="res://src/Cursor.cs" type="Script" id=2] @@ -7,6 +7,7 @@ [ext_resource path="res://scene/Player.tscn" type="PackedScene" id=5] [ext_resource path="res://scene/Block.tscn" type="PackedScene" id=6] [ext_resource path="res://src/Viewport.cs" type="Script" id=7] +[ext_resource path="res://src/Network.cs" type="Script" id=8] [node name="Game" type="Node"] script = ExtResource( 3 ) @@ -17,6 +18,7 @@ Block = ExtResource( 6 ) script = ExtResource( 7 ) [node name="Network" type="Node" parent="."] +script = ExtResource( 8 ) [node name="HUD" type="CanvasLayer" parent="."] diff --git a/src/EscapeMenu.cs b/src/EscapeMenu.cs index 30df466..05a90f3 100644 --- a/src/EscapeMenu.cs +++ b/src/EscapeMenu.cs @@ -1,14 +1,8 @@ -using System; -using System.Collections.Generic; -using System.Linq; using Godot; // TODO: Split network and escape menu logic. public class EscapeMenu : Container { - [Export] public ushort DefaultPort { get; set; } = 42005; - [Export] public string DefaultAddress { get; set; } = "localhost"; - [Export] public NodePath StatusPath { get; set; } [Export] public NodePath ServerStartStopPath { get; set; } [Export] public NodePath ServerPortPath { get; set; } @@ -23,14 +17,7 @@ public class EscapeMenu : Container public LineEdit ClientAddress { get; private set; } public Button Return { get; private set; } - public Node PlayerContainer { get; private set; } - public Player OwnPlayer { get; private set; } - public PackedScene OtherPlayer { get; private set; } - - public override void _Ready() - { - OtherPlayer = GD.Load("res://scene/OtherPlayer.tscn"); - } + public Network Network { get; private set; } public override void _EnterTree() { @@ -40,23 +27,11 @@ public class EscapeMenu : Container ClientDisConnect = GetNode