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.

Better default values for most types.

AlephCubed b3442b3c 90557131

+157 -15
+40 -3
src/difficulty/lightshow/boxes/color.rs
··· 5 5 use crate::{impl_event_box, impl_event_data, impl_event_group, impl_timed, loose_enum}; 6 6 use serde::{Deserialize, Serialize}; 7 7 8 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 8 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 9 9 #[cfg_attr( 10 10 feature = "bevy_reflect", 11 11 derive(bevy_reflect::Reflect), ··· 20 20 pub groups: Vec<ColorEventGroup>, 21 21 } 22 22 23 + impl Default for ColorEventBox { 24 + fn default() -> Self { 25 + Self { 26 + beat: 0.0, 27 + group_id: 0, 28 + groups: vec![ColorEventGroup::default()], 29 + } 30 + } 31 + } 32 + 23 33 impl_timed!(ColorEventBox::beat); 24 34 impl_event_box!(ColorEventBox, ColorEventGroup, ColorEventData); 25 35 26 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 36 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 27 37 #[cfg_attr( 28 38 feature = "bevy_reflect", 29 39 derive(bevy_reflect::Reflect), ··· 49 59 pub data: Vec<ColorEventData>, 50 60 } 51 61 62 + impl Default for ColorEventGroup { 63 + fn default() -> Self { 64 + Self { 65 + filter: Default::default(), 66 + beat_dist_type: Default::default(), 67 + beat_dist_value: 0.0, 68 + bright_dist_type: Default::default(), 69 + bright_dist_value: 0.0, 70 + bright_dist_effect_first: Default::default(), 71 + bright_dist_easing: None, 72 + data: vec![ColorEventData::default()], 73 + } 74 + } 75 + } 76 + 52 77 impl_event_group!(ColorEventGroup::get_brightness_offset, ColorEventData); 53 78 54 79 impl ColorEventGroup { ··· 64 89 } 65 90 } 66 91 67 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 92 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 68 93 #[cfg_attr( 69 94 feature = "bevy_reflect", 70 95 derive(bevy_reflect::Reflect), ··· 81 106 pub brightness: f32, 82 107 #[serde(rename = "f")] 83 108 pub strobe_frequency: i32, 109 + } 110 + 111 + impl Default for ColorEventData { 112 + fn default() -> Self { 113 + Self { 114 + beat_offset: 0.0, 115 + transition_type: Default::default(), 116 + color: Default::default(), 117 + brightness: 1.0, 118 + strobe_frequency: 0, 119 + } 120 + } 84 121 } 85 122 86 123 impl_event_data!(ColorEventData);
+29 -2
src/difficulty/lightshow/boxes/rotation.rs
··· 6 6 use crate::{impl_event_box, impl_event_group, impl_timed, loose_enum}; 7 7 use serde::{Deserialize, Serialize}; 8 8 9 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 9 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 10 10 #[cfg_attr( 11 11 feature = "bevy_reflect", 12 12 derive(bevy_reflect::Reflect), ··· 21 21 pub groups: Vec<RotationEventGroup>, 22 22 } 23 23 24 + impl Default for RotationEventBox { 25 + fn default() -> Self { 26 + Self { 27 + beat: 0.0, 28 + group_id: 0, 29 + groups: vec![RotationEventGroup::default()], 30 + } 31 + } 32 + } 33 + 24 34 impl_timed!(RotationEventBox::beat); 25 35 impl_event_box!(RotationEventBox, RotationEventGroup, RotationEventData); 26 36 27 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 37 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 28 38 #[cfg_attr( 29 39 feature = "bevy_reflect", 30 40 derive(bevy_reflect::Reflect), ··· 52 62 pub invert_axis: LooseBool, 53 63 #[serde(rename = "l")] 54 64 pub data: Vec<RotationEventData>, 65 + } 66 + 67 + impl Default for RotationEventGroup { 68 + fn default() -> Self { 69 + Self { 70 + filter: Default::default(), 71 + beat_dist_type: Default::default(), 72 + beat_dist_value: 0.0, 73 + rotation_dist_type: Default::default(), 74 + rotation_dist_value: 0.0, 75 + rotation_dist_effect_first: LooseBool::True, 76 + rotation_dist_easing: None, 77 + axis: Default::default(), 78 + invert_axis: Default::default(), 79 + data: vec![RotationEventData::default()], 80 + } 81 + } 55 82 } 56 83 57 84 impl_event_group!(RotationEventGroup::get_rotation_offset, RotationEventData);
+29 -2
src/difficulty/lightshow/boxes/translation.rs
··· 6 6 use crate::{impl_event_box, impl_event_group, impl_timed}; 7 7 use serde::{Deserialize, Serialize}; 8 8 9 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 9 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 10 10 #[cfg_attr( 11 11 feature = "bevy_reflect", 12 12 derive(bevy_reflect::Reflect), ··· 21 21 pub groups: Vec<TranslationEventGroup>, 22 22 } 23 23 24 + impl Default for TranslationEventBox { 25 + fn default() -> Self { 26 + Self { 27 + beat: 0.0, 28 + group_id: 0, 29 + groups: vec![TranslationEventGroup::default()], 30 + } 31 + } 32 + } 33 + 24 34 impl_timed!(TranslationEventBox::beat); 25 35 impl_event_box!( 26 36 TranslationEventBox, ··· 28 38 TranslationEventData 29 39 ); 30 40 31 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 41 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 32 42 #[cfg_attr( 33 43 feature = "bevy_reflect", 34 44 derive(bevy_reflect::Reflect), ··· 55 65 pub invert_axis: LooseBool, 56 66 #[serde(rename = "l")] 57 67 pub data: Vec<TranslationEventData>, 68 + } 69 + 70 + impl Default for TranslationEventGroup { 71 + fn default() -> Self { 72 + Self { 73 + filter: Default::default(), 74 + beat_dist_type: Default::default(), 75 + beat_dist_value: 0.0, 76 + translation_dist_type: Default::default(), 77 + translation_dist_value: 0.0, 78 + translation_dist_effect_first: Default::default(), 79 + translation_dist_easing: Default::default(), 80 + axis: Default::default(), 81 + invert_axis: Default::default(), 82 + data: vec![TranslationEventData::default()], 83 + } 84 + } 58 85 } 59 86 60 87 impl_event_group!(
+6 -4
src/difficulty/lightshow/easing.rs
··· 4 4 loose_enum! { 5 5 #[derive(Default, Copy)] 6 6 Easing: i32 { 7 + #[default] 8 + None = -1, 9 + 7 10 Linear = 0, 8 11 InQuad = 1, 9 12 OutQuad = 2, ··· 36 39 OutBounce = 29, 37 40 InOutBounce = 30, 38 41 39 - #[default] 40 - None = -1, 41 - 42 42 BeatSaberInOutBack = 100, 43 43 BeatSaberInOutElastic = 101, 44 44 BeatSaberInOutBounce = 102, ··· 48 48 impl Easing { 49 49 pub fn ease(&self, num: f32) -> f32 { 50 50 match self { 51 + Easing::None => 0.0, 52 + 51 53 Easing::Linear => linear(num), 52 54 Easing::InQuad => quad_in(num), 53 55 Easing::OutQuad => quad_out(num), ··· 79 81 Easing::InBounce => bounce_in(num), 80 82 Easing::OutBounce => bounce_out(num), 81 83 Easing::InOutBounce => bounce_in_out(num), 82 - Easing::None => 0.0, 84 + 83 85 Easing::BeatSaberInOutBack => back_in_out(num), 84 86 Easing::BeatSaberInOutElastic => elastic_in_out(num), 85 87 Easing::BeatSaberInOutBounce => bounce_in_out(num),
+1 -1
src/difficulty/lightshow/filter.rs
··· 44 44 Self { 45 45 filter_type: FilterType::default(), 46 46 parameter1: 1, 47 - parameter2: 0, 47 + parameter2: 1, 48 48 reverse: LooseBool::False, 49 49 // Todo 50 50 chunks: None,
+52 -3
src/difficulty/playfield.rs
··· 87 87 impl_timed!(Bomb::beat); 88 88 89 89 #[doc(alias = "Obstacle")] 90 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 90 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 91 91 #[cfg_attr( 92 92 feature = "bevy_reflect", 93 93 derive(bevy_reflect::Reflect), ··· 108 108 pub height: i32, 109 109 } 110 110 111 + impl Default for Wall { 112 + fn default() -> Self { 113 + Self { 114 + beat: 0.0, 115 + duration: 1.0, 116 + row: 0, 117 + col: 0, 118 + width: 1, 119 + height: 5, 120 + } 121 + } 122 + } 123 + 111 124 impl_duration!(Wall::beat, duration: duration); 112 125 113 126 #[doc(alias = "Slider")] 114 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 127 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 115 128 #[cfg_attr( 116 129 feature = "bevy_reflect", 117 130 derive(bevy_reflect::Reflect), ··· 146 159 pub mid_anchor_mode: MidAnchorMode, 147 160 } 148 161 162 + impl Default for Arc { 163 + fn default() -> Self { 164 + Self { 165 + beat: 0.0, 166 + row: 0, 167 + col: 0, 168 + color: Default::default(), 169 + direction: Default::default(), 170 + control_point: 1.0, 171 + tail_beat: 1.0, 172 + tail_row: 0, 173 + tail_col: 0, 174 + tail_direction: Default::default(), 175 + tail_control_point: 1.0, 176 + mid_anchor_mode: Default::default(), 177 + } 178 + } 179 + } 180 + 149 181 impl_duration!(Arc::beat, end: tail_beat); 150 182 151 183 loose_enum! { ··· 159 191 } 160 192 161 193 #[doc(alias = "BurstSlider")] 162 - #[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)] 194 + #[derive(Debug, Clone, PartialEq, Serialize, Deserialize)] 163 195 #[cfg_attr( 164 196 feature = "bevy_reflect", 165 197 derive(bevy_reflect::Reflect), ··· 188 220 pub link_count: i32, 189 221 #[serde(rename = "s")] 190 222 pub link_squish: f32, 223 + } 224 + 225 + impl Default for Chain { 226 + fn default() -> Self { 227 + Self { 228 + beat: 0.0, 229 + row: 1, 230 + col: 0, 231 + color: Default::default(), 232 + direction: Default::default(), 233 + tail_beat: 0.0, 234 + tail_row: 0, 235 + tail_col: 0, 236 + link_count: 3, 237 + link_squish: 1.0, 238 + } 239 + } 191 240 } 192 241 193 242 impl_duration!(Chain::beat, end: tail_beat);