generated from tipragot/rust
Change of file structure for scenes #38
No reviewers
Labels
No labels
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Fix
Kind/Security
Kind/Testing
No milestone
No project
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: fish-cannard/border-wars#38
Loading…
Reference in a new issue
No description provided.
Delete branch "restruct-menus"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@ -3,3 +3,3 @@
use bevy::prelude::*;
pub mod menu;
pub mod menus;
I think we should call them scenes.
Change of file structure for menusto Change of file structure for scenes@ -0,0 +6,4 @@
pub mod menu;
/// The plugin for all menus.
pub struct MenusPlugin;
Rename this to ScenePlugin
@ -0,0 +12,4 @@
fn build(&self, app: &mut App) {
app.add_systems(
Update,
menu_ui.run_if(state_exists_and_equals(GameState::Menu)),
Change GameState to CurrentScene or Scene
@ -0,0 +1,15 @@
//! The file containing all menu programs.
scenes not menu
@ -5,3 +5,3 @@
pub mod menu;
pub mod scenes;
/// The state of the game.
Rename
@ -9,3 +9,2 @@
.add_plugins(DefaultPlugins)
.add_state::<GameState>()
.add_plugins(MenuPlugin)
.add_state::<CurrentScene>()
Add it in the ScenesPlugin instead.
If the resource is always initialized, there is no need to check for existence. Use in_state instead.
@ -0,0 +17,4 @@
fn menu_ui(
mut ctx: EguiContexts,
mut connection_string: Local<String>,
mut next_state: ResMut<NextState<CurrentScene>>,
next_scene