Skip to content

Commit

Permalink
Fix crash at startup
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Dec 8, 2023
1 parent 113f642 commit 505b150
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 3 additions & 2 deletions src/state/editor_screen/outline_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@ use bevy::prelude::*;
use bevy::ui::Val::*;
use bevy::utils::HashMap;

use super::ActiveEditorTheme;
use crate::simulation::Simulation;
use crate::state::editor_screen::ActiveEditorTheme;
use crate::state::editor_screen::EditorScreenTheme;
use crate::state::AppState;
use crate::ui::FontSize;
use crate::ui::InteractionPalette;
use crate::ui::Tooltip;
Expand All @@ -28,7 +29,7 @@ impl Plugin for OutlinePanelPlugin {
.add_systems(
Update,
(
update_outline_container,
update_outline_container.run_if(in_state(AppState::EditorScreen)),
update_outline_header,
update_outline_entry_text.run_if(on_event::<UpgradeEvent>()),
)
Expand Down
7 changes: 3 additions & 4 deletions src/state/editor_screen/upgrade_panel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use bevy::prelude::*;
use bevy::ui::Val::*;
use bevy_mod_picking::prelude::*;

use super::ActiveEditorTheme;
use crate::simulation::Simulation;
use crate::state::editor_screen::ActiveEditorTheme;
use crate::state::editor_screen::EditorScreenTheme;
use crate::state::editor_screen::UpgradeOutline;
use crate::state::AppState;
Expand Down Expand Up @@ -32,9 +32,8 @@ impl Plugin for UpgradePanelPlugin {
.add_systems(
Update,
offer_next_upgrades.in_set(AppSet::Update).run_if(
on_event::<UpgradeEvent>().or_else(
state_changed::<AppState>().and_then(in_state(AppState::EditorScreen)),
),
in_state(AppState::EditorScreen)
.and_then(state_changed::<AppState>().or_else(on_event::<UpgradeEvent>())),
),
)
.add_systems(Update, update_upgrade_button_disabled.in_set(AppSet::End));
Expand Down

0 comments on commit 505b150

Please sign in to comment.