DEVELOPMENT ENVIRONMENT

~liljamo/deck-builder

11a6eebf7245d5b4c62b57a9978dfb9aa43778bb — Jonni Liljamo 1 year, 7 months ago 9bd1c06
feat(client): game ui plugin, ui -> details_ui
3 files changed, 14 insertions(+), 6 deletions(-)

M api/docker-compose.yaml
M client/src/plugins/game/mod.rs
M client/src/plugins/game/ui/mod.rs
M api/docker-compose.yaml => api/docker-compose.yaml +1 -0
@@ 33,6 33,7 @@ services:
      - internal
    ports:
      - "8080:3000"
      - "3000:3000"
    environment:
      GIN_MODE: "release" # or "debug" for debug logs
      LAURELINAPI_JWT_SECRET: "XpNYdG7vgvgPPuezrtZqt4CJIUuxNP7c"

M client/src/plugins/game/mod.rs => client/src/plugins/game/mod.rs +2 -2
@@ 19,8 19,8 @@ pub struct GamePlugin;
impl Plugin for GamePlugin {
    fn build(&self, app: &mut App) {
        app.insert_resource(GameData::default())
            .add_system(game_setup.in_schedule(OnEnter(AppState::InGame)))
            .add_system(ui::ui.run_if(in_state(AppState::InGame)));
            .add_plugin(ui::GameUIPlugin)
            .add_system(game_setup.in_schedule(OnEnter(AppState::InGame)));
    }
}


M client/src/plugins/game/ui/mod.rs => client/src/plugins/game/ui/mod.rs +11 -4
@@ 9,15 9,22 @@
use bevy::prelude::*;
use bevy_egui::{egui, EguiContexts};

use crate::{plugins::{GameDetailsCallEvent, GameActionCreateCallEvent}, Global, api::game::{Action, Command, Game}, game_status::{Card, PlayerState}};
use crate::{plugins::{GameDetailsCallEvent, GameActionCreateCallEvent}, Global, api::game::{Action, Command, Game}, game_status::{Card, PlayerState}, AppState};

use super::GameData;

pub fn ui(
    mut commands: Commands,
pub struct GameUIPlugin;

impl Plugin for GameUIPlugin {
    fn build(&self, app: &mut App) {
        app.add_system(details_ui.run_if(in_state(AppState::InGame)));
    }
}

pub fn details_ui(
    mut contexts: EguiContexts,
    global: Res<Global>,
    mut game_data: ResMut<GameData>,
    game_data: Res<GameData>,
    mut details_ev_w: EventWriter<GameDetailsCallEvent>,
    mut create_action_ev_w: EventWriter<GameActionCreateCallEvent>,
) {