Add popup for error hosting
This commit is contained in:
parent
2de492785b
commit
3fb87e81a8
@ -132,6 +132,8 @@ impl NetworkManager {
|
||||
pub fn lobby_joined();
|
||||
#[signal]
|
||||
pub fn on_client_disconnected(error: GString);
|
||||
#[signal]
|
||||
pub fn on_error_hosting_server(error: GString);
|
||||
|
||||
fn poll(&mut self) -> Option<PeerMessage<Package>> {
|
||||
let mut cli = CommandLinePanel::singleton();
|
||||
@ -200,6 +202,11 @@ impl NetworkManager {
|
||||
Err(err) => {
|
||||
cli.bind_mut()
|
||||
.publish_message(format!("Error hosting server: {}", err), CliColor::Error);
|
||||
self.run_deferred(move |s| {
|
||||
s.signals()
|
||||
.on_error_hosting_server()
|
||||
.emit(&format!("{}", err))
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -73,6 +73,13 @@ impl INode3D for MainMenu {
|
||||
s.show_popup("Error", &msg.to_string(), true);
|
||||
}
|
||||
});
|
||||
NetworkManager::singleton()
|
||||
.bind_mut()
|
||||
.signals()
|
||||
.on_error_hosting_server()
|
||||
.connect_other(self, |s, msg| {
|
||||
s.show_popup("Error Hosting Server", &msg.to_string(), true);
|
||||
});
|
||||
}
|
||||
|
||||
fn process(&mut self, _delta: f64) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user