Skip to content

Commit

Permalink
Fade out when restarting from pause menu
Browse files Browse the repository at this point in the history
  • Loading branch information
benfrankel committed Jul 26, 2024
1 parent 0570763 commit f26902a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/screen/playing/pause_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use pyri_state::extra::entity_scope::StateScope;
use pyri_state::prelude::*;

use crate::core::pause::Pause;
use crate::screen::fade_out;
use crate::screen::playing::PlayingMenu;
use crate::screen::Screen;
use crate::ui::prelude::*;
Expand Down Expand Up @@ -100,8 +101,9 @@ fn continue_button(mut entity: EntityWorldMut) {
fn restart_button(mut entity: EntityWorldMut) {
entity
.add(widget::menu_button("Restart"))
// TODO: Fade out?
.insert(On::<Pointer<Click>>::run(Screen::refresh));
.insert(On::<Pointer<Click>>::run(|mut commands: Commands| {
commands.spawn_with(fade_out(Screen::Playing));
}));
}

fn quit_to_title_button(mut entity: EntityWorldMut) {
Expand Down

0 comments on commit f26902a

Please sign in to comment.