fix z-index ordering of fade-in/-out, menu, death screen
This commit is contained in:
parent
f866e9e76a
commit
8964cf47f7
13
src/menu.rs
13
src/menu.rs
|
@ -21,8 +21,10 @@ impl Plugin for MenuPlugin {
|
|||
fn build(&self, app: &mut App) {
|
||||
app.add_systems(Startup, setup.after(hud::setup));
|
||||
app.add_systems(
|
||||
PreUpdate,
|
||||
show_deathscreen.run_if(on_event::<DeathScreenEvent>()),
|
||||
Update,
|
||||
show_deathscreen
|
||||
.after(visual::spawn_effects)
|
||||
.run_if(on_event::<DeathScreenEvent>()),
|
||||
);
|
||||
app.add_systems(Update, handle_deathscreen_input);
|
||||
app.add_systems(
|
||||
|
@ -129,6 +131,7 @@ pub fn setup(
|
|||
style: style_fullscreen(),
|
||||
background_color: Color::BLACK.into(),
|
||||
visibility: Visibility::Hidden,
|
||||
z_index: ZIndex::Global(4000),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
|
@ -170,6 +173,7 @@ pub fn setup(
|
|||
NodeBundle {
|
||||
style: style_centered(),
|
||||
visibility: Visibility::Hidden,
|
||||
z_index: ZIndex::Global(4000),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
|
@ -216,6 +220,7 @@ pub fn setup(
|
|||
style: style_fullscreen(),
|
||||
background_color: Color::srgba(0.0, 0.0, 0.0, 0.8).into(),
|
||||
visibility: Visibility::Hidden,
|
||||
z_index: ZIndex::Global(9999),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
|
@ -232,6 +237,7 @@ pub fn setup(
|
|||
..default()
|
||||
},
|
||||
visibility: Visibility::Hidden,
|
||||
z_index: ZIndex::Global(9999),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
|
@ -277,6 +283,7 @@ pub fn setup(
|
|||
..default()
|
||||
},
|
||||
visibility: Visibility::Hidden,
|
||||
z_index: ZIndex::Global(9999),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
|
@ -323,6 +330,7 @@ pub fn setup(
|
|||
..default()
|
||||
},
|
||||
visibility: Visibility::Hidden,
|
||||
z_index: ZIndex::Global(9999),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
|
@ -361,6 +369,7 @@ pub fn setup(
|
|||
..default()
|
||||
},
|
||||
visibility: Visibility::Hidden,
|
||||
z_index: ZIndex::Global(9999),
|
||||
..default()
|
||||
},
|
||||
))
|
||||
|
|
|
@ -153,6 +153,7 @@ pub fn spawn_effects(
|
|||
NodeBundle {
|
||||
style: style_fullscreen(),
|
||||
background_color: color.into(),
|
||||
z_index: ZIndex::Global(5000),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
|
@ -169,6 +170,7 @@ pub fn spawn_effects(
|
|||
NodeBundle {
|
||||
style: style_fullscreen(),
|
||||
background_color: color.with_alpha(0.0).into(),
|
||||
z_index: ZIndex::Global(5000),
|
||||
..default()
|
||||
},
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue