Skip to content

Commit

Permalink
renamed MockUIInput to MockUIInteraction
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyClements committed Dec 11, 2023
1 parent 93b3316 commit 69b31bc
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions src/input_mocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ pub trait QueryInput {

/// Send fake UI interaction for testing purposes.
#[cfg(feature = "ui")]
pub trait MockUIInput {
pub trait MockUIInteraction {
/// Presses all `bevy::ui` buttons with the matching `Marker` component
///
/// Changes their [`Interaction`] component to [`Interaction::Pressed`]
Expand Down Expand Up @@ -438,7 +438,7 @@ impl QueryInput for World {
}

#[cfg(feature = "ui")]
impl MockUIInput for World {
impl MockUIInteraction for World {
fn click_button<Marker: Component>(&mut self) {
let mut button_query = self.query_filtered::<&mut Interaction, With<Marker>>();

Expand Down Expand Up @@ -489,7 +489,7 @@ impl QueryInput for App {
}

#[cfg(feature = "ui")]
impl MockUIInput for App {
impl MockUIInteraction for App {
fn click_button<Marker: Component>(&mut self) {
self.world.click_button::<Marker>();
}
Expand All @@ -501,7 +501,7 @@ impl MockUIInput for App {

#[cfg(test)]
mod test {
use crate::input_mocking::{MockInput, MockUIInput, QueryInput};
use crate::input_mocking::{MockInput, MockUIInteraction, QueryInput};
use bevy::{
input::{
gamepad::{GamepadConnection, GamepadConnectionEvent, GamepadEvent, GamepadInfo},
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ pub mod prelude {
pub use crate::clashing_inputs::ClashStrategy;
pub use crate::input_map::InputMap;
#[cfg(feature = "ui")]
pub use crate::input_mocking::MockUIInput;
pub use crate::input_mocking::MockUIInteraction;
pub use crate::input_mocking::{MockInput, QueryInput};
pub use crate::scan_codes::QwertyScanCode;
pub use crate::user_input::{Modifier, UserInput};
Expand Down

0 comments on commit 69b31bc

Please sign in to comment.