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.

Merge pull request #11 from AlephCubed/v3.3-strobing

Add difficulty file v3.3 strobing options.

authored by

AlephCubed and committed by
GitHub
b0a70888 5a0679ec

+24 -46
+1 -1
Cargo.lock
··· 156 156 157 157 [[package]] 158 158 name = "bsru" 159 - version = "0.1.0-rc.2" 159 + version = "0.1.0" 160 160 dependencies = [ 161 161 "bevy_color", 162 162 "bevy_reflect",
+1 -1
Cargo.toml
··· 1 1 [package] 2 2 name = "bsru" 3 - version = "0.1.0-rc.2" 3 + version = "0.1.0" 4 4 edition = "2024" 5 5 description = "Beatsaber Rust Utilities: A Beatsaber V3 parsing library." 6 6 categories = ["game-development", "data-structures", "parser-implementations"]
+5 -20
README.md
··· 6 6 7 7 A Beatsaber V3 parsing library. 8 8 9 - ## Version Support 9 + ## Status 10 10 11 - ### Info File 11 + This project should support info file version `2.X` and difficulty file version `3.X`. 12 + Modded features such as custom data are not currently supported. 12 13 13 - | Version | Description | Supported | 14 - |---------|-----------------------------------------------|-----------| 15 - | 2.0 | Standard info format. | Yes | 16 - | 2.1 | Per difficulty environment and color schemes. | Yes | 17 - | 4.X | Format overhaul. | No | 18 - 19 - ### Difficulty File 20 - 21 - | Version | Description | Supported | 22 - |---------|---------------------------------------|-----------| 23 - | 2.X | Old un-abbreviated format. | No | 24 - | 3.0 | Group lighting system. | Yes | 25 - | 3.1 | Chunk, limit, and randomized filters. | Yes [^1] | 26 - | 3.2 | Translation events. | Yes | 27 - | 3.3 | More strobe functionality. | No | 28 - | 4.X | New template-like format. | No | 29 - 30 - [^1]: Not supported by experimental lighting calculation methods. 14 + There are also some experimental methods to help with lighting calculations. 15 + These do not currently support all features and are marked as depreciated. 31 16 32 17 ## Feature Flags 33 18
-13
src/difficulty.rs
··· 20 20 )] 21 21 pub struct Difficulty { 22 22 /// The difficulty file version, in the form of `3.2.0`. 23 - /// 24 - /// ### Version Support 25 - /// 26 - /// | Version | Description | Supported | 27 - /// |---------|---------------------------------------|-----------| 28 - /// | 2.X | Old un-abbreviated format. | No | 29 - /// | 3.0 | Group lighting system. | Yes | 30 - /// | 3.1 | Chunk, limit, and randomized filters. | Yes [^1] | 31 - /// | 3.2 | Translation events. | Yes | 32 - /// | 3.3 | More strobe functionality. | No | 33 - /// | 4.X | New template-like format. | No | 34 - /// 35 - /// [^1]: Not supported by experimental lighting calculation methods. 36 23 pub version: String, 37 24 pub bpm_events: Vec<BpmEvent>, 38 25 #[serde(rename = "rotationEvents")]
+15 -1
src/difficulty/lightshow/group/color.rs
··· 81 81 bright_dist_type: Default::default(), 82 82 bright_dist_value: 0.0, 83 83 bright_dist_effect_first: Default::default(), 84 - bright_dist_easing: None, 84 + bright_dist_easing: Some(Easing::Linear), 85 85 data: vec![ColorEventData::default()], 86 86 } 87 87 } ··· 124 124 pub transition_type: ColorTransitionType, 125 125 #[serde(rename = "c")] 126 126 pub color: LightColor, 127 + /// Controls how bright the light is, with zero being off and one being normal brightness. 127 128 #[serde(rename = "s")] 128 129 pub brightness: f32, 129 130 /// Determines the number of strobes that will take place each beat. 130 131 /// A value of zero will result in no strobing. 131 132 #[serde(rename = "f")] 132 133 pub strobe_frequency: i32, 134 + /// > Only present in difficulty file V3.3 or higher. 135 + /// 136 + /// Controls the brightness of the "off" strobe state. 137 + /// If this equals the event's [brightness](Self::brightness), strobing will have no effect. 138 + #[serde(rename = "sb")] 139 + pub strobe_brightness: Option<f32>, 140 + /// > Only present in difficulty file V3.3 or higher. 141 + /// 142 + /// Whether to fade between strobe states or not. 143 + #[serde(rename = "sf")] 144 + pub strobe_fade: Option<LooseBool>, 133 145 } 134 146 135 147 impl Default for ColorEventData { ··· 140 152 color: Default::default(), 141 153 brightness: 1.0, 142 154 strobe_frequency: 0, 155 + strobe_brightness: Some(0.0), 156 + strobe_fade: Some(LooseBool::False), 143 157 } 144 158 } 145 159 }
+1 -1
src/difficulty/lightshow/group/rotation.rs
··· 87 87 rotation_dist_type: Default::default(), 88 88 rotation_dist_value: 0.0, 89 89 rotation_dist_effect_first: LooseBool::True, 90 - rotation_dist_easing: None, 90 + rotation_dist_easing: Some(Easing::Linear), 91 91 axis: Default::default(), 92 92 invert_axis: Default::default(), 93 93 data: vec![RotationEventData::default()],
+1 -1
src/difficulty/lightshow/group/translation.rs
··· 90 90 translation_dist_type: Default::default(), 91 91 translation_dist_value: 0.0, 92 92 translation_dist_effect_first: Default::default(), 93 - translation_dist_easing: Default::default(), 93 + translation_dist_easing: Easing::Linear, 94 94 axis: Default::default(), 95 95 invert_axis: Default::default(), 96 96 data: vec![TranslationEventData::default()],
-8
src/info.rs
··· 16 16 )] 17 17 pub struct Beatmap { 18 18 /// The info file version, in the form of `2.1.0`. 19 - /// 20 - /// ### Version Support 21 - /// 22 - /// | Version | Description | Supported | 23 - /// |---------|-----------------------------------------------|-----------| 24 - /// | 2.0 | Standard info format. | Yes | 25 - /// | 2.1 | Per difficulty environment and color schemes. | Yes | 26 - /// | 4.X | Format overhaul. | No | 27 19 #[serde(rename = "_version")] 28 20 pub version: String, 29 21 #[serde(rename = "_songName")]