generated from tipragot/rust
This commit is contained in:
parent
d557bf6d02
commit
3c18d2409c
|
@ -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,
|
||||
}
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue