DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

81e1eca058f9e29e271305564336ef3e1016d9f3 — Jonni Liljamo 1 year, 10 months ago 0636c38
feat(sdbclient): better browse
1 files changed, 35 insertions(+), 18 deletions(-)

M sdbclient/src/plugins/menu/play/ui.rs
M sdbclient/src/plugins/menu/play/ui.rs => sdbclient/src/plugins/menu/play/ui.rs +35 -18
@@ 59,22 59,24 @@ pub(super) fn show(

            match rtdmenu.play_menu_ui_state {
                PlayMenuUIState::Main => {
                    egui::SidePanel::left("play_side_panel").show_inside(ui, |ui| {
                        ui.vertical_centered(|ui| {
                            if ui.button("Create").clicked() {
                                rtdmenu.play_menu_ui_state = PlayMenuUIState::CreateGame
                            }
                    egui::SidePanel::left("play_side_panel")
                        .resizable(false)
                        .show_inside(ui, |ui| {
                            ui.vertical_centered(|ui| {
                                if ui.button("Create").clicked() {
                                    rtdmenu.play_menu_ui_state = PlayMenuUIState::CreateGame
                                }

                            if ui.button("Refresh Browse").clicked() {
                                allforming_ev_w.send(AllFormingEvent);
                            }
                                if ui.button("Refresh Browse").clicked() {
                                    allforming_ev_w.send(AllFormingEvent);
                                }

                            if ui.button("Back").clicked() {
                                commands.insert_resource(NextState(PlayMenuState::None));
                                commands.insert_resource(NextState(MenuState::Main));
                            }
                                if ui.button("Back").clicked() {
                                    commands.insert_resource(NextState(PlayMenuState::None));
                                    commands.insert_resource(NextState(MenuState::Main));
                                }
                            });
                        });
                    });

                    match rtdmenu.waiting_for_all_forming_call {
                        true => {


@@ 92,14 94,29 @@ pub(super) fn show(
                                        }
                                        false => {
                                            for game in &rtdmenu.all_forming_games {
                                                egui::Frame::none().show(ui, |ui| {
                                                    ui.horizontal(|ui| {
                                                        ui.label(format!("Host: {}", game.p1));
                                                egui::Frame::none()
                                                    .fill(egui::Color32::BLACK)
                                                    .outer_margin(4.)
                                                    .inner_margin(4.)
                                                    .show(ui, |ui| {
                                                        ui.horizontal(|ui| {
                                                            ui.label(format!("Host: {}", game.p1));
                                                            ui.with_layout(
                                                                egui::Layout::right_to_left(
                                                                    egui::Align::Center,
                                                                ),
                                                                |ui| {
                                                                    if ui.button("Join").clicked() {
                                                                        todo!();
                                                                    }
                                                                },
                                                            );
                                                        });
                                                    });
                                                });
                                            }
                                        }
                                    });
                                    }
                                });
                            });
                        }
                    }