mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Added handling for connection errors that occur before client leaves login screen
This commit is contained in:
@ -24,6 +24,7 @@ use crate::settings::Settings;
|
|||||||
use common::assets::{self, AssetExt};
|
use common::assets::{self, AssetExt};
|
||||||
use rand::{seq::SliceRandom, thread_rng};
|
use rand::{seq::SliceRandom, thread_rng};
|
||||||
use std::time::Duration;
|
use std::time::Duration;
|
||||||
|
use tracing::warn;
|
||||||
|
|
||||||
// TODO: what is this? (showed up in rebase)
|
// TODO: what is this? (showed up in rebase)
|
||||||
//const COL1: Color = Color::Rgba(0.07, 0.1, 0.1, 0.9);
|
//const COL1: Color = Color::Rgba(0.07, 0.1, 0.1, 0.9);
|
||||||
@ -455,11 +456,15 @@ impl Controls {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn connection_error(&mut self, error: String) {
|
fn connection_error(&mut self, error: String) {
|
||||||
if matches!(&self.screen, Screen::Connecting { .. }) {
|
if matches!(&self.screen, Screen::Connecting { .. })
|
||||||
|
|| matches!(&self.screen, Screen::Login { .. })
|
||||||
|
{
|
||||||
self.screen = Screen::Login {
|
self.screen = Screen::Login {
|
||||||
screen: Box::new(login::Screen::new()),
|
screen: Box::new(login::Screen::new()),
|
||||||
error: Some(error),
|
error: Some(error),
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
warn!("connection_error invoked on unhandled screen!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user