diff --git a/Cargo.lock b/Cargo.lock index 42ed326..51415f9 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1072,7 +1072,7 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" [[package]] name = "libosu" version = "0.0.15" -source = "git+https://github.com/iptq/libosu?rev=7fbe7afbad55b25398062719ebaccbff0387d139#7fbe7afbad55b25398062719ebaccbff0387d139" +source = "git+https://github.com/iptq/libosu?rev=557d0a321405516f12c3939c1207c7341f796f35#557d0a321405516f12c3939c1207c7341f796f35" dependencies = [ "anyhow", "bitflags", diff --git a/Cargo.toml b/Cargo.toml index ba09c69..c7369be 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,4 +24,4 @@ structopt = "0.3.21" [dependencies.libosu] git = "https://github.com/iptq/libosu" -rev = "7fbe7afbad55b25398062719ebaccbff0387d139" +rev = "557d0a321405516f12c3939c1207c7341f796f35" diff --git a/src/game/grid.rs b/src/game/grid.rs index d7dd8ea..89488b6 100644 --- a/src/game/grid.rs +++ b/src/game/grid.rs @@ -59,4 +59,14 @@ impl Game { Ok(()) } + + pub(super) fn toggle_grid(&mut self) { + use libosu::enums::GridSize::*; + self.beatmap.inner.grid_size = match self.beatmap.inner.grid_size { + Tiny => Small, + Small => Medium, + Medium => Large, + Large => Tiny, + }; + } } diff --git a/src/game/mod.rs b/src/game/mod.rs index 5dc69db..96a85c9 100644 --- a/src/game/mod.rs +++ b/src/game/mod.rs @@ -399,6 +399,9 @@ impl EventHandler for Game { match keycode { Space => self.toggle_playing(), Colon => {} + G => { + self.toggle_grid(); + } _ => {} }; }