From fc8bb540db0394de703e5e961a05eca34660aa3f Mon Sep 17 00:00:00 2001 From: Chris Bell Date: Fri, 13 Dec 2024 10:50:00 -0600 Subject: [PATCH] Added stuff to the lobby scene --- assets/core/networking/scenes/lobby.tscn | 11 +++++++++-- assets/core/networking/scripts/NetworkManager.gd | 2 +- assets/core/networking/scripts/lobby.gd | 2 +- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/assets/core/networking/scenes/lobby.tscn b/assets/core/networking/scenes/lobby.tscn index 5740019..9fea78a 100644 --- a/assets/core/networking/scenes/lobby.tscn +++ b/assets/core/networking/scenes/lobby.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=2 format=3 uid="uid://7t1x82gvrw8a"] +[gd_scene load_steps=3 format=3 uid="uid://7t1x82gvrw8a"] [ext_resource type="Script" path="res://assets/core/networking/scripts/lobby.gd" id="1_o4fbq"] +[ext_resource type="PackedScene" uid="uid://biryul3n6thlw" path="res://assets/core/networking/scenes/user_box_prefab.tscn" id="2_dpthk"] -[node name="Lobby" type="Control"] +[node name="Lobby" type="Control" node_paths=PackedStringArray("host_button", "join_button", "leave_button", "lobby_id", "user_list_box")] layout_mode = 3 anchors_preset = 15 anchor_right = 1.0 @@ -10,6 +11,12 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 script = ExtResource("1_o4fbq") +host_button = NodePath("Panel/HBoxContainer/Buttons/Host") +join_button = NodePath("Panel/HBoxContainer/Buttons/HBoxContainer/Join") +leave_button = NodePath("Panel/HBoxContainer/Buttons/Leave") +lobby_id = NodePath("Panel/HBoxContainer/Buttons/HBoxContainer/LineEdit") +user_list_box = NodePath("Panel/HBoxContainer/PlayerList") +user_box_prefab = ExtResource("2_dpthk") [node name="Panel" type="Panel" parent="."] layout_mode = 1 diff --git a/assets/core/networking/scripts/NetworkManager.gd b/assets/core/networking/scripts/NetworkManager.gd index 27c95e9..b4df001 100644 --- a/assets/core/networking/scripts/NetworkManager.gd +++ b/assets/core/networking/scripts/NetworkManager.gd @@ -309,4 +309,4 @@ func get_player_avatar(user_id: int) -> ImageTexture: if avatar_texture_cache.has(user_id): return avatar_texture_cache[user_id] else: - return await request_player_avatar(user_id) \ No newline at end of file + return await request_player_avatar(user_id) diff --git a/assets/core/networking/scripts/lobby.gd b/assets/core/networking/scripts/lobby.gd index 7d0a85c..2ae2682 100644 --- a/assets/core/networking/scripts/lobby.gd +++ b/assets/core/networking/scripts/lobby.gd @@ -59,4 +59,4 @@ func _on_user_left_lobby(user_id:int): for child in user_list_box.get_children(): if child.get_node("Username").text == str(user_id): user_list_box.remove_child(child) - break \ No newline at end of file + break