mirror of
https://github.com/bevyengine/bevy
synced 2024-11-22 20:53:53 +00:00
a5d70b8952
# Objective The window event types currently don't support reflection. This PR adds support to them (as requested [here](https://github.com/bevyengine/bevy/issues/6223#issuecomment-1273852329)). ## 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`.
29 lines
840 B
TOML
29 lines
840 B
TOML
[package]
|
|
name = "bevy_window"
|
|
version = "0.9.0"
|
|
edition = "2021"
|
|
description = "Provides windowing functionality for Bevy Engine"
|
|
homepage = "https://bevyengine.org"
|
|
repository = "https://github.com/bevyengine/bevy"
|
|
license = "MIT OR Apache-2.0"
|
|
keywords = ["bevy"]
|
|
|
|
[features]
|
|
default = []
|
|
serialize = ["serde"]
|
|
|
|
[dependencies]
|
|
# bevy
|
|
bevy_app = { path = "../bevy_app", version = "0.9.0" }
|
|
bevy_ecs = { path = "../bevy_ecs", version = "0.9.0" }
|
|
bevy_math = { path = "../bevy_math", version = "0.9.0" }
|
|
bevy_reflect = { path = "../bevy_reflect", version = "0.9.0", features = [
|
|
"glam",
|
|
] }
|
|
bevy_utils = { path = "../bevy_utils", version = "0.9.0" }
|
|
# Used for close_on_esc
|
|
bevy_input = { path = "../bevy_input", version = "0.9.0" }
|
|
raw-window-handle = "0.5"
|
|
|
|
# other
|
|
serde = { version = "1.0", features = ["derive"], optional = true }
|