-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
[Merged by Bors] - Reflect Default for ComputedVisibility and Handle<T>
#6187
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
Conversation
alice-i-cecile
left a comment
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.
Shouldn't we have a Default trait impl for this reflection to work? Or at least for consistency.
|
Yes, both types already had |
alice-i-cecile
left a comment
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.
Thanks for the explanation; it wasn't visible in the code review pane :)
|
Merging as trivial. bors r+ |
# Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
|
Pull request successfully merged into main. Build succeeded: |
ComputedVisibility and Handle<T>ComputedVisibility and Handle<T>
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as #6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
…6187) # Objective - Reflecting `Default` is required for scripts to create `Reflect` types at runtime with no static type information. - Reflecting `Default` on `Handle<T>` and `ComputedVisibility` should allow scripts from `bevy_mod_js_scripting` to actually spawn sprites from scratch, without needing any hand-holding from the host-game. ## Solution - Derive `ReflectDefault` for `Handle<T>` and `ComputedVisiblity`. --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - The `Default` trait is now reflected for `Handle<T>` and `ComputedVisibility`
# Objective Make `GlobalTransform` constructible from scripts, in the same vein as bevyengine#6187. ## Solution - Use the derive macro to reflect default --- ## Changelog > This section is optional. If this was a trivial fix, or has no externally-visible impact, you can delete this section. - `GlobalTransform` now reflects the `Default` trait.
Objective
Defaultis required for scripts to createReflecttypes at runtime with no static type information.DefaultonHandle<T>andComputedVisibilityshould allow scripts frombevy_mod_js_scriptingto actually spawn sprites from scratch, without needing any hand-holding from the host-game.Solution
ReflectDefaultforHandle<T>andComputedVisiblity.Changelog
Defaulttrait is now reflected forHandle<T>andComputedVisibility