···22use crate::impl_timed;
33use serde::{Deserialize, Serialize};
4455+/// The basic V2 event type, which is still used for some elements of V3 environments (for example, the player platform).
56#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
67#[cfg_attr(
78 feature = "bevy_reflect",
···910 reflect(Debug, Clone, PartialEq)
1011)]
1112pub struct BasicEvent {
1313+ /// The time the event takes place.
1214 #[serde(rename = "b")]
1315 pub beat: f32,
1616+ /// Determines the behaviour of the event. The exact behaviour differs depending on the environment.
1717+ ///
1418 /// More info [here](https://bsmg.wiki/mapping/map-format/lightshow.html#basic-events-type).
1519 #[serde(rename = "et")]
1620 pub event_type: i32,
2121+ /// Determines which effect the event will produce, based on its [type](Self::event_type).
1722 #[serde(rename = "i")]
1823 pub value: i32,
2424+ /// Modifies the effect.
1925 #[serde(rename = "f")]
2026 pub float: f32,
2127}
22282329impl_timed!(BasicEvent::beat);
24303131+/// Controls the TinyTAN figures on the [BTS environment](crate::info::Environment::BTS).
3232+///
3333+/// More info [here](https://bsmg.wiki/mapping/map-format/lightshow.html#waypoints).
2534#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
2635#[cfg_attr(
2736 feature = "bevy_reflect",
···2938 reflect(Debug, Clone, PartialEq)
3039)]
3140pub struct Waypoint {
4141+ /// The time the event takes place.
3242 #[serde(rename = "b")]
3343 pub beat: f32,
4444+ /// A value representing the vertical position of the event.
4545+ /// In the range 0..2 inclusive, with zero being the bottom and two being the top row.
3446 #[serde(rename = "y")]
3547 pub row: u8,
4848+ /// A value representing the horizontal position of the event.
4949+ /// In the range 0..3 inclusive, with zero being the far left and three being the far right column.
3650 #[serde(rename = "x")]
3751 pub col: u8,
3852 #[serde(rename = "d")]
···41554256impl_timed!(Waypoint::beat);
43575858+/// Controls which lighting colors are used, based on a map or environment's [color scheme](crate::info::color_scheme::ColorScheme).
4459#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
4560#[cfg_attr(
4661 feature = "bevy_reflect",
···4863 reflect(Debug, Clone, PartialEq)
4964)]
5065pub struct ColorBoostEvent {
6666+ /// The time the event takes place.
5167 #[serde(rename = "b")]
5268 pub beat: f32,
6969+ /// Whether to enable or disable boost colors.
5370 #[serde(rename = "o")]
5471 pub boost: bool,
5572}
···5774impl_timed!(ColorBoostEvent::beat);
58755976/// An event containing an array of Special Event Keywords.
7777+///
6078/// More info [here](https://bsmg.wiki/mapping/map-format/lightshow.html#special-event-keywords).
6179#[doc(alias = "KeywordEvent")]
6280#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
···7189}
72907391/// Allows basic event lanes to be overridden with environment-specific behaviour, using secret keys.
9292+///
7493/// More info [here](https://bsmg.wiki/mapping/map-format/lightshow.html#special-event-keywords).
7594#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
7695#[cfg_attr(
···7998 reflect(Debug, Clone, PartialEq)
8099)]
81100pub struct Keyword {
101101+ /// The secret key of the effect.
82102 #[serde(rename = "k")]
83103 pub keyword: String,
104104+ /// A list of [event types](BasicEvent::event_type) to effect with the keyword.
84105 #[serde(rename = "e")]
85106 pub event_types: Vec<i32>,
86107}
+4-1
src/difficulty/lightshow/boxes.rs
···99use crate::difficulty::lightshow::filter::Filter;
1010use crate::timing_traits::Timed;
11111212+/// A collection of [`EventGroup`]s that share the same group ID and beat.
1213pub trait EventBox: Timed {
1314 type Group: EventGroup<Data = Self::Data>;
1415 type Data: EventData;
···3132 };
3233}
33343535+/// A collection of [`EventData`] that share the same [`Filter`] and distribution.
3436pub trait EventGroup {
3537 type Data: EventData;
3638···4547 )]
4648 fn get_beat_offset(&self, light_id: i32, group_size: i32) -> f32;
47494848- /// Returns the value that the event will be offset for a given light ID (i.e. brightness offset).
5050+ /// Returns the value (i.e. brightness) that the event will be offset for a given light ID.
4951 /// # Panics
5052 /// Will panic if the light ID is greater than or equal to the group size.
5153 #[deprecated(
···8991 };
9092}
91939494+/// The lowest-level group event type, which determines the base value of the event.
9295pub trait EventData {
9396 fn get_beat_offset(&self) -> f32;
9497}
+13-2
src/difficulty/lightshow/boxes/color.rs
···55use crate::{impl_event_box, impl_event_data, impl_event_group, impl_timed, loose_enum};
66use serde::{Deserialize, Serialize};
7788+/// A collection of [`ColorEventGroup`]s that share the same group ID and beat.
89#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
910#[cfg_attr(
1011 feature = "bevy_reflect",
···3334impl_timed!(ColorEventBox::beat);
3435impl_event_box!(ColorEventBox, ColorEventGroup, ColorEventData);
35363737+/// A collection of [`ColorEventData`] that share the same [`Filter`] and distribution.
3638#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3739#[cfg_attr(
3840 feature = "bevy_reflect",
···9698 }
9799}
98100101101+/// The lowest-level group event type, which determines the color of the event.
99102#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
100103#[cfg_attr(
101104 feature = "bevy_reflect",
···111114 pub color: LightColor,
112115 #[serde(rename = "s")]
113116 pub brightness: f32,
117117+ /// Determines the number of strobes that will take place each beat.
118118+ /// A value of zero will result in no strobing.
114119 #[serde(rename = "f")]
115120 pub strobe_frequency: i32,
116121}
···130135impl_event_data!(ColorEventData);
131136132137loose_enum! {
138138+ /// Controls how the state is changed relative to the previous event.
133139 #[derive(Default, Copy)]
134140 ColorTransitionType: i32 {
135135- /// Replaced with `Transition` and [`Easing::None`] in difficulty file V3.2 or higher.
141141+ /// Unique to color events.
142142+ /// Has the same effect as using [`TransitionType::Transition`](crate::lightshow::TransitionType::Transition)
143143+ /// and [`Easing::None`] in rotation/translation events.
144144+ #[default]
136145 Instant = 0,
137137- #[default]
146146+ /// The state will blend from the previous event's state, using the events [easing](Easing).
138147 Transition = 1,
148148+ /// The event's state will be ignored, replaced with the state from the previous event.
139149 Extend = 2,
140150 }
141151}
142152143153loose_enum! {
154154+ /// Controls which color to display, based on a map or environment's [color scheme](crate::info::color_scheme::ColorScheme).
144155 #[derive(Default, Copy)]
145156 LightColor: i32 {
146157 #[default]
+5
src/difficulty/lightshow/boxes/rotation.rs
···66use crate::{impl_event_box, impl_event_group, impl_timed, loose_enum};
77use serde::{Deserialize, Serialize};
8899+/// A collection of [`RotationEventGroup`]s that share the same group ID and beat.
910#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1011#[cfg_attr(
1112 feature = "bevy_reflect",
···3435impl_timed!(RotationEventBox::beat);
3536impl_event_box!(RotationEventBox, RotationEventGroup, RotationEventData);
36373838+/// A collection of [`RotationEventData`] that share the same [`EventAxis`], [`Filter`], and distribution.
3739#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
3840#[cfg_attr(
3941 feature = "bevy_reflect",
···5860 pub rotation_dist_easing: Option<Easing>,
5961 #[serde(rename = "a")]
6062 pub axis: EventAxis,
6363+ /// If true, the rotation will be mirrored.
6164 #[serde(rename = "r")]
6265 pub invert_axis: LooseBool,
6366 #[serde(rename = "l")]
···103106 }
104107}
105108109109+/// The lowest-level group event type, which determines the base rotation of the event.
106110#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
107111#[cfg_attr(
108112 feature = "bevy_reflect",
···120124 pub degrees: f32,
121125 #[serde(rename = "o")]
122126 pub direction: RotationDirection,
127127+ /// Extends the rotation by 360 degrees in the [`RotationDirection`].
123128 #[serde(rename = "l")]
124129 pub loops: i32,
125130}
+4
src/difficulty/lightshow/boxes/translation.rs
···66use crate::{impl_event_box, impl_event_group, impl_timed};
77use serde::{Deserialize, Serialize};
8899+/// A collection of [`TranslationEventGroup`]s that share the same group ID and beat.
910#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
1011#[cfg_attr(
1112 feature = "bevy_reflect",
···3839 TranslationEventData
3940);
40414242+/// A collection of [`TranslationEventData`] that share the same [`EventAxis`], [`Filter`], and distribution.
4143#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
4244#[cfg_attr(
4345 feature = "bevy_reflect",
···6163 pub translation_dist_easing: Easing,
6264 #[serde(rename = "a")]
6365 pub axis: EventAxis,
6666+ /// If true, the translation will be mirrored.
6467 #[serde(rename = "r")]
6568 pub invert_axis: LooseBool,
6669 #[serde(rename = "l")]
···109112 }
110113}
111114115115+/// The lowest-level group event type, which determines the base position of the event.
112116#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
113117#[cfg_attr(
114118 feature = "bevy_reflect",