@@ 33,6 33,7 @@ services:
- internal
ports:
- "8080:3000"
+ - "3000:3000"
environment:
GIN_MODE: "release" # or "debug" for debug logs
LAURELINAPI_JWT_SECRET: "XpNYdG7vgvgPPuezrtZqt4CJIUuxNP7c"
@@ 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)));
}
}
@@ 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>,
) {