Skip to content

Commit 1c1b89f

Browse files
committed
feat: allow mouse input when using Space to pause
1 parent e9b84fd commit 1c1b89f

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

prpr/src/scene/game.rs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,8 @@ impl GameScene {
545545
let now = tm.now();
546546
tm.speed = res.config.speed as _;
547547
tm.resume();
548+
#[cfg(target_os = "windows")]
549+
set_multitouch(res.config.windows_multitouch_mode, true);
548550
tm.seek_to(now - 3.);
549551
self.pause_rewind = Some(tm.now() - 0.2);
550552
}
@@ -675,7 +677,11 @@ impl GameScene {
675677
}
676678
if self.res.config.touch_debug {
677679
for touch in Judge::get_touches() {
678-
ui.fill_circle(touch.position.x, touch.position.y, 0.04, Color { a: 0.4, ..RED });
680+
let color = match touch.id < u64::MAX - 3 {
681+
true => Color { a: 0.4, ..RED },
682+
false => Color { a: 0.4, ..YELLOW },
683+
};
684+
ui.fill_circle(touch.position.x, touch.position.y, 0.04, color);
679685
}
680686
}
681687
for pos in &self.touch_points {
@@ -919,12 +925,16 @@ impl Scene for GameScene {
919925
if matches!(self.state, State::Playing) {
920926
self.music.play()?;
921927
tm.resume();
928+
#[cfg(target_os = "windows")]
929+
set_multitouch(res.config.windows_multitouch_mode, true);
922930
}
923931
} else if matches!(self.state, State::Playing | State::BeforeMusic) {
924932
if !self.music.paused() {
925933
self.music.pause()?;
926934
}
927935
tm.pause();
936+
#[cfg(target_os = "windows")]
937+
set_multitouch(res.config.windows_multitouch_mode, false);
928938
}
929939
}
930940
if Self::interactive(res, &self.state) {

0 commit comments

Comments
 (0)