-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Merged by Bors] - Derive Reflect
+ FromReflect
for window event types
#6235
Conversation
Reflect
+ FromReflect
on window typesReflect
+ FromReflect
for window types
Reflect
+ FromReflect
for window typesReflect
+ FromReflect
for window event types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few comments, otherwise looks good!
`bevy_window` already depends on `glam` transitively, this just imports the reflection impls.
Edit: changes are merged now |
@TehPers Could you rebase this PR? |
@TehPers looks like there's been some more conflicts added. Could you rebase? I'm hoping we can actually try to get this in soon so it's not just sitting around increasing in conflicts for you to resolve 😅 |
bors r+ |
# Objective The window event types currently don't support reflection. This PR adds support to them (as requested [here](#6223 (comment))). ## Solution Implement `Reflect` + `FromReflect` for window event types. Relevant traits are also being reflected with `#[reflect(...)]` attributes. Additionally, this PR derives `Reflect` + `FromReflect` for `WindowDescriptor` and the types it depends on so that `CreateWindow` events can be fully manipulated through reflection. Finally, this PR adds `FromReflect` for `PathBuf` as a value type, which is needed for `FileDragAndDrop`. This adds the "glam" feature to the `bevy_reflect` dependency for package `bevy_window`. Since `bevy_window` transitively depends on `glam` already, all this brings in are the reflection `impl`s. ## Open questions Should `app.register_type::<PathBuf>();` be moved to `CorePlugin`? I added it to `WindowPlugin` because that's where it's used and `CorePlugin` doesn't seem to register all the missing std types, but it would also make sense in `CorePlugin` I believe since it's a commonly used type. --- ## Changelog Added: - Implemented `Reflect` + `FromReflect` for window events and related types. These types are automatically registered when adding the `WindowPlugin`.
Reflect
+ FromReflect
for window event typesReflect
+ FromReflect
for window event types
) # Objective The window event types currently don't support reflection. This PR adds support to them (as requested [here](bevyengine#6223 (comment))). ## Solution Implement `Reflect` + `FromReflect` for window event types. Relevant traits are also being reflected with `#[reflect(...)]` attributes. Additionally, this PR derives `Reflect` + `FromReflect` for `WindowDescriptor` and the types it depends on so that `CreateWindow` events can be fully manipulated through reflection. Finally, this PR adds `FromReflect` for `PathBuf` as a value type, which is needed for `FileDragAndDrop`. This adds the "glam" feature to the `bevy_reflect` dependency for package `bevy_window`. Since `bevy_window` transitively depends on `glam` already, all this brings in are the reflection `impl`s. ## Open questions Should `app.register_type::<PathBuf>();` be moved to `CorePlugin`? I added it to `WindowPlugin` because that's where it's used and `CorePlugin` doesn't seem to register all the missing std types, but it would also make sense in `CorePlugin` I believe since it's a commonly used type. --- ## Changelog Added: - Implemented `Reflect` + `FromReflect` for window events and related types. These types are automatically registered when adding the `WindowPlugin`.
) # Objective The window event types currently don't support reflection. This PR adds support to them (as requested [here](bevyengine#6223 (comment))). ## Solution Implement `Reflect` + `FromReflect` for window event types. Relevant traits are also being reflected with `#[reflect(...)]` attributes. Additionally, this PR derives `Reflect` + `FromReflect` for `WindowDescriptor` and the types it depends on so that `CreateWindow` events can be fully manipulated through reflection. Finally, this PR adds `FromReflect` for `PathBuf` as a value type, which is needed for `FileDragAndDrop`. This adds the "glam" feature to the `bevy_reflect` dependency for package `bevy_window`. Since `bevy_window` transitively depends on `glam` already, all this brings in are the reflection `impl`s. ## Open questions Should `app.register_type::<PathBuf>();` be moved to `CorePlugin`? I added it to `WindowPlugin` because that's where it's used and `CorePlugin` doesn't seem to register all the missing std types, but it would also make sense in `CorePlugin` I believe since it's a commonly used type. --- ## Changelog Added: - Implemented `Reflect` + `FromReflect` for window events and related types. These types are automatically registered when adding the `WindowPlugin`.
Objective
The window event types currently don't support reflection. This PR adds support to them (as requested here).
Solution
Implement
Reflect
+FromReflect
for window event types. Relevant traits are also being reflected with#[reflect(...)]
attributes.Additionally, this PR derives
Reflect
+FromReflect
forWindowDescriptor
and the types it depends on so thatCreateWindow
events can be fully manipulated through reflection.Finally, this PR adds
FromReflect
forPathBuf
as a value type, which is needed forFileDragAndDrop
.This adds the "glam" feature to the
bevy_reflect
dependency for packagebevy_window
. Sincebevy_window
transitively depends onglam
already, all this brings in are the reflectionimpl
s.Open questions
Should
app.register_type::<PathBuf>();
be moved toCorePlugin
? I added it toWindowPlugin
because that's where it's used andCorePlugin
doesn't seem to register all the missing std types, but it would also make sense inCorePlugin
I believe since it's a commonly used type.Changelog
Added:
Reflect
+FromReflect
for window events and related types. These types are automatically registered when adding theWindowPlugin
.