diff --git a/crates/bevy_plugin/src/commands/command_registry.rs b/crates/bevy_plugin/src/commands/command_registry.rs index 6fa4c8cc..9e156620 100644 --- a/crates/bevy_plugin/src/commands/command_registry.rs +++ b/crates/bevy_plugin/src/commands/command_registry.rs @@ -179,6 +179,7 @@ mod tests { fn can_call_fn_with_no_args() { let mut methods = YarnCommands::default(); + #[allow(clippy::unused_unit)] // Needed for 2024 edition methods.add_command("test", |_: In<()>| -> () { panic!("It works!") }); let method = methods.get_mut("test").unwrap(); let mut app = App::new(); diff --git a/crates/bevy_plugin/src/commands/command_wrapping.rs b/crates/bevy_plugin/src/commands/command_wrapping.rs index 7c2d619a..7bf9fcb1 100644 --- a/crates/bevy_plugin/src/commands/command_wrapping.rs +++ b/crates/bevy_plugin/src/commands/command_wrapping.rs @@ -14,7 +14,7 @@ pub(crate) fn command_wrapping_plugin(_app: &mut App) {} /// A method that can be registered as a command for Yarn files via [`YarnCommands::add_command`]. /// /// The signature of the method must adhere to the following rules: -/// - The first parameter must be of the type `In`, where `T` can be converted into a [`YarnFnParam`]. This stands for the parameters passed to the command from Yarn. +/// The first parameter must be of the type `In`, where `T` can be converted into a [`YarnFnParam`]. This stands for the parameters passed to the command from Yarn. /// Multiple parameters are supported as values wrapped in a tuple. /// For example, to register a command that is called from Yarn like `<>`, the first parameter must be of the type `In<(String, i32)>` and a call to `register_command` might look like this: /// ```rust @@ -27,6 +27,7 @@ pub(crate) fn command_wrapping_plugin(_app: &mut App) {} /// println!("Adding player {name} with age {age}"); /// } /// ``` +/// /// The parameters following the `In` parameter are taken from the Bevy ECS as any other system would. For example, the following command would print the elapsed time since the game started: /// ```rust /// # use bevy_yarnspinner::prelude::*; diff --git a/crates/bevy_plugin/src/lib.rs b/crates/bevy_plugin/src/lib.rs index 49549834..9abccf68 100644 --- a/crates/bevy_plugin/src/lib.rs +++ b/crates/bevy_plugin/src/lib.rs @@ -9,7 +9,7 @@ //! - [`YarnSpinnerPlugin`]: The plugin registering all systems and types. //! - [`YarnProject`]: A [`Resource`](bevy::prelude::Resource) for the compiled Yarn project, which is created for you when [`YarnSpinnerPlugin`] is added. //! - [`DialogueRunner`]: The [`Component`](bevy::prelude::Component) running through the Yarn files and sending events for things you should draw on the screen. -//! Can be created from a [`YarnProject`]. +//! Can be created from a [`YarnProject`]. //! //! ## Dialogue Views //! @@ -39,7 +39,7 @@ //! The main workflow is as follows: //! - Register the [`YarnSpinnerPlugin`] //! - When the [`YarnProject`] [`Resource`](bevy::prelude::Resource) is added, spawn a [`DialogueRunner`] from it. -//! The latter can nicely be done with `my_system.run_if(resource_added::)`. +//! The latter can nicely be done with `my_system.run_if(resource_added::)`. //! //! The following example is adapted from the [hello world example](https://github.com/YarnSpinnerTool/YarnSpinner-Rust/blob/main/examples/bevy_yarnspinner/src/bin/hello_world.rs). //!