update
Some checks failed
Rust Checks / checks (push) Failing after 13m55s

This commit is contained in:
CoCo_Sol 2024-03-17 19:19:23 +01:00
parent d557bf6d02
commit 3c18d2409c
2 changed files with 7 additions and 4 deletions

View file

@ -32,12 +32,16 @@ pub struct RequestConnection {
/// The message sent in order to update the list of players.
#[derive(Deserialize, Serialize, Event)]
pub struct AddPlayer {
/// The uuid of the new player.
pub uuid: Uuid,
/// The name of the new player.
pub name: String,
}
/// The packet sent when a player is removed.
#[derive(Event, Deserialize, Serialize)]
pub struct RemovePlayer {
/// The uuid of the player.
pub uuid: Uuid,
}

View file

@ -31,10 +31,6 @@ fn menu_ui(
return;
};
let Ok(target_uuid) = Uuid::parse_str(&connection_string) else {
return;
};
egui::CentralPanel::default().show(ctx.ctx_mut(), |ui| {
ui.heading("Border Wars");
@ -45,6 +41,9 @@ fn menu_ui(
ui.label("Game ID: ");
ui.text_edit_singleline(&mut *connection_string);
let Ok(target_uuid) = Uuid::parse_str(&connection_string) else {
return;
};
if ui.button("Join").clicked() {
next_scene.set(CurrentScene::Lobby);
request_join_event.send(SendTo(