Skip to content
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

Fix cyclic dep #11523

Merged
merged 4 commits into from
Jan 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions crates/bevy_input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,13 @@ bevy_math = { path = "../bevy_math", version = "0.12.0" }
bevy_utils = { path = "../bevy_utils", version = "0.12.0" }
bevy_reflect = { path = "../bevy_reflect", version = "0.12.0", features = [
"glam",
"smol_str",
] }

# other
serde = { version = "1", features = ["derive"], optional = true }
thiserror = "1.0"
smol_str = "0.2"

[dev-dependencies]
bevy = { path = "../../", version = "0.12.0" }

[lints]
workspace = true
18 changes: 11 additions & 7 deletions crates/bevy_input/src/common_conditions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@ use std::hash::Hash;
/// Stateful run condition that can be toggled via a input press using [`ButtonInput::just_pressed`].
///
/// ```no_run
/// use bevy::prelude::*;
/// use bevy::input::common_conditions::input_toggle_active;
/// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, Update};
/// # use bevy_ecs::prelude::IntoSystemConfigs;
/// # use bevy_input::{common_conditions::input_toggle_active, prelude::KeyCode};
///
/// fn main() {
/// App::new()
Expand All @@ -23,8 +24,9 @@ use std::hash::Hash;
/// If you want other systems to be able to access whether the toggled state is active,
/// you should use a custom resource or a state for that:
/// ```no_run
/// use bevy::prelude::*;
/// use bevy::input::common_conditions::input_just_pressed;
/// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, Update};
/// # use bevy_ecs::prelude::{IntoSystemConfigs, Res, ResMut, Resource};
/// # use bevy_input::{common_conditions::input_just_pressed, prelude::KeyCode};
///
/// #[derive(Resource, Default)]
/// struct Paused(bool);
Expand Down Expand Up @@ -72,8 +74,9 @@ where
/// Run condition that is active if [`ButtonInput::just_pressed`] is true for the given input.
///
/// ```no_run
/// use bevy::prelude::*;
/// use bevy::input::common_conditions::input_just_pressed;
/// # use bevy_app::{App, NoopPluginGroup as DefaultPlugins, Update};
/// # use bevy_ecs::prelude::IntoSystemConfigs;
/// # use bevy_input::{common_conditions::input_just_pressed, prelude::KeyCode};
/// fn main() {
/// App::new()
/// .add_plugins(DefaultPlugins)
Expand Down Expand Up @@ -101,7 +104,8 @@ where
#[cfg(test)]
mod tests {
use super::*;
use bevy::prelude::{IntoSystemConfigs, KeyCode, Schedule};
use crate::prelude::KeyCode;
use bevy_ecs::schedule::{IntoSystemConfigs, Schedule};

fn test_system() {}

Expand Down