@@ 21,7 21,7 @@ use crate::{
plugins::menu::{
ui::{
connect::{ConnectScreenData, ConnectState},
- play::PlayScreenData,
+ play::{PlayScreenData, PlayScreenState},
},
MenuState,
},
@@ 84,7 84,10 @@ pub fn message_events(
for response in events.read::<DataRequestChannel, DataRequestResponse>() {
match DataRequestType::from_u8(&response.r#type) {
DataRequestType::GameCreate => {
- // TODO: set cur_game, send player to lobby screen
+ // TODO: handle possible error (unwrap,
+ // and if the response data is an error)
+ play_data.cur_game = serde_json::from_str(&response.data).unwrap();
+ play_data.state = PlayScreenState::InLobbyHost;
}
DataRequestType::GameAllForming => {
// TODO: handle possible error