Rename player_listing to lobby_player_listing

This commit is contained in:
Sofia 2026-07-22 20:30:32 +03:00
parent 76d8899b1d
commit dbc2d39219
5 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
[gd_scene format=3 uid="uid://bwd6bj21x310s"] [gd_scene format=3 uid="uid://bwd6bj21x310s"]
[ext_resource type="PackedScene" uid="uid://ccd0wj2usx5os" path="res://scenes/ui/player_listing.tscn" id="1_o1atq"] [ext_resource type="PackedScene" uid="uid://ccd0wj2usx5os" path="res://scenes/ui/lobby_player_listing.tscn" id="1_o1atq"]
[sub_resource type="LabelSettings" id="LabelSettings_1cgct"] [sub_resource type="LabelSettings" id="LabelSettings_1cgct"]
font_size = 32 font_size = 32

View File

@ -1,11 +1,11 @@
[gd_scene format=3 uid="uid://ccd0wj2usx5os"] [gd_scene format=3 uid="uid://ccd0wj2usx5os"]
[node name="player_listing" type="PlayerListing" unique_id=772938280 node_paths=PackedStringArray("name_label", "ping_label", "ready_label", "team_dropdown")] [node name="lobby_player_listing" type="LobbyPlayerListing" unique_id=887620055 node_paths=PackedStringArray("name_label", "ping_label", "ready_label", "team_dropdown")]
name_label = NodePath("name") name_label = NodePath("name")
ping_label = NodePath("ping") ping_label = NodePath("ping")
ready_label = NodePath("ready") ready_label = NodePath("ready")
team_dropdown = NodePath("option_button") team_dropdown = NodePath("option_button")
offset_right = 319.0 offset_right = 673.0
offset_bottom = 23.0 offset_bottom = 23.0
columns = 4 columns = 4

View File

@ -11,7 +11,7 @@ use godot::{
use crate::{ use crate::{
game_manager::{Game, GameManager, GameOption, GameOptionValue, GameOptions}, game_manager::{Game, GameManager, GameOption, GameOptionValue, GameOptions},
net::network_manager::{NetworkManager, Package, PeerKind}, net::network_manager::{NetworkManager, Package, PeerKind},
ui::player_listing::PlayerListing, ui::lobby_player_listing::LobbyPlayerListing,
}; };
#[derive(GodotClass)] #[derive(GodotClass)]
@ -239,7 +239,7 @@ impl LobbyPanel {
if let Some(prefab) = &self.player_listing_prefab { if let Some(prefab) = &self.player_listing_prefab {
for player in &game.bind().players { for player in &game.bind().players {
if let Some(node) = prefab.instantiate() { if let Some(node) = prefab.instantiate() {
let mut listing = node.cast::<PlayerListing>(); let mut listing = node.cast::<LobbyPlayerListing>();
listing.bind_mut().player_id = Some(player.id()); listing.bind_mut().player_id = Some(player.id());
listing.bind_mut().update_teams(game.bind().get_teams()); listing.bind_mut().update_teams(game.bind().get_teams());
listing.bind_mut().update(); listing.bind_mut().update();
@ -250,7 +250,7 @@ impl LobbyPanel {
} }
} else { } else {
for child in list.get_children().iter_shared() { for child in list.get_children().iter_shared() {
let mut listing = child.cast::<PlayerListing>(); let mut listing = child.cast::<LobbyPlayerListing>();
if let Some(game) = Game::singleton() { if let Some(game) = Game::singleton() {
listing.bind_mut().update_teams(game.bind().get_teams()); listing.bind_mut().update_teams(game.bind().get_teams());
} }

View File

@ -11,7 +11,7 @@ use crate::{
#[derive(GodotClass)] #[derive(GodotClass)]
#[class(base=GridContainer, init)] #[class(base=GridContainer, init)]
pub struct PlayerListing { pub struct LobbyPlayerListing {
#[export] #[export]
pub name_label: Option<Gd<Label>>, pub name_label: Option<Gd<Label>>,
#[export] #[export]
@ -27,7 +27,7 @@ pub struct PlayerListing {
} }
#[godot_api] #[godot_api]
impl IGridContainer for PlayerListing { impl IGridContainer for LobbyPlayerListing {
fn ready(&mut self) { fn ready(&mut self) {
self.run_deferred(|s| { self.run_deferred(|s| {
if let Some(game) = &mut Game::singleton() { if let Some(game) = &mut Game::singleton() {
@ -65,7 +65,7 @@ impl IGridContainer for PlayerListing {
} }
} }
impl PlayerListing { impl LobbyPlayerListing {
pub fn update_game_options(&mut self, opts: &GameOptions, self_id: Option<u16>) { pub fn update_game_options(&mut self, opts: &GameOptions, self_id: Option<u16>) {
let is_host = NetworkManager::singleton().bind().is_host(); let is_host = NetworkManager::singleton().bind().is_host();

View File

@ -1,5 +1,5 @@
pub mod cli; pub mod cli;
pub mod lobby; pub mod lobby;
pub mod lobby_player_listing;
pub mod net_stats; pub mod net_stats;
pub mod player_listing;
pub mod simple_score_view; pub mod simple_score_view;