DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

f9208821d4ad1e194f7ccb15741c9842ddbaf305 — Jonni Liljamo 1 year, 9 months ago 579656c
feat(client): enable other game browse views
1 files changed, 16 insertions(+), 17 deletions(-)

M client/src/plugins/menu/ui/play/ui.rs
M client/src/plugins/menu/ui/play/ui.rs => client/src/plugins/menu/ui/play/ui.rs +16 -17
@@ 8,6 8,7 @@

use bevy::prelude::*;
use bevy_egui::{egui, EguiContexts};
use laurelin_shared::types::game::{GAMESTATE_FINISHED, GAMESTATE_INPROGRESS};

use crate::{
    cfg::CfgUser,


@@ 200,19 201,18 @@ fn browse_forming(ui: &mut egui::Ui, data: &mut PlayScreenData, cfg_user: &CfgUs
    }
}

fn browse_inprogress(ui: &mut egui::Ui, rtdmenu: &mut PlayScreenData) {
    /*
    if rtdmenu.waiting_for_my_games_call {
fn browse_inprogress(ui: &mut egui::Ui, data: &mut PlayScreenData) {
    if data.waiting_for_my_games {
        ui.horizontal(|ui| {
            ui.spinner();
            ui.label("loading...");
        });
    } else {
        if rtdmenu.my_games.is_empty() {
        if data.my_games.is_empty() {
            ui.label("No games found.");
        } else {
            let mut games = rtdmenu.my_games.clone();
            games.retain(|g| g.state == GameState::InProgress);
            let mut games = data.my_games.clone();
            games.retain(|g| g.state == GAMESTATE_INPROGRESS);

            for game in games {
                egui::Frame::none()


@@ 222,12 222,13 @@ fn browse_inprogress(ui: &mut egui::Ui, rtdmenu: &mut PlayScreenData) {
                    .inner_margin(4.)
                    .show(ui, |ui| {
                        ui.horizontal(|ui| {
                            ui.label(format!("Host: {}", game.host.username));
                            //ui.label(format!("Host: {}", game.host.username));
                            ui.label("Host: host-username-here");
                            ui.with_layout(
                                egui::Layout::right_to_left(egui::Align::Center),
                                |ui| {
                                    if ui.button("Resume").clicked() {
                                        rtdmenu.cur_game = Some(game.clone());
                                        data.cur_game = Some(game.clone());
                                        //resumegame_ev_w.send(ResumeGameEvent);
                                    }
                                },


@@ 237,22 238,20 @@ fn browse_inprogress(ui: &mut egui::Ui, rtdmenu: &mut PlayScreenData) {
            }
        }
    }
    */
}

fn browse_finished(ui: &mut egui::Ui, rtdmenu: &mut PlayScreenData) {
    /*
    if rtdmenu.waiting_for_my_games_call {
fn browse_finished(ui: &mut egui::Ui, data: &mut PlayScreenData) {
    if data.waiting_for_my_games {
        ui.horizontal(|ui| {
            ui.spinner();
            ui.label("loading...");
        });
    } else {
        if rtdmenu.my_games.is_empty() {
        if data.my_games.is_empty() {
            ui.label("No games found.");
        } else {
            let mut games = rtdmenu.my_games.clone();
            games.retain(|g| g.state == GameState::Finished);
            let mut games = data.my_games.clone();
            games.retain(|g| g.state == GAMESTATE_FINISHED);

            for game in games {
                egui::Frame::none()


@@ 262,11 261,11 @@ fn browse_finished(ui: &mut egui::Ui, rtdmenu: &mut PlayScreenData) {
                    .inner_margin(4.)
                    .show(ui, |ui| {
                        ui.horizontal(|ui| {
                            ui.label(format!("Host: {}", game.host.username));
                            ui.label("Host: host-username-here");
                            //ui.label(format!("Host: {}", game.host.username));
                        });
                    });
            }
        }
    }
    */
}