Register a few missed reflect components (#8807)

# Objective

-  Some reflect components weren't properly registered.

## Solution

- We register them
- I also sorted the register lines in `Plugin::build` in `bevy_ui`

### Note

How I did I find them:

- I picked up the list of `Component`s from the `Component` trait page
in rustdoc.
- Then I tried to register all of them. Removing the registration when
it doesn't implement `Reflect` to pass compilation.
- Then I added `app.register_type_data::<T, Foo>()`, for all Reflect
components. It panics if `T` is not registered.
- I repeated the last line N times until bevy stopped panicking at
startup

---

## Changelog

- Register the following components: `PrimaryWindow` `Fxaa`
`FogSettings` `NotShadowCaster` `NotShadowReceiver` `CalculatedClip`
`RelativeCursorPosition`
This commit is contained in:
Nicola Papale 2023-06-11 01:19:39 +02:00 committed by GitHub
parent 0ed8b20d8a
commit 83de94f9f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 12 additions and 5 deletions

View file

@ -86,6 +86,7 @@ impl Plugin for FxaaPlugin {
fn build(&self, app: &mut App) {
load_internal_asset!(app, FXAA_SHADER_HANDLE, "fxaa.wgsl", Shader::from_wgsl);
app.register_type::<Fxaa>();
app.add_plugin(ExtractComponentPlugin::<Fxaa>::default());
let render_app = match app.get_sub_app_mut(RenderApp) {

View file

@ -174,6 +174,8 @@ impl Plugin for PbrPlugin {
.register_type::<CubemapVisibleEntities>()
.register_type::<DirectionalLight>()
.register_type::<DirectionalLightShadowMap>()
.register_type::<NotShadowCaster>()
.register_type::<NotShadowReceiver>()
.register_type::<PointLight>()
.register_type::<PointLightShadowMap>()
.register_type::<SpotLight>()

View file

@ -137,6 +137,7 @@ impl Plugin for FogPlugin {
fn build(&self, app: &mut App) {
load_internal_asset!(app, FOG_SHADER_HANDLE, "fog.wgsl", Shader::from_wgsl);
app.register_type::<FogSettings>();
app.add_plugin(ExtractComponentPlugin::<FogSettings>::default());
if let Ok(render_app) = app.get_sub_app_mut(RenderApp) {

View file

@ -88,35 +88,37 @@ impl Plugin for UiPlugin {
.register_type::<AlignContent>()
.register_type::<AlignItems>()
.register_type::<AlignSelf>()
.register_type::<BackgroundColor>()
.register_type::<CalculatedClip>()
.register_type::<ContentSize>()
.register_type::<Direction>()
.register_type::<Display>()
.register_type::<FlexDirection>()
.register_type::<FlexWrap>()
.register_type::<FocusPolicy>()
.register_type::<GridAutoFlow>()
.register_type::<GridPlacement>()
.register_type::<GridTrack>()
.register_type::<RepeatedGridTrack>()
.register_type::<FocusPolicy>()
.register_type::<Interaction>()
.register_type::<JustifyContent>()
.register_type::<JustifyItems>()
.register_type::<JustifySelf>()
.register_type::<Node>()
.register_type::<ZIndex>()
// NOTE: used by Style::aspect_ratio
.register_type::<Option<f32>>()
.register_type::<Overflow>()
.register_type::<OverflowAxis>()
.register_type::<PositionType>()
.register_type::<UiRect>()
.register_type::<RelativeCursorPosition>()
.register_type::<RepeatedGridTrack>()
.register_type::<Style>()
.register_type::<BackgroundColor>()
.register_type::<UiImage>()
.register_type::<UiImageSize>()
.register_type::<UiRect>()
.register_type::<Val>()
.register_type::<widget::Button>()
.register_type::<widget::Label>()
.register_type::<ZIndex>()
.add_systems(
PreUpdate,
ui_focus_system.in_set(UiSystem::Focus).after(InputSystem),

View file

@ -127,6 +127,7 @@ impl Plugin for WindowPlugin {
// Register window descriptor and related types
app.register_type::<Window>()
.register_type::<PrimaryWindow>()
.register_type::<Cursor>()
.register_type::<CursorIcon>()
.register_type::<CursorGrabMode>()