toggle grid size
This commit is contained in:
parent
4abf19784e
commit
961e141bfc
4 changed files with 15 additions and 2 deletions
2
Cargo.lock
generated
2
Cargo.lock
generated
|
@ -1072,7 +1072,7 @@ checksum = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a"
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "libosu"
|
name = "libosu"
|
||||||
version = "0.0.15"
|
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 = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"bitflags",
|
"bitflags",
|
||||||
|
|
|
@ -24,4 +24,4 @@ structopt = "0.3.21"
|
||||||
|
|
||||||
[dependencies.libosu]
|
[dependencies.libosu]
|
||||||
git = "https://github.com/iptq/libosu"
|
git = "https://github.com/iptq/libosu"
|
||||||
rev = "7fbe7afbad55b25398062719ebaccbff0387d139"
|
rev = "557d0a321405516f12c3939c1207c7341f796f35"
|
||||||
|
|
|
@ -59,4 +59,14 @@ impl Game {
|
||||||
|
|
||||||
Ok(())
|
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,
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -399,6 +399,9 @@ impl EventHandler for Game {
|
||||||
match keycode {
|
match keycode {
|
||||||
Space => self.toggle_playing(),
|
Space => self.toggle_playing(),
|
||||||
Colon => {}
|
Colon => {}
|
||||||
|
G => {
|
||||||
|
self.toggle_grid();
|
||||||
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue