Skip to content

Commit

Permalink
Merge pull request #20 from JacobLinCool/feat-track-offset
Browse files Browse the repository at this point in the history
Note Track Offset
  • Loading branch information
JacobLinCool authored Aug 23, 2024
2 parents 87b3c5e + f4b2972 commit 76a0aee
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 6 deletions.
4 changes: 2 additions & 2 deletions taiko-core/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <jacob@csie.cool>"]
homepage = "https://github.com/JacobLinCool/rhythm-rs"
Expand All @@ -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" }
6 changes: 3 additions & 3 deletions taiko-game/Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <jacob@csie.cool>"]
homepage = "https://github.com/JacobLinCool/rhythm-rs"
Expand All @@ -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"
Expand Down
8 changes: 8 additions & 0 deletions taiko-game/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
1 change: 1 addition & 0 deletions taiko-game/src/component/game.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion tja/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "tja"
description = "TJA file parser."
version = "0.2.2"
version = "0.2.3"
license = "MIT"
authors = ["JacobLinCool <jacob@csie.cool>"]
homepage = "https://github.com/JacobLinCool/rhythm-rs"
Expand Down

0 comments on commit 76a0aee

Please sign in to comment.