Merge branch 'main-menu' of https://git.tipragot.fr/corentin/border-wars into main-menu

This commit is contained in:
CoCo_Sol 2024-02-10 00:18:39 +01:00
commit 4a4a53be85
3 changed files with 8 additions and 6 deletions

View file

@ -1,9 +1,10 @@
//! The file that contains utility functions, enums, structs of the game.
use std::default::Default;
use bevy::prelude::*;
pub mod menu;
#[derive(Debug, Clone, Copy, Default, Eq, PartialEq, Hash, States)]
pub enum GameState {
#[default]

View file

@ -1,11 +1,8 @@
//! The main entry point of the game.
use bevy::prelude::*;
use lib::GameState;
use menu::MenuPlugin;
mod lib;
mod menu;
use border_wars::menu::MenuPlugin;
use border_wars::GameState;
fn main() {
App::new()

View file

@ -12,6 +12,10 @@ pub struct MenuPlugin;
impl Plugin for MenuPlugin {
/// A function that is called when the plugin is added to the application.
fn build(&self, app: &mut App) {
app.add_plugins(EguiPlugin).add_systems(
Update,
(ui_connect_window, ui_host_window).run_if(in_state(GameState::Menu)),
);
println!("{:?}", app.world.resource::<State<GameState>>());
app.add_plugins(EguiPlugin).add_systems(
Update,