Skip to content

Commit a85fe94

Browse files
committed
Update derives on reflected enums
1 parent 1491442 commit a85fe94

6 files changed

Lines changed: 18 additions & 18 deletions

File tree

crates/bevy_core_pipeline/src/clear_color.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use bevy_render::{color::Color, extract_resource::ExtractResource};
55
use serde::{Deserialize, Serialize};
66

77
#[derive(Reflect, Serialize, Deserialize, Clone, Debug, Default)]
8-
#[reflect_value(Serialize, Deserialize)]
8+
#[reflect(Serialize, Deserialize)]
99
pub enum ClearColorConfig {
1010
#[default]
1111
Default,

crates/bevy_core_pipeline/src/core_3d/camera_3d.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ pub struct Camera3d {
2323

2424
/// The depth clear operation to perform for the main 3d pass.
2525
#[derive(Reflect, Serialize, Deserialize, Clone, Debug)]
26-
#[reflect_value(Serialize, Deserialize)]
26+
#[reflect(Serialize, Deserialize)]
2727
pub enum Camera3dDepthLoadOp {
2828
/// Clear with a specified value.
2929
/// Note that 0.0 is the far plane due to bevy's use of reverse-z projections.

crates/bevy_render/src/camera/camera.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ impl RenderTarget {
311311
}
312312

313313
#[derive(Debug, Clone, Copy, Default, Reflect, FromReflect, Serialize, Deserialize)]
314-
#[reflect_value(Serialize, Deserialize)]
314+
#[reflect(Serialize, Deserialize)]
315315
pub enum DepthCalculation {
316316
/// Pythagorean distance; works everywhere, more expensive to compute.
317317
#[default]

crates/bevy_render/src/camera/projection.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ impl Default for PerspectiveProjection {
142142

143143
// TODO: make this a component instead of a property
144144
#[derive(Debug, Clone, Reflect, FromReflect, Serialize, Deserialize)]
145-
#[reflect_value(Serialize, Deserialize)]
145+
#[reflect(Serialize, Deserialize)]
146146
pub enum WindowOrigin {
147147
Center,
148148
BottomLeft,
149149
}
150150

151151
#[derive(Debug, Clone, Reflect, FromReflect, Serialize, Deserialize)]
152-
#[reflect_value(Serialize, Deserialize)]
152+
#[reflect(Serialize, Deserialize)]
153153
pub enum ScalingMode {
154154
/// Manually specify left/right/top/bottom values.
155155
/// Ignore window resizing; the image will stretch.

crates/bevy_text/src/text.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ impl Default for TextAlignment {
187187

188188
/// Describes horizontal alignment preference for positioning & bounds.
189189
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Reflect, Serialize, Deserialize)]
190-
#[reflect_value(Serialize, Deserialize)]
190+
#[reflect(Serialize, Deserialize)]
191191
pub enum HorizontalAlign {
192192
/// Leftmost character is immediately to the right of the render position.<br/>
193193
/// Bounds start from the render position and advance rightwards.
@@ -213,7 +213,7 @@ impl From<HorizontalAlign> for glyph_brush_layout::HorizontalAlign {
213213
/// Describes vertical alignment preference for positioning & bounds. Currently a placeholder
214214
/// for future functionality.
215215
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Reflect, Serialize, Deserialize)]
216-
#[reflect_value(Serialize, Deserialize)]
216+
#[reflect(Serialize, Deserialize)]
217217
pub enum VerticalAlign {
218218
/// Characters/bounds start underneath the render position and progress downwards.
219219
Top,

crates/bevy_ui/src/ui_node.rs

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ pub struct Node {
2121

2222
/// An enum that describes possible types of value in flexbox layout options
2323
#[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)]
24-
#[reflect_value(PartialEq, Serialize, Deserialize)]
24+
#[reflect(PartialEq, Serialize, Deserialize)]
2525
pub enum Val {
2626
/// No value defined
2727
#[default]
@@ -142,7 +142,7 @@ impl Default for Style {
142142

143143
/// How items are aligned according to the cross axis
144144
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
145-
#[reflect_value(PartialEq, Serialize, Deserialize)]
145+
#[reflect(PartialEq, Serialize, Deserialize)]
146146
pub enum AlignItems {
147147
/// Items are aligned at the start
148148
FlexStart,
@@ -159,7 +159,7 @@ pub enum AlignItems {
159159

160160
/// Works like [`AlignItems`] but applies only to a single item
161161
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
162-
#[reflect_value(PartialEq, Serialize, Deserialize)]
162+
#[reflect(PartialEq, Serialize, Deserialize)]
163163
pub enum AlignSelf {
164164
/// Use the value of [`AlignItems`]
165165
#[default]
@@ -180,7 +180,7 @@ pub enum AlignSelf {
180180
///
181181
/// It only applies if [`FlexWrap::Wrap`] is present and if there are multiple lines of items.
182182
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
183-
#[reflect_value(PartialEq, Serialize, Deserialize)]
183+
#[reflect(PartialEq, Serialize, Deserialize)]
184184
pub enum AlignContent {
185185
/// Each line moves towards the start of the cross axis
186186
FlexStart,
@@ -203,7 +203,7 @@ pub enum AlignContent {
203203
///
204204
/// For example English is written LTR (left-to-right) while Arabic is written RTL (right-to-left).
205205
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
206-
#[reflect_value(PartialEq, Serialize, Deserialize)]
206+
#[reflect(PartialEq, Serialize, Deserialize)]
207207
pub enum Direction {
208208
/// Inherit from parent node
209209
#[default]
@@ -218,7 +218,7 @@ pub enum Direction {
218218
///
219219
/// Part of the [`Style`] component.
220220
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
221-
#[reflect_value(PartialEq, Serialize, Deserialize)]
221+
#[reflect(PartialEq, Serialize, Deserialize)]
222222
pub enum Display {
223223
/// Use Flexbox layout model to determine the position of this [`Node`].
224224
#[default]
@@ -232,7 +232,7 @@ pub enum Display {
232232

233233
/// Defines how flexbox items are ordered within a flexbox
234234
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
235-
#[reflect_value(PartialEq, Serialize, Deserialize)]
235+
#[reflect(PartialEq, Serialize, Deserialize)]
236236
pub enum FlexDirection {
237237
/// Same way as text direction along the main axis
238238
#[default]
@@ -247,7 +247,7 @@ pub enum FlexDirection {
247247

248248
/// Defines how items are aligned according to the main axis
249249
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
250-
#[reflect_value(PartialEq, Serialize, Deserialize)]
250+
#[reflect(PartialEq, Serialize, Deserialize)]
251251
pub enum JustifyContent {
252252
/// Pushed towards the start
253253
#[default]
@@ -266,7 +266,7 @@ pub enum JustifyContent {
266266

267267
/// Whether to show or hide overflowing items
268268
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Reflect, Serialize, Deserialize)]
269-
#[reflect_value(PartialEq, Serialize, Deserialize)]
269+
#[reflect(PartialEq, Serialize, Deserialize)]
270270
pub enum Overflow {
271271
/// Show overflowing items
272272
#[default]
@@ -277,7 +277,7 @@ pub enum Overflow {
277277

278278
/// The strategy used to position this node
279279
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
280-
#[reflect_value(PartialEq, Serialize, Deserialize)]
280+
#[reflect(PartialEq, Serialize, Deserialize)]
281281
pub enum PositionType {
282282
/// Relative to all other nodes with the [`PositionType::Relative`] value
283283
#[default]
@@ -290,7 +290,7 @@ pub enum PositionType {
290290

291291
/// Defines if flexbox items appear on a single line or on multiple lines
292292
#[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)]
293-
#[reflect_value(PartialEq, Serialize, Deserialize)]
293+
#[reflect(PartialEq, Serialize, Deserialize)]
294294
pub enum FlexWrap {
295295
/// Single line, will overflow if needed
296296
#[default]

0 commit comments

Comments
 (0)