Rename player_listing to lobby_player_listing
This commit is contained in:
parent
5a244a9aaf
commit
3f5072e529
@ -1,6 +1,6 @@
|
||||
[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"]
|
||||
font_size = 32
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
[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")
|
||||
ping_label = NodePath("ping")
|
||||
ready_label = NodePath("ready")
|
||||
team_dropdown = NodePath("option_button")
|
||||
offset_right = 319.0
|
||||
offset_right = 673.0
|
||||
offset_bottom = 23.0
|
||||
columns = 4
|
||||
|
||||
@ -11,7 +11,7 @@ use godot::{
|
||||
use crate::{
|
||||
game_manager::{Game, GameManager, GameOption, GameOptionValue, GameOptions},
|
||||
net::network_manager::{NetworkManager, Package, PeerKind},
|
||||
ui::player_listing::PlayerListing,
|
||||
ui::lobby_player_listing::LobbyPlayerListing,
|
||||
};
|
||||
|
||||
#[derive(GodotClass)]
|
||||
@ -239,7 +239,7 @@ impl LobbyPanel {
|
||||
if let Some(prefab) = &self.player_listing_prefab {
|
||||
for player in &game.bind().players {
|
||||
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().update_teams(game.bind().get_teams());
|
||||
listing.bind_mut().update();
|
||||
@ -250,7 +250,7 @@ impl LobbyPanel {
|
||||
}
|
||||
} else {
|
||||
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() {
|
||||
listing.bind_mut().update_teams(game.bind().get_teams());
|
||||
}
|
||||
|
||||
@ -11,7 +11,7 @@ use crate::{
|
||||
|
||||
#[derive(GodotClass)]
|
||||
#[class(base=GridContainer, init)]
|
||||
pub struct PlayerListing {
|
||||
pub struct LobbyPlayerListing {
|
||||
#[export]
|
||||
pub name_label: Option<Gd<Label>>,
|
||||
#[export]
|
||||
@ -27,7 +27,7 @@ pub struct PlayerListing {
|
||||
}
|
||||
|
||||
#[godot_api]
|
||||
impl IGridContainer for PlayerListing {
|
||||
impl IGridContainer for LobbyPlayerListing {
|
||||
fn ready(&mut self) {
|
||||
self.run_deferred(|s| {
|
||||
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>) {
|
||||
let is_host = NetworkManager::singleton().bind().is_host();
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
pub mod cli;
|
||||
pub mod lobby;
|
||||
pub mod lobby_player_listing;
|
||||
pub mod net_stats;
|
||||
pub mod player_listing;
|
||||
pub mod simple_score_view;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user