Skip to content

Commit

Permalink
Fix queued level-ups
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Jul 28, 2024
1 parent 22dfaed commit b30bff0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/game/actor/level/up.rs
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
use bevy::prelude::*;
use bevy_kira_audio::prelude::*;
use pyri_state::prelude::*;

use crate::core::UpdateSet;
use crate::game::actor::level::xp::Xp;
use crate::game::actor::level::Level;
use crate::game::actor::level::LevelConfig;
use crate::screen::playing::PlayingAssets;
use crate::screen::playing::PlayingMenu;
use crate::util::prelude::*;

// TODO: System that enters level up menu on LevelUp event.
pub(super) fn plugin(app: &mut App) {
app.configure::<LevelUp>();
}
Expand All @@ -27,8 +28,9 @@ impl Configure for LevelUp {
.in_set(UpdateSet::Update)
.run_if(on_event::<Self>()),
update_level_up_from_xp.in_set(UpdateSet::TriggerLevelUp),
// TODO: Only run if not in level up menu.
trigger_level_up.in_set(UpdateSet::TriggerLevelUp),
trigger_level_up
.in_set(UpdateSet::TriggerLevelUp)
.run_if(PlayingMenu::is_disabled),
)
.chain(),
);
Expand Down
2 changes: 1 addition & 1 deletion src/screen/playing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ impl Configure for PlayingAction {
#[derive(State, Eq, PartialEq, Clone, Debug, Reflect)]
#[state(after(Screen), before(Pause), entity_scope, log_flush)]
#[reflect(Resource)]
enum PlayingMenu {
pub enum PlayingMenu {
Pause,
LevelUp,
Victory,
Expand Down

0 comments on commit b30bff0

Please sign in to comment.