From 05ce07f4dd65ee5ce84e4e197131cc3d75d60d60 Mon Sep 17 00:00:00 2001 From: Gino Valente Date: Wed, 27 Jul 2022 19:06:39 -0700 Subject: [PATCH] Update derives on reflected enums --- crates/bevy_core_pipeline/src/clear_color.rs | 2 +- .../src/core_3d/camera_3d.rs | 2 +- crates/bevy_render/src/camera/camera.rs | 2 +- crates/bevy_render/src/camera/projection.rs | 4 ++-- crates/bevy_text/src/text.rs | 4 ++-- crates/bevy_ui/src/ui_node.rs | 22 +++++++++---------- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/crates/bevy_core_pipeline/src/clear_color.rs b/crates/bevy_core_pipeline/src/clear_color.rs index 6160f2256f039..59197465396de 100644 --- a/crates/bevy_core_pipeline/src/clear_color.rs +++ b/crates/bevy_core_pipeline/src/clear_color.rs @@ -5,7 +5,7 @@ use bevy_render::{color::Color, extract_resource::ExtractResource}; use serde::{Deserialize, Serialize}; #[derive(Reflect, Serialize, Deserialize, Clone, Debug, Default)] -#[reflect_value(Serialize, Deserialize)] +#[reflect(Serialize, Deserialize)] pub enum ClearColorConfig { #[default] Default, diff --git a/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs b/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs index bca403cc0303c..ce91c2d2e04a8 100644 --- a/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs +++ b/crates/bevy_core_pipeline/src/core_3d/camera_3d.rs @@ -23,7 +23,7 @@ pub struct Camera3d { /// The depth clear operation to perform for the main 3d pass. #[derive(Reflect, Serialize, Deserialize, Clone, Debug)] -#[reflect_value(Serialize, Deserialize)] +#[reflect(Serialize, Deserialize)] pub enum Camera3dDepthLoadOp { /// Clear with a specified value. /// Note that 0.0 is the far plane due to bevy's use of reverse-z projections. diff --git a/crates/bevy_render/src/camera/camera.rs b/crates/bevy_render/src/camera/camera.rs index f24e49e9943e5..c2d01aca56c90 100644 --- a/crates/bevy_render/src/camera/camera.rs +++ b/crates/bevy_render/src/camera/camera.rs @@ -311,7 +311,7 @@ impl RenderTarget { } #[derive(Debug, Clone, Copy, Default, Reflect, FromReflect, Serialize, Deserialize)] -#[reflect_value(Serialize, Deserialize)] +#[reflect(Serialize, Deserialize)] pub enum DepthCalculation { /// Pythagorean distance; works everywhere, more expensive to compute. #[default] diff --git a/crates/bevy_render/src/camera/projection.rs b/crates/bevy_render/src/camera/projection.rs index a54f7fd5dea58..bf2a043b9e835 100644 --- a/crates/bevy_render/src/camera/projection.rs +++ b/crates/bevy_render/src/camera/projection.rs @@ -142,14 +142,14 @@ impl Default for PerspectiveProjection { // TODO: make this a component instead of a property #[derive(Debug, Clone, Reflect, FromReflect, Serialize, Deserialize)] -#[reflect_value(Serialize, Deserialize)] +#[reflect(Serialize, Deserialize)] pub enum WindowOrigin { Center, BottomLeft, } #[derive(Debug, Clone, Reflect, FromReflect, Serialize, Deserialize)] -#[reflect_value(Serialize, Deserialize)] +#[reflect(Serialize, Deserialize)] pub enum ScalingMode { /// Manually specify left/right/top/bottom values. /// Ignore window resizing; the image will stretch. diff --git a/crates/bevy_text/src/text.rs b/crates/bevy_text/src/text.rs index b2440e1988aaa..7a8dc176c6349 100644 --- a/crates/bevy_text/src/text.rs +++ b/crates/bevy_text/src/text.rs @@ -187,7 +187,7 @@ impl Default for TextAlignment { /// Describes horizontal alignment preference for positioning & bounds. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Reflect, Serialize, Deserialize)] -#[reflect_value(Serialize, Deserialize)] +#[reflect(Serialize, Deserialize)] pub enum HorizontalAlign { /// Leftmost character is immediately to the right of the render position.
/// Bounds start from the render position and advance rightwards. @@ -213,7 +213,7 @@ impl From for glyph_brush_layout::HorizontalAlign { /// Describes vertical alignment preference for positioning & bounds. Currently a placeholder /// for future functionality. #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Reflect, Serialize, Deserialize)] -#[reflect_value(Serialize, Deserialize)] +#[reflect(Serialize, Deserialize)] pub enum VerticalAlign { /// Characters/bounds start underneath the render position and progress downwards. Top, diff --git a/crates/bevy_ui/src/ui_node.rs b/crates/bevy_ui/src/ui_node.rs index 4483e03aa7ebf..b603d6813b932 100644 --- a/crates/bevy_ui/src/ui_node.rs +++ b/crates/bevy_ui/src/ui_node.rs @@ -21,7 +21,7 @@ pub struct Node { /// An enum that describes possible types of value in flexbox layout options #[derive(Copy, Clone, PartialEq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum Val { /// No value defined #[default] @@ -208,7 +208,7 @@ impl Default for Style { /// How items are aligned according to the cross axis #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum AlignItems { /// Items are aligned at the start FlexStart, @@ -225,7 +225,7 @@ pub enum AlignItems { /// Works like [`AlignItems`] but applies only to a single item #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum AlignSelf { /// Use the value of [`AlignItems`] #[default] @@ -246,7 +246,7 @@ pub enum AlignSelf { /// /// It only applies if [`FlexWrap::Wrap`] is present and if there are multiple lines of items. #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum AlignContent { /// Each line moves towards the start of the cross axis FlexStart, @@ -269,7 +269,7 @@ pub enum AlignContent { /// /// For example English is written LTR (left-to-right) while Arabic is written RTL (right-to-left). #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum Direction { /// Inherit from parent node #[default] @@ -284,7 +284,7 @@ pub enum Direction { /// /// Part of the [`Style`] component. #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum Display { /// Use Flexbox layout model to determine the position of this [`Node`]. #[default] @@ -298,7 +298,7 @@ pub enum Display { /// Defines how flexbox items are ordered within a flexbox #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum FlexDirection { /// Same way as text direction along the main axis #[default] @@ -313,7 +313,7 @@ pub enum FlexDirection { /// Defines how items are aligned according to the main axis #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum JustifyContent { /// Pushed towards the start #[default] @@ -332,7 +332,7 @@ pub enum JustifyContent { /// Whether to show or hide overflowing items #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Reflect, Serialize, Deserialize)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum Overflow { /// Show overflowing items #[default] @@ -343,7 +343,7 @@ pub enum Overflow { /// The strategy used to position this node #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum PositionType { /// Relative to all other nodes with the [`PositionType::Relative`] value #[default] @@ -356,7 +356,7 @@ pub enum PositionType { /// Defines if flexbox items appear on a single line or on multiple lines #[derive(Copy, Clone, PartialEq, Eq, Debug, Default, Serialize, Deserialize, Reflect)] -#[reflect_value(PartialEq, Serialize, Deserialize)] +#[reflect(PartialEq, Serialize, Deserialize)] pub enum FlexWrap { /// Single line, will overflow if needed #[default]