Rename UiBoxShadowSamples to BoxShadowSamples. (#16505)

# Objective

The `UiBoxShadowSamples` resource should be renamed to
`BoxShadowSamples` so it matches the `BoxShadow` component.

## Migration Guide

`UiBoxShadowSamples` has been renamed to `BoxShadowSamples`
This commit is contained in:
ickshonpe 2024-12-03 19:43:26 +00:00 committed by GitHub
parent 1a6b94c5e8
commit dd49dc71d2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 13 additions and 13 deletions

View File

@ -170,7 +170,7 @@ impl Plugin for UiPlugin {
.register_type::<widget::Label>() .register_type::<widget::Label>()
.register_type::<ZIndex>() .register_type::<ZIndex>()
.register_type::<Outline>() .register_type::<Outline>()
.register_type::<UiBoxShadowSamples>() .register_type::<BoxShadowSamples>()
.register_type::<UiAntiAlias>() .register_type::<UiAntiAlias>()
.configure_sets( .configure_sets(
PostUpdate, PostUpdate,

View File

@ -3,8 +3,8 @@
use core::{hash::Hash, ops::Range}; use core::{hash::Hash, ops::Range};
use crate::{ use crate::{
BoxShadow, CalculatedClip, ComputedNode, DefaultUiCamera, RenderUiSystem, ResolvedBorderRadius, BoxShadow, BoxShadowSamples, CalculatedClip, ComputedNode, DefaultUiCamera, RenderUiSystem,
TargetCamera, TransparentUi, UiBoxShadowSamples, Val, ResolvedBorderRadius, TargetCamera, TransparentUi, Val,
}; };
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::*; use bevy_asset::*;
@ -344,7 +344,7 @@ pub fn queue_shadows(
box_shadow_pipeline: Res<BoxShadowPipeline>, box_shadow_pipeline: Res<BoxShadowPipeline>,
mut pipelines: ResMut<SpecializedRenderPipelines<BoxShadowPipeline>>, mut pipelines: ResMut<SpecializedRenderPipelines<BoxShadowPipeline>>,
mut transparent_render_phases: ResMut<ViewSortedRenderPhases<TransparentUi>>, mut transparent_render_phases: ResMut<ViewSortedRenderPhases<TransparentUi>>,
mut views: Query<(Entity, &ExtractedView, Option<&UiBoxShadowSamples>)>, mut views: Query<(Entity, &ExtractedView, Option<&BoxShadowSamples>)>,
pipeline_cache: Res<PipelineCache>, pipeline_cache: Res<PipelineCache>,
draw_functions: Res<DrawFunctions<TransparentUi>>, draw_functions: Res<DrawFunctions<TransparentUi>>,
) { ) {

View File

@ -6,8 +6,8 @@ pub mod ui_texture_slice_pipeline;
use crate::widget::ImageNode; use crate::widget::ImageNode;
use crate::{ use crate::{
experimental::UiChildren, BackgroundColor, BorderColor, CalculatedClip, ComputedNode, experimental::UiChildren, BackgroundColor, BorderColor, BoxShadowSamples, CalculatedClip,
DefaultUiCamera, Outline, ResolvedBorderRadius, TargetCamera, UiAntiAlias, UiBoxShadowSamples, ComputedNode, DefaultUiCamera, Outline, ResolvedBorderRadius, TargetCamera, UiAntiAlias,
}; };
use bevy_app::prelude::*; use bevy_app::prelude::*;
use bevy_asset::{load_internal_asset, AssetEvent, AssetId, Assets, Handle}; use bevy_asset::{load_internal_asset, AssetEvent, AssetId, Assets, Handle};
@ -537,7 +537,7 @@ pub fn extract_default_ui_camera_view(
RenderEntity, RenderEntity,
&Camera, &Camera,
Option<&UiAntiAlias>, Option<&UiAntiAlias>,
Option<&UiBoxShadowSamples>, Option<&BoxShadowSamples>,
), ),
Or<(With<Camera2d>, With<Camera3d>)>, Or<(With<Camera2d>, With<Camera3d>)>,
>, >,
@ -552,7 +552,7 @@ pub fn extract_default_ui_camera_view(
commands commands
.get_entity(entity) .get_entity(entity)
.expect("Camera entity wasn't synced.") .expect("Camera entity wasn't synced.")
.remove::<(DefaultCameraView, UiAntiAlias, UiBoxShadowSamples)>(); .remove::<(DefaultCameraView, UiAntiAlias, BoxShadowSamples)>();
continue; continue;
} }

View File

@ -2682,14 +2682,14 @@ pub enum UiAntiAlias {
/// fn spawn_camera(mut commands: Commands) { /// fn spawn_camera(mut commands: Commands) {
/// commands.spawn(( /// commands.spawn((
/// Camera2d, /// Camera2d,
/// UiBoxShadowSamples(6), /// BoxShadowSamples(6),
/// )); /// ));
/// } /// }
/// ``` /// ```
#[derive(Component, Clone, Copy, Debug, Reflect, Eq, PartialEq)] #[derive(Component, Clone, Copy, Debug, Reflect, Eq, PartialEq)]
pub struct UiBoxShadowSamples(pub u32); pub struct BoxShadowSamples(pub u32);
impl Default for UiBoxShadowSamples { impl Default for BoxShadowSamples {
fn default() -> Self { fn default() -> Self {
Self(4) Self(4)
} }

View File

@ -29,7 +29,7 @@ fn main() {
fn setup(mut commands: Commands, asset_server: Res<AssetServer>) { fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
// Camera // Camera
commands.spawn((Camera2d, IsDefaultUiCamera, UiBoxShadowSamples(6))); commands.spawn((Camera2d, IsDefaultUiCamera, BoxShadowSamples(6)));
// root node // root node
commands commands

View File

@ -35,7 +35,7 @@ fn setup(mut commands: Commands) {
let args = Args::from_args(&[], &[]).unwrap(); let args = Args::from_args(&[], &[]).unwrap();
// ui camera // ui camera
commands.spawn((Camera2d, UiBoxShadowSamples(args.samples))); commands.spawn((Camera2d, BoxShadowSamples(args.samples)));
commands commands
.spawn(( .spawn((