We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0570763 commit f26902aCopy full SHA for f26902a
src/screen/playing/pause_menu.rs
@@ -4,6 +4,7 @@ use pyri_state::extra::entity_scope::StateScope;
4
use pyri_state::prelude::*;
5
6
use crate::core::pause::Pause;
7
+use crate::screen::fade_out;
8
use crate::screen::playing::PlayingMenu;
9
use crate::screen::Screen;
10
use crate::ui::prelude::*;
@@ -100,8 +101,9 @@ fn continue_button(mut entity: EntityWorldMut) {
100
101
fn restart_button(mut entity: EntityWorldMut) {
102
entity
103
.add(widget::menu_button("Restart"))
- // TODO: Fade out?
104
- .insert(On::<Pointer<Click>>::run(Screen::refresh));
+ .insert(On::<Pointer<Click>>::run(|mut commands: Commands| {
105
+ commands.spawn_with(fade_out(Screen::Playing));
106
+ }));
107
}
108
109
fn quit_to_title_button(mut entity: EntityWorldMut) {
0 commit comments