Skip to content

Commit 91182ee

Browse files
authored
remove ui feature (#730)
* remove ui feature * add release notes * fix RELEASES.md
1 parent 63b65e8 commit 91182ee

File tree

5 files changed

+6
-51
lines changed

5 files changed

+6
-51
lines changed

Cargo.toml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ opt-level = 3
1818
members = ["./", "tools/ci", "macros"]
1919

2020
[features]
21-
default = ["asset", "ui", "mouse", "keyboard", "gamepad", "picking"]
21+
default = ["asset", "mouse", "keyboard", "gamepad", "picking"]
2222

2323
# Allow support for tracking timing information about actions (how long a button was pressed, etc.)
2424
timing = []
@@ -35,10 +35,6 @@ gamepad = ["bevy/bevy_gilrs"]
3535
# Allow using the `InputMap` as `bevy::asset::Asset`.
3636
asset = ['bevy/bevy_asset']
3737

38-
# Add support for 'bevy::ui' integration:
39-
# - Allow 'bevy::ui' to take priority over actions when processing inputs.
40-
ui = ['bevy/bevy_ui']
41-
4238
# Add support for 'bevy::picking' integration:
4339
# - Order systems to allow picking observers to modify action state.
4440
picking = ['bevy/bevy_picking']
@@ -71,7 +67,6 @@ bevy = { version = "0.18.0-rc.2", default-features = false, features = [
7167
"bevy_asset",
7268
"bevy_sprite",
7369
"bevy_text",
74-
"bevy_ui",
7570
"bevy_render",
7671
"bevy_core_pipeline",
7772
"bevy_state",

RELEASES.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22

33
## Version 0.21.0 (Unreleased)
44

5+
### Breaking Changes (0.21.0)
6+
7+
- Removed the `ui` feature. This was a default feature. The `ui` feature would attempt to filter out mouse clicks captured by `bevy::ui::Interaction`s. This can be handled by temporarily disabling mouse click actions or entire action status during UI heavy scenes or interactions.
8+
59
### Bugs (0.21.0)
610

711
- `ActionDiff`s generated will no longer include entries from disabled `ActionState`s or disabled `Action`s

src/plugin.rs

Lines changed: 0 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,6 @@ use bevy::input::InputSystems;
1010
use bevy::picking::PickingSystems;
1111
use bevy::prelude::*;
1212
use bevy::reflect::TypePath;
13-
#[cfg(feature = "ui")]
14-
use bevy::ui::UiSystems;
1513
use updating::CentralInputStore;
1614

1715
use crate::Actionlike;
@@ -137,32 +135,6 @@ impl<A: Actionlike + TypePath + bevy::reflect::GetTypeRegistration> Plugin
137135
.after(InputManagerSystem::Unify),
138136
);
139137

140-
#[cfg(feature = "ui")]
141-
app.add_systems(
142-
PreUpdate,
143-
filter_captured_input
144-
.before(update_action_state::<A>)
145-
.in_set(InputManagerSystem::Filter),
146-
);
147-
148-
#[cfg(feature = "ui")]
149-
app.configure_sets(
150-
PreUpdate,
151-
InputManagerSystem::Filter.after(UiSystems::Focus),
152-
);
153-
154-
#[cfg(feature = "ui")]
155-
app.configure_sets(
156-
PreUpdate,
157-
InputManagerSystem::ManualControl
158-
.after(InputManagerSystem::Tick)
159-
// Must run after the system is updated from inputs, or it will be forcibly released due to the inputs
160-
// not being pressed
161-
.after(InputManagerSystem::Update)
162-
.after(UiSystems::Focus)
163-
.after(InputSystems),
164-
);
165-
166138
#[cfg(feature = "picking")]
167139
app.configure_sets(
168140
PreUpdate,

src/systems.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -104,22 +104,6 @@ pub fn update_action_state<A: Actionlike>(
104104
}
105105
}
106106

107-
#[cfg(feature = "ui")]
108-
/// Filters out all inputs that are captured by the UI.
109-
pub fn filter_captured_input(
110-
mut mouse_buttons: ResMut<bevy::input::ButtonInput<bevy::input::mouse::MouseButton>>,
111-
#[cfg(feature = "ui")] interactions: Query<&bevy::ui::Interaction>,
112-
) {
113-
// If the user clicks on a button, do not apply it to the game state
114-
#[cfg(feature = "ui")]
115-
if interactions
116-
.iter()
117-
.any(|&interaction| interaction != bevy::ui::Interaction::None)
118-
{
119-
mouse_buttons.clear();
120-
}
121-
}
122-
123107
/// Generates an [`Messages`] stream of [`ActionDiff`s](crate::action_diff::ActionDiff) from every [`ActionState`].
124108
///
125109
/// This system is not part of the [`InputManagerPlugin`](crate::plugin::InputManagerPlugin) and must be added manually.

tools/ci/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ fn main() {
7878
}
7979

8080
// The features the lib offers
81-
let lib_features = ["asset", "timing", "ui"];
81+
let lib_features = ["asset", "timing"];
8282

8383
// Generate all possible combinations of lib features
8484
// and convert them into '--features=<FEATURE_A,FEATURE_B,...>'

0 commit comments

Comments
 (0)