Skip to content

Commit

Permalink
feat: allow mouse input when using Space to pause
Browse files Browse the repository at this point in the history
  • Loading branch information
fhscey committed Jan 22, 2025
1 parent 6593eff commit f5e310b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions prpr/src/scene/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ impl GameScene {
let now = tm.now();
tm.speed = res.config.speed as _;
tm.resume();
#[cfg(target_os = "windows")]
set_multitouch(res.config.windows_multitouch_mode, true);
tm.seek_to(now - 3.);
self.pause_rewind = Some(tm.now() - 0.2);
Expand Down Expand Up @@ -924,13 +925,15 @@ impl Scene for GameScene {
if matches!(self.state, State::Playing) {
self.music.play()?;
tm.resume();
#[cfg(target_os = "windows")]
set_multitouch(res.config.windows_multitouch_mode, true);
}
} else if matches!(self.state, State::Playing | State::BeforeMusic) {
if !self.music.paused() {
self.music.pause()?;
}
tm.pause();
#[cfg(target_os = "windows")]
set_multitouch(res.config.windows_multitouch_mode, false);
}
}
Expand Down

0 comments on commit f5e310b

Please sign in to comment.