mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Tick client when in server info menu
This commit is contained in:
parent
f991a5677f
commit
e4dbe50f39
@ -12,7 +12,10 @@ use crate::{
|
|||||||
Direction, GlobalState, PlayState, PlayStateResult,
|
Direction, GlobalState, PlayState, PlayStateResult,
|
||||||
};
|
};
|
||||||
use client::ServerInfo;
|
use client::ServerInfo;
|
||||||
use common::assets::{self, AssetExt};
|
use common::{
|
||||||
|
assets::{self, AssetExt},
|
||||||
|
comp,
|
||||||
|
};
|
||||||
use common_base::span;
|
use common_base::span;
|
||||||
use i18n::LocalizationHandle;
|
use i18n::LocalizationHandle;
|
||||||
use iced::{
|
use iced::{
|
||||||
@ -23,6 +26,7 @@ use std::{
|
|||||||
collections::hash_map::DefaultHasher,
|
collections::hash_map::DefaultHasher,
|
||||||
hash::{Hash, Hasher},
|
hash::{Hash, Hasher},
|
||||||
};
|
};
|
||||||
|
use tracing::error;
|
||||||
|
|
||||||
image_ids_ice! {
|
image_ids_ice! {
|
||||||
struct Imgs {
|
struct Imgs {
|
||||||
@ -164,6 +168,20 @@ impl PlayState for ServerInfoState {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if let Some(char_select) = &mut self.char_select {
|
||||||
|
if let Err(err) = char_select
|
||||||
|
.client()
|
||||||
|
.borrow_mut()
|
||||||
|
.tick(comp::ControllerInputs::default(), global_state.clock.dt())
|
||||||
|
{
|
||||||
|
let i18n = &global_state.i18n.read();
|
||||||
|
global_state.info_message =
|
||||||
|
Some(i18n.get_msg("common-connection_lost").into_owned());
|
||||||
|
error!(?err, "[server_info] Failed to tick the client");
|
||||||
|
return PlayStateResult::Pop;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Maintain the UI.
|
// Maintain the UI.
|
||||||
let view = self.controls.view();
|
let view = self.controls.view();
|
||||||
let (messages, _) = self.ui.maintain(
|
let (messages, _) = self.ui.maintain(
|
||||||
|
Loading…
Reference in New Issue
Block a user