-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
UiWidgetsPlugins and InputDispatchPlugin are now in DefaultPlugins
#23346
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
base: main
Are you sure you want to change the base?
Changes from all commits
5335b24
e7bab9f
6c8b886
714bd13
d310bdf
79940d7
8ec74b4
fb25d06
f7fad09
12bb5f7
36ddbad
9c21ed7
e2d6051
d36148e
aee5607
56937a6
e2ff949
3e1f711
39cc0e3
69fa98e
25880c6
8e6a735
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| --- | ||
| title: "`UiWidgetsPlugins` and `InputDispatchPlugin` are now in `DefaultPlugins`" | ||
| pull_requests: [23346] | ||
| --- | ||
|
|
||
| `UiWidgetsPlugins` and `InputDispatchPlugin` are now part of `DefaultPlugins`. | ||
|
|
||
| TODO: Why did we make this breaking change? | ||
|
|
||
| Remove `UiWidgetsPlugins` if you have `DefaultPlugins` | ||
|
|
||
| ```rs | ||
| // 0.18 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins, UiWidgetsPlugins) | ||
| .add_plugins((my_ambitious_game::game_plugin)) | ||
| .run(); | ||
| } | ||
|
|
||
| // 0.19 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins) // Puff! | ||
| .add_plugins((my_ambitious_game::game_plugin)) | ||
| .run(); | ||
| } | ||
| ``` | ||
|
|
||
| Remove `InputDispatchPlugin` if you have `DefaultPlugins` | ||
|
|
||
| ```rs | ||
| // 0.18 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins, UiWidgetsPlugins, InputDispatchPlugin) | ||
| .add_plugins((my_sequel_game::game_plugin)) | ||
| .run(); | ||
| } | ||
|
|
||
| // 0.19 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins) // Puff! | ||
| .add_plugins((my_sequel_game::game_plugin)) | ||
| .run(); | ||
| } | ||
| ``` | ||
|
|
||
| Remove `PopoverPlugin` if you have `DefaultPlugins` | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I personally would remove the |
||
|
|
||
| ```rs | ||
| // 0.18 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins, PopoverPlugin) | ||
| .add_plugins((my_threequel_game::game_plugin)) | ||
| .run(); | ||
| } | ||
|
|
||
| // 0.19 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins) // Puff! | ||
| .add_plugins((my_threequel_game::game_plugin)) | ||
| .run(); | ||
| } | ||
| ``` | ||
|
|
||
| Remove `ScrollbarPlugin` if you have `DefaultPlugins` | ||
|
|
||
| ```rs | ||
| // 0.18 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins, ScrollbarPlugin) | ||
| .add_plugins((my_fourquel_game::game_plugin)) | ||
| .run(); | ||
| } | ||
|
|
||
| // 0.19 | ||
| fn main() { | ||
| App::new() | ||
| .add_plugins(DefaultPlugins) // Puff! | ||
| .add_plugins((my_fourquel_game::game_plugin)) | ||
| .run(); | ||
| } | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -43,6 +43,7 @@ use bevy_input::gamepad::GamepadButtonChangedEvent; | |
| use bevy_input::keyboard::KeyboardInput; | ||
| #[cfg(feature = "mouse")] | ||
| use bevy_input::mouse::MouseWheel; | ||
| use bevy_input::InputSystems; | ||
| use bevy_window::{PrimaryWindow, Window}; | ||
| use core::fmt::Debug; | ||
|
|
||
|
|
@@ -219,6 +220,7 @@ impl Traversal<AcquireFocus> for WindowTraversal { | |
| /// | ||
| /// To add bubbling to your own input events, add the [`dispatch_focused_input::<MyEvent>`](dispatch_focused_input) system to your app, | ||
| /// as described in the docs for [`FocusedInput`]. | ||
| #[derive(Default)] | ||
| pub struct InputDispatchPlugin; | ||
|
|
||
| impl Plugin for InputDispatchPlugin { | ||
|
|
@@ -238,7 +240,9 @@ impl Plugin for InputDispatchPlugin { | |
| #[cfg(feature = "mouse")] | ||
| dispatch_focused_input::<MouseWheel>, | ||
| ) | ||
| .in_set(InputFocusSystems::Dispatch), | ||
| .in_set(InputFocusSystems::Dispatch) | ||
| .ambiguous_with(InputFocusSystems::Dispatch) | ||
| .after(InputSystems), | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Technically I think you only need this |
||
| ); | ||
| } | ||
| } | ||
|
|
||
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.
I’m not sure if this is necessary to be answered in every migration guide, but someone else can give more context for this. I wouldn’t say it’s just for deprecation of
Interaction, but because these plugins are mature enough that they now can be included in the default experience.