diff --git a/voxygen/src/menu/char_selection/mod.rs b/voxygen/src/menu/char_selection/mod.rs index 1537833c1b..7afb19b336 100644 --- a/voxygen/src/menu/char_selection/mod.rs +++ b/voxygen/src/menu/char_selection/mod.rs @@ -55,10 +55,10 @@ impl PlayState for CharSelectionState { global_state.window.renderer_mut().clear(); // Maintain the UI. - for event in self + let events = self .char_selection_ui - .maintain(global_state.window.renderer_mut()) - { + .maintain(global_state.window.renderer_mut(), &self.client.borrow()); + for event in events { match event { ui::Event::Logout => { return PlayStateResult::Pop; diff --git a/voxygen/src/menu/char_selection/ui.rs b/voxygen/src/menu/char_selection/ui.rs index b3ed0de920..4102e38807 100644 --- a/voxygen/src/menu/char_selection/ui.rs +++ b/voxygen/src/menu/char_selection/ui.rs @@ -7,6 +7,7 @@ use crate::{ }, window::Window, }; +use client::Client; use common::comp::{humanoid, item::Weapon}; use conrod_core::{ color, @@ -235,7 +236,7 @@ impl CharSelectionUi { } // TODO: Split this into multiple modules or functions. - fn update_layout(&mut self) -> Vec { + fn update_layout(&mut self, client: &Client) -> Vec { let mut events = Vec::new(); let ref mut ui_widgets = self.ui.set_widgets(); let version = env!("CARGO_PKG_VERSION"); @@ -270,7 +271,7 @@ impl CharSelectionUi { .rgba(0.0, 0.0, 0., 0.0) .set(self.ids.selection_scrollbar, ui_widgets); // Server Name - Text::new("Server Name") //TODO: Add in Server Name + Text::new(&client.server_info.name) .mid_top_with_margin_on(self.ids.server_frame_bg, 5.0) .font_size(24) .font_id(self.fonts.metamorph) @@ -1064,8 +1065,8 @@ impl CharSelectionUi { self.ui.handle_event(event); } - pub fn maintain(&mut self, renderer: &mut Renderer) -> Vec { - let events = self.update_layout(); + pub fn maintain(&mut self, renderer: &mut Renderer, client: &Client) -> Vec { + let events = self.update_layout(client); self.ui.maintain(renderer, None); events }