@@ 26,6 26,11 @@ pub fn ui(
// early return if game is None
return;
};
+ let Some(status) = &game_data.game_status else {
+ // early return if game_status is None
+ return;
+ };
+
if ui.button("Refresh").clicked() {
details_ev_w.send(GameDetailsCallEvent {
game_id: game_data.game.as_ref().unwrap().id.clone(),
@@ 34,17 39,25 @@ pub fn ui(
ui.separator();
- egui::CollapsingHeader::new("Users")
+ egui::CollapsingHeader::new("Game")
.default_open(true)
.show(ui, |ui| {
ui.label(format!("Host: {}", game.host.as_ref().unwrap().username));
ui.label(format!("Guest: {}", game.guest.as_ref().unwrap().username));
+
+ ui.label(format!("State: {:?}", game.state));
});
- egui::CollapsingHeader::new("State")
+ egui::CollapsingHeader::new("Supply Piles")
.default_open(true)
.show(ui, |ui| {
- ui.label(format!("Game: {:?}", game.state));
+ for pile in &status.supply_piles {
+ egui::CollapsingHeader::new(&pile.card.name)
+ .default_open(true)
+ .show(ui, |ui| {
+ ui.label(format!("Amount: {}", pile.amount));
+ });
+ }
});
});
}