Implementing main view and main menu
This commit is contained in:
parent
dead6c133c
commit
b3c0bf53a4
6 changed files with 3368 additions and 38 deletions
3329
Cargo.lock
generated
3329
Cargo.lock
generated
File diff suppressed because it is too large
Load diff
|
@ -9,5 +9,5 @@ repository.workspace = true
|
||||||
desktop = ["progress-pile-client/desktop"]
|
desktop = ["progress-pile-client/desktop"]
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bevy = { version = "0.16.0", default-features = false }
|
bevy.version = "0.16.0"
|
||||||
progress-pile-client.workspace = true
|
progress-pile-client.workspace = true
|
||||||
|
|
|
@ -1,3 +1,41 @@
|
||||||
fn main() {
|
mod plugins;
|
||||||
println!("Hello, world!");
|
|
||||||
|
use bevy::prelude::*;
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Default, Eq, PartialEq, Debug, Hash, States)]
|
||||||
|
enum AppState {
|
||||||
|
#[default]
|
||||||
|
MainView,
|
||||||
|
Setting,
|
||||||
|
List,
|
||||||
|
Graph
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Resource, Debug, Component, PartialEq, Eq, Clone, Copy)]
|
||||||
|
enum DisplayQuality {
|
||||||
|
Low,
|
||||||
|
Medium,
|
||||||
|
High,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Resource, Debug, Component, PartialEq, Eq, Clone, Copy)]
|
||||||
|
struct Volume(u32);
|
||||||
|
|
||||||
|
#[derive(Resource, Debug, Component, PartialEq, Eq, Clone, Copy)]
|
||||||
|
enum ViewerMode {
|
||||||
|
PokerTip2D,
|
||||||
|
PokerTip3D,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
App::new()
|
||||||
|
.add_plugins(DefaultPlugins)
|
||||||
|
.insert_resource(DisplayQuality::Medium)
|
||||||
|
.insert_resource(Volume(7))
|
||||||
|
.insert_resource(ViewerMode::PokerTip2D)
|
||||||
|
.init_state::<AppState>()
|
||||||
|
.add_systems(Startup, setup)
|
||||||
|
.add_plugins(((plugins::main_menu::menu_plugin, plugins::main_view::main_view_plugin)))
|
||||||
|
.run();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
31
progress-pile-app/src/plugins/main_menu.rs
Normal file
31
progress-pile-app/src/plugins/main_menu.rs
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
use bevy::{
|
||||||
|
app::AppExit,
|
||||||
|
color::palettes::css::CRIMSON,
|
||||||
|
ecs::spawn::{SpawnIter, SpawnWith},
|
||||||
|
prelude::*,
|
||||||
|
};
|
||||||
|
|
||||||
|
use super::{
|
||||||
|
DisplayQuality,
|
||||||
|
GameState,
|
||||||
|
Volume,
|
||||||
|
};
|
||||||
|
|
||||||
|
#[derive(Clone, Copy, Default, Eq, PartialEq, Debug, Hash, States)]
|
||||||
|
enum SettingsState {
|
||||||
|
Main,
|
||||||
|
#[default]
|
||||||
|
Disabled,
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn menu_plugin(app: &mut App) {
|
||||||
|
app
|
||||||
|
.init_state::<MenuState>()
|
||||||
|
.add_systems(OnEnter(GamsState::Settin), menu_setup)
|
||||||
|
.add_systems(OnEnter(MenuState::Main), main_menu_setup)
|
||||||
|
.add_systems(OnExit(MenuState::Main), despawn_screen::<OnMainMenuScreen>)
|
||||||
|
.add_ssytems(OnEnter(MenuState::Settings), settings_menu_setup)
|
||||||
|
.add_systems(
|
||||||
|
OnExit(MenuState::Setting)
|
||||||
|
)
|
||||||
|
}
|
0
progress-pile-app/src/plugins/main_view.rs
Normal file
0
progress-pile-app/src/plugins/main_view.rs
Normal file
2
progress-pile-app/src/plugins/mod.rs
Normal file
2
progress-pile-app/src/plugins/mod.rs
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
pub mod main_menu;
|
||||||
|
pub mod main_view;
|
Loading…
Add table
Reference in a new issue