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.

Added color schemes.

+75 -4
+4
src/difficulty/playfield.rs
··· 1 1 use crate::{impl_duration, impl_timed, loose_enum}; 2 2 use serde::{Deserialize, Serialize}; 3 3 4 + #[doc(alias = "Block")] 4 5 #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 5 6 #[cfg_attr( 6 7 feature = "bevy_reflect", ··· 85 86 86 87 impl_timed!(Bomb::beat); 87 88 89 + #[doc(alias = "Obstacle")] 88 90 #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 89 91 #[cfg_attr( 90 92 feature = "bevy_reflect", ··· 108 110 109 111 impl_duration!(Wall::beat, duration: duration); 110 112 113 + #[doc(alias = "Slider")] 111 114 #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 112 115 #[cfg_attr( 113 116 feature = "bevy_reflect", ··· 155 158 } 156 159 } 157 160 161 + #[doc(alias = "BurstSlider")] 158 162 #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 159 163 #[cfg_attr( 160 164 feature = "bevy_reflect",
+71 -4
src/info.rs
··· 41 41 /// Only present in info file V2.1 or higher. 42 42 #[serde(rename = "_environmentNames")] 43 43 pub environments: Option<Vec<Environment>>, 44 - // Todo 45 - // #[serde(rename = "_colorSchemes")] 46 - // /// Only present in info file V2.1 or higher. 47 - // pub color_schemes: Option<Vec<Value>>, 44 + /// Only present in info file V2.1 or higher. 45 + #[serde(rename = "_colorSchemes")] 46 + pub color_schemes: Option<Vec<ColorSchemeOverride>>, 48 47 #[serde(rename = "_difficultyBeatmapSets")] 49 48 pub difficulty_sets: Vec<DifficultySet>, 50 49 } ··· 117 116 derive(bevy_reflect::Reflect), 118 117 reflect(Debug, Clone, PartialEq) 119 118 )] 119 + #[serde(rename_all = "camelCase")] 120 + pub struct ColorSchemeOverride { 121 + pub use_override: bool, 122 + pub color_scheme: ColorScheme, 123 + } 124 + 125 + #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 126 + #[cfg_attr( 127 + feature = "bevy_reflect", 128 + derive(bevy_reflect::Reflect), 129 + reflect(Debug, Clone, PartialEq) 130 + )] 131 + #[serde(rename_all = "camelCase")] 132 + pub struct ColorScheme { 133 + #[serde(rename = "colorSchemeId")] 134 + pub id: String, 135 + #[doc(alias = "saber_left")] 136 + #[serde(rename = "saberAColor")] 137 + pub note_left: Color, 138 + #[doc(alias = "saber_right")] 139 + #[serde(rename = "saberBColor")] 140 + pub note_right: Color, 141 + 142 + #[doc(alias = "obstacle")] 143 + #[serde(rename = "obstaclesColor")] 144 + pub wall: Color, 145 + 146 + #[doc(alias = "environment0")] 147 + #[serde(rename = "environmentColor0")] 148 + pub light_primary: Color, 149 + #[doc(alias = "environment1")] 150 + #[serde(rename = "environmentColor1")] 151 + pub light_secondary: Color, 152 + 153 + #[doc(alias = "environment_boost_0")] 154 + #[serde(rename = "environmentColor0Boost")] 155 + pub boost_light_primary: Color, 156 + #[doc(alias = "environment_boost_1")] 157 + #[serde(rename = "environmentColor1Boost")] 158 + pub boost_light_secondary: Color, 159 + } 160 + 161 + #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 162 + #[cfg_attr( 163 + feature = "bevy_reflect", 164 + derive(bevy_reflect::Reflect), 165 + reflect(Debug, Clone, PartialEq) 166 + )] 167 + pub struct Color { 168 + #[serde(rename = "r")] 169 + red: f32, 170 + #[serde(rename = "g")] 171 + green: f32, 172 + #[serde(rename = "b")] 173 + blue: f32, 174 + #[serde(rename = "a")] 175 + alpha: f32, 176 + } 177 + 178 + #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 179 + #[cfg_attr( 180 + feature = "bevy_reflect", 181 + derive(bevy_reflect::Reflect), 182 + reflect(Debug, Clone, PartialEq) 183 + )] 120 184 pub struct DifficultySet { 121 185 #[serde(rename = "_beatmapCharacteristicName")] 122 186 pub characteristic: Characteristic, ··· 159 223 #[doc(alias = "node_jump_distance")] 160 224 #[serde(rename = "_noteJumpStartBeatOffset")] 161 225 pub njd: f32, 226 + /// Only present in info file V2.1 or higher. 227 + #[serde(rename = "_beatmapColorSchemeIdx")] 228 + pub color_scheme_index: Option<i32>, 162 229 } 163 230 164 231 loose_enum! {