diff --git a/taiko-core/Cargo.toml b/taiko-core/Cargo.toml index c8d1d37..8882409 100644 --- a/taiko-core/Cargo.toml +++ b/taiko-core/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "taiko-core" description = "A taiko game core written in Rust." -version = "0.0.1" +version = "0.0.2" license = "MIT" authors = ["JacobLinCool "] homepage = "https://github.com/JacobLinCool/rhythm-rs" @@ -14,4 +14,4 @@ name = "taiko_core" [dependencies] rhythm-core = { path = "../rhythm-core", version = "0.2.0" } serde = { version = "1.0.203", features = ["derive"] } -tja = { path = "../tja", version = "0.2.2" } +tja = { path = "../tja", version = "0.2.3" } diff --git a/taiko-game/Cargo.toml b/taiko-game/Cargo.toml index 88fc6b2..389a939 100644 --- a/taiko-game/Cargo.toml +++ b/taiko-game/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "taiko-game" description = "A taiko game written in Rust." -version = "0.0.7" +version = "0.0.8" license = "MIT" authors = ["JacobLinCool "] homepage = "https://github.com/JacobLinCool/rhythm-rs" @@ -15,8 +15,8 @@ path = "src/main.rs" [dependencies] rhythm-core = { path = "../rhythm-core", version = "0.2.0" } -tja = { path = "../tja", version = "0.2.2" } -taiko-core = { path = "../taiko-core", version = "0.0.1" } +tja = { path = "../tja", version = "0.2.3" } +taiko-core = { path = "../taiko-core", version = "0.0.2" } better-panic = "0.3.0" clap = { version = "4.5.4", features = ["derive", "cargo", "wrap_help", "unicode", "string", "unstable-styles"] } color-eyre = "0.6.3" diff --git a/taiko-game/src/cli.rs b/taiko-game/src/cli.rs index d89232c..3530397 100644 --- a/taiko-game/src/cli.rs +++ b/taiko-game/src/cli.rs @@ -50,6 +50,14 @@ pub struct AppArgs { )] pub songvol: u8, + #[arg( + long, + value_name = "TRACK_OFFSET", + help = "The track offset of the game, this is used to adjust the timing of the notes, if the notes are too early, increase this value, if the notes are too late, decrease this value. The unit is in seconds.", + default_value_t = 0.0 + )] + pub track_offset: f64, + #[arg( long, value_name = "LATENCY_GATE", diff --git a/taiko-game/src/component/game.rs b/taiko-game/src/component/game.rs index 16fea08..506b2ef 100644 --- a/taiko-game/src/component/game.rs +++ b/taiko-game/src/component/game.rs @@ -351,6 +351,7 @@ impl Component for GameScreen { let offset = song.tja().header.offset.unwrap_or(0.0) as f64; for note in course.notes.iter_mut() { note.start -= offset; + note.start += app.args.track_offset; } let source = GameSource { diff --git a/tja/Cargo.toml b/tja/Cargo.toml index e8dff64..d8e1f24 100644 --- a/tja/Cargo.toml +++ b/tja/Cargo.toml @@ -1,7 +1,7 @@ [package] name = "tja" description = "TJA file parser." -version = "0.2.2" +version = "0.2.3" license = "MIT" authors = ["JacobLinCool "] homepage = "https://github.com/JacobLinCool/rhythm-rs"