DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

1809259d4ba12b2542fa465281503af35562d14b — skye 1 year, 7 months ago c5909cd
feat(client): update game details ui
1 files changed, 16 insertions(+), 3 deletions(-)

M client/src/plugins/game/ui/mod.rs
M client/src/plugins/game/ui/mod.rs => client/src/plugins/game/ui/mod.rs +16 -3
@@ 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));
                            });
                    }
                });
        });
}