Beatsaber Rust Utilities: A Beatsaber V3 parsing library.
beatsaber beatmap
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fixes and updates to integrate with PhotonBS.

+38 -38
+1 -1
src/difficulty/lightshow.rs
··· 99 99 100 100 loose_enum! { 101 101 #[derive(Default, Copy)] 102 - Axis: i32 { 102 + EventAxis: i32 { 103 103 #[default] 104 104 X = 0, 105 105 Y = 1,
+2 -2
src/difficulty/lightshow/basic.rs
··· 31 31 pub struct Waypoint { 32 32 #[serde(rename = "b")] 33 33 pub beat: f32, 34 + #[serde(rename = "y")] 35 + pub row: u8, 34 36 #[serde(rename = "x")] 35 37 pub col: u8, 36 - #[serde(rename = "y")] 37 - pub row: u8, 38 38 #[serde(rename = "d")] 39 39 pub direction: CutDirection, 40 40 }
+2 -2
src/difficulty/lightshow/rotation.rs
··· 1 1 use crate::difficulty::lightshow::easing::Easing; 2 2 use crate::difficulty::lightshow::filter::Filter; 3 - use crate::difficulty::lightshow::{Axis, DistributionType, TransitionType}; 3 + use crate::difficulty::lightshow::{DistributionType, EventAxis, TransitionType}; 4 4 use crate::utils::LooseBool; 5 5 use crate::{impl_get_beat_offset, impl_timed, loose_enum}; 6 6 use serde::{Deserialize, Serialize}; ··· 45 45 #[serde(rename = "i")] 46 46 pub rotation_dist_easing: Option<Easing>, 47 47 #[serde(rename = "a")] 48 - pub axis: Axis, 48 + pub axis: EventAxis, 49 49 #[serde(rename = "r")] 50 50 pub invert_axis: LooseBool, 51 51 #[serde(rename = "l")]
+2 -2
src/difficulty/lightshow/translation.rs
··· 1 1 use crate::difficulty::lightshow::easing::Easing; 2 2 use crate::difficulty::lightshow::filter::Filter; 3 - use crate::difficulty::lightshow::{Axis, DistributionType, TransitionType}; 3 + use crate::difficulty::lightshow::{DistributionType, EventAxis, TransitionType}; 4 4 use crate::utils::LooseBool; 5 5 use crate::{impl_get_beat_offset, impl_timed}; 6 6 use serde::{Deserialize, Serialize}; ··· 44 44 #[serde(rename = "i")] 45 45 pub translation_dist_easing: Easing, 46 46 #[serde(rename = "a")] 47 - pub axis: Axis, 47 + pub axis: EventAxis, 48 48 #[serde(rename = "r")] 49 49 pub invert_axis: LooseBool, 50 50 #[serde(rename = "l")]
+29 -29
src/difficulty/playfield.rs
··· 10 10 pub struct Note { 11 11 #[serde(rename = "b")] 12 12 pub beat: f32, 13 - #[serde(rename = "x")] 14 - pub row: i32, 15 13 #[serde(rename = "y")] 14 + pub row: i32, 15 + #[serde(rename = "x")] 16 16 pub col: i32, 17 17 #[serde(rename = "c")] 18 18 pub color: NoteColor, 19 19 #[serde(rename = "d")] 20 20 pub direction: CutDirection, 21 21 #[serde(rename = "a")] 22 - pub angle_offset: i32, 22 + pub angle_offset: f32, 23 23 } 24 24 25 25 impl_timed!(Note::beat); ··· 51 51 52 52 impl CutDirection { 53 53 /// Returns the number of degrees a note is rotated, with zero degrees being downward note. 54 - /// Returns `None` if the cut direction is unknown. 55 - pub fn get_degrees(&self) -> Option<f32> { 54 + /// Returns zero if the cut direction is unknown. 55 + pub fn get_degrees(&self) -> f32 { 56 56 match self { 57 - CutDirection::Up => Some(180.0), 58 - CutDirection::Down => Some(0.0), 59 - CutDirection::Left => Some(-90.0), 60 - CutDirection::Right => Some(90.0), 61 - CutDirection::UpLeft => Some(-135.0), 62 - CutDirection::UpRight => Some(135.0), 63 - CutDirection::DownLeft => Some(-45.0), 64 - CutDirection::DownRight => Some(45.0), 65 - CutDirection::Any => Some(0.0), 66 - CutDirection::Unknown(_) => None, 57 + CutDirection::Up => 180.0, 58 + CutDirection::Down => 0.0, 59 + CutDirection::Left => -90.0, 60 + CutDirection::Right => 90.0, 61 + CutDirection::UpLeft => -135.0, 62 + CutDirection::UpRight => 135.0, 63 + CutDirection::DownLeft => -45.0, 64 + CutDirection::DownRight => 45.0, 65 + CutDirection::Any => 0.0, 66 + CutDirection::Unknown(_) => 0.0, 67 67 } 68 68 } 69 69 } ··· 77 77 pub struct Bomb { 78 78 #[serde(rename = "b")] 79 79 pub beat: f32, 80 - #[serde(rename = "x")] 80 + #[serde(rename = "y")] 81 81 pub row: i32, 82 - #[serde(rename = "y")] 82 + #[serde(rename = "x")] 83 83 pub col: i32, 84 84 } 85 85 ··· 96 96 pub beat: f32, 97 97 #[serde(rename = "d")] 98 98 pub duration: f32, 99 + #[serde(rename = "y")] 100 + pub row: i32, 99 101 #[serde(rename = "x")] 100 - pub row: i32, 101 - #[serde(rename = "y")] 102 102 pub col: i32, 103 103 #[serde(rename = "w")] 104 104 pub width: i32, ··· 117 117 pub struct Arc { 118 118 #[serde(rename = "b")] 119 119 pub beat: f32, 120 - #[serde(rename = "x")] 120 + #[serde(rename = "y")] 121 121 pub row: i32, 122 - #[serde(rename = "y")] 122 + #[serde(rename = "x")] 123 123 pub col: i32, 124 124 #[serde(rename = "c")] 125 - pub color: i32, 125 + pub color: NoteColor, 126 126 #[serde(rename = "d")] 127 127 pub direction: CutDirection, 128 128 #[serde(rename = "mu")] ··· 130 130 131 131 #[serde(rename = "tb")] 132 132 pub tail_beat: f32, 133 - #[serde(rename = "tx")] 134 - pub tail_row: i32, 135 133 #[serde(rename = "ty")] 134 + pub tail_row: i32, 135 + #[serde(rename = "tx")] 136 136 pub tail_col: i32, 137 137 #[serde(rename = "tc")] 138 138 pub tail_direction: CutDirection, ··· 164 164 pub struct Chain { 165 165 #[serde(rename = "b")] 166 166 pub beat: f32, 167 + #[serde(rename = "y")] 168 + pub row: i32, 167 169 #[serde(rename = "x")] 168 - pub row: i32, 169 - #[serde(rename = "y")] 170 170 pub col: i32, 171 171 #[serde(rename = "c")] 172 - pub color: i32, 172 + pub color: NoteColor, 173 173 #[serde(rename = "d")] 174 174 pub direction: CutDirection, 175 175 176 176 #[serde(rename = "tb")] 177 177 pub tail_beat: f32, 178 - #[serde(rename = "tx")] 179 - pub tail_row: i32, 180 178 #[serde(rename = "ty")] 179 + pub tail_row: i32, 180 + #[serde(rename = "tx")] 181 181 pub tail_col: i32, 182 182 183 183 #[serde(rename = "sc")]
+2 -2
src/info.rs
··· 19 19 #[serde(rename = "_levelAuthorName")] 20 20 pub mapper: String, 21 21 #[serde(rename = "_beatsPerMinute")] 22 - pub bpm: i32, 22 + pub bpm: f32, 23 23 #[serde(rename = "_songTimeOffset")] 24 24 pub time_offset: i32, 25 25 #[serde(rename = "_shuffle")] ··· 162 162 } 163 163 164 164 loose_enum! { 165 - #[derive(Default)] 165 + #[derive(Default, Copy)] 166 166 DifficultyRank: i32 { 167 167 Easy = 1, 168 168 Normal = 3,