Skip to content

Commit

Permalink
Fix a few typos (Leafwing-Studios#339)
Browse files Browse the repository at this point in the history
  • Loading branch information
striezel authored Apr 9, 2023
1 parent 5c90336 commit 6de79df
Show file tree
Hide file tree
Showing 14 changed files with 28 additions and 28 deletions.
4 changes: 2 additions & 2 deletions RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
- Added gamepad axis support.
- Use the new `SingleAxis` and `DualAxis` types / variants.
- Added mousewheel and mouse motion support.
- Use the new `SingleAxis` and `DualAxis` types / variants when you care about the continous values.
- Use the new `SingleAxis` and `DualAxis` types / variants when you care about the continuous values.
- Use the new `MouseWheelDirection` enum as an `InputKind`.
- Added `SingleAxis` and `DualAxis` structs that can be supplied to an `InputMap` to trigger on axis inputs.
- Added `VirtualDPad` struct that can be supplied to an `InputMap` to trigger on four direction-representing inputs.
Expand Down Expand Up @@ -243,7 +243,7 @@

- the `ActionState` component is no longer marked as `Changed` every frame
- `InputManagerPlugin::run_in_state` now actually works!
- virtually all methods now take actions and inputs by reference, rather than by ownership, eliminating unneccesary copies
- virtually all methods now take actions and inputs by reference, rather than by ownership, eliminating unnecessary copies

## Version 0.1.2

Expand Down
8 changes: 4 additions & 4 deletions examples/mouse_motion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ fn setup(mut commands: Commands) {
.spawn(Camera2dBundle::default())
.insert(InputManagerBundle::<CameraMovement> {
input_map: InputMap::default()
// This will capture the total continous value, for direct use
// Note that you can also use discrete gesture-like motion, via the `MouseMotionDirection` enum
// This will capture the total continuous value, for direct use.
// Note that you can also use discrete gesture-like motion, via the `MouseMotionDirection` enum.
.insert(DualAxis::mouse_motion(), CameraMovement::Pan)
.build(),
..default()
Expand All @@ -40,8 +40,8 @@ fn pan_camera(mut query: Query<(&mut Transform, &ActionState<CameraMovement>), W

let camera_pan_vector = action_state.axis_pair(CameraMovement::Pan).unwrap();

// Because we're moving the camera, not the object, we want to pan in the opposite direction
// However, UI cordinates are inverted on the y-axis, so we need to flip y a second time
// Because we're moving the camera, not the object, we want to pan in the opposite direction.
// However, UI coordinates are inverted on the y-axis, so we need to flip y a second time.
camera_transform.translation.x -= CAMERA_PAN_RATE * camera_pan_vector.x();
camera_transform.translation.y += CAMERA_PAN_RATE * camera_pan_vector.y();
}
6 changes: 3 additions & 3 deletions examples/mouse_wheel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,15 +23,15 @@ fn setup(mut commands: Commands) {
.spawn(Camera2dBundle::default())
.insert(InputManagerBundle::<CameraMovement> {
input_map: InputMap::default()
// This will capture the total continous value, for direct use
// This will capture the total continuous value, for direct use.
.insert(SingleAxis::mouse_wheel_y(), CameraMovement::Zoom)
// This will return a binary button-like output
// This will return a binary button-like output.
.insert(MouseWheelDirection::Left, CameraMovement::PanLeft)
.insert(MouseWheelDirection::Right, CameraMovement::PanRight)
// Alternatively, you could model this as a virtual Dpad,
// which is extremely useful when you want to model 4-directional buttonlike inputs using the mouse wheel
// .insert(VirtualDpad::mouse_wheel(), Pan)
// Or even a continous `DualAxis`!
// Or even a continuous `DualAxis`!
// .insert(DualAxis::mouse_wheel(), Pan)
.build(),
..default()
Expand Down
2 changes: 1 addition & 1 deletion examples/multiplayer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ impl PlayerBundle {
.build(),
};

// Each player will use the same gamepad controls, but on seperate gamepads
// Each player will use the same gamepad controls, but on separate gamepads.
input_map.insert_multiple([
(GamepadButtonType::DPadLeft, Action::Left),
(GamepadButtonType::DPadRight, Action::Right),
Expand Down
2 changes: 1 addition & 1 deletion examples/send_actions_over_network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ enum FpsAction {
struct StableId(u64);

fn main() {
// In a real use case, these apps would be running on seperate devices
// In a real use case, these apps would be running on separate devices.
let mut client_app = App::new();

client_app
Expand Down
2 changes: 1 addition & 1 deletion src/clashing_inputs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ impl<A: Actionlike> InputMap<A> {
if action_data[clash.index_a].state.pressed()
&& action_data[clash.index_b].state.pressed()
{
// Check if the potential clash occured based on the pressed inputs
// Check if the potential clash occurred based on the pressed inputs
if let Some(clash) = check_clash(&clash, input_streams) {
clashes.push(clash)
}
Expand Down
4 changes: 2 additions & 2 deletions src/display_impl.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! Containment module for boring implmentations of the [`Display`] trait
//! Containment module for boring implementations of the [`Display`] trait
use crate::axislike::{VirtualAxis, VirtualDPad};
use crate::user_input::{InputKind, UserInput};
Expand All @@ -9,7 +9,7 @@ impl Display for UserInput {
match self {
// The representation of the button
UserInput::Single(button) => write!(f, "{button}"),
// The representation of each button, seperated by "+"
// The representation of each button, separated by "+"
UserInput::Chord(button_set) => {
let mut string = String::default();
for button in button_set.iter() {
Expand Down
2 changes: 1 addition & 1 deletion src/input_map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ impl<A: Actionlike> InputMap<A> {
/// 2. Add bindings and configure the struct using a chain of method calls directly on this struct.
/// 3. Finish building your struct by calling `.build()`, receiving a concrete struct you can insert as a component.
///
/// Note that this is not the *orginal* input map, as we do not have ownership of the struct.
/// Note that this is not the *original* input map, as we do not have ownership of the struct.
/// Under the hood, this is just a more-readable call to `.clone()`.
///
/// # Example
Expand Down
4 changes: 2 additions & 2 deletions src/input_mocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ pub trait MockInput {
///
/// To send specific values for axislike inputs, set their `value` field.
///
/// Gamepad input will be sent by the first registed controller found.
/// Gamepad input will be sent by the first registered controller found.
/// If none are found, gamepad input will be silently skipped.
///
/// # Warning
Expand All @@ -99,7 +99,7 @@ pub trait MockInput {

/// Releases the specified `user_input` directly
///
/// Gamepad input will be released by the first registed controller found.
/// Gamepad input will be released by the first registered controller found.
/// If none are found, gamepad input will be silently skipped.
fn release_input(&mut self, input: impl Into<UserInput>);

Expand Down
2 changes: 1 addition & 1 deletion src/orientation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ mod rotation_direction {
}
}

/// Reverese the direction into the opposite enum variant
/// Reverse the direction into the opposite enum variant
#[inline]
pub fn reverse(self) -> RotationDirection {
use RotationDirection::*;
Expand Down
6 changes: 3 additions & 3 deletions src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ use bevy::ui::UiSystem;
/// Each variant represents a "virtual button" whose state is stored in an [`ActionState`](crate::action_state::ActionState) struct.
///
/// Each [`InputManagerBundle`](crate::InputManagerBundle) contains:
/// - an [`InputMap`](crate::input_map::InputMap) component, which stores an entity-specific mapping between the assorted input streams and an internal repesentation of "actions"
/// - an [`InputMap`](crate::input_map::InputMap) component, which stores an entity-specific mapping between the assorted input streams and an internal representation of "actions"
/// - an [`ActionState`](crate::action_state::ActionState) component, which stores the current input state for that entity in an source-agnostic fashion
///
/// If you have more than one distinct type of action (e.g. menu actions, camera actions and player actions), consider creating multiple `Actionlike` enums
Expand All @@ -31,7 +31,7 @@ use bevy::ui::UiSystem;
/// All systems added by this plugin can be dynamically enabled and disabled by setting the value of the [`ToggleActions<A>`] resource is set.
/// This can be useful when working with states to pause the game, navigate menus or so on.
///
/// **WARNING:** Theses systems run during [`CoreSet::PreUpdate`].
/// **WARNING:** These systems run during [`CoreSet::PreUpdate`].
/// If you have systems that care about inputs and actions that also run during this stage,
/// you must define an ordering between your systems or behavior will be very erratic.
/// The stable system sets for these systems are available under [`InputManagerSystem`] enum.
Expand Down Expand Up @@ -201,6 +201,6 @@ pub enum InputManagerSystem {
ReleaseOnDisable,
/// Manually control the [`ActionState`](crate::action_state::ActionState)
///
/// Must run after [`InputManagerSystem::Update`] or the action state will be overriden
/// Must run after [`InputManagerSystem::Update`] or the action state will be overridden
ManualControl,
}
2 changes: 1 addition & 1 deletion src/scan_codes/mac_os.rs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ pub enum QwertyScanCode {
LAlt = 0x3a,
/// The location of the left Control key on the QWERTY keyboard layout.
LControl = 0x3b,
/// The location of the right Shif key on the QWERTY keyboard layout.
/// The location of the right Shift key on the QWERTY keyboard layout.
RShift = 0x3c,
/// The location of the right Alt key on the QWERTY keyboard layout.
/// Maps to right Option key on Apple keyboards.
Expand Down
8 changes: 4 additions & 4 deletions src/systems.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ pub fn tick_action_state<A: Actionlike>(
*stored_previous_instant = time.last_update();
}

/// Fetches all of the releveant [`Input`] resources to update [`ActionState`] according to the [`InputMap`]
/// Fetches all of the relevant [`Input`] resources to update [`ActionState`] according to the [`InputMap`].
///
/// Missing resources will be ignored, and treated as if none of the corresponding inputs were pressed
/// Missing resources will be ignored, and treated as if none of the corresponding inputs were pressed.
#[allow(clippy::too_many_arguments)]
pub fn update_action_state<A: Actionlike>(
gamepad_buttons: Res<Input<GamepadButton>>,
Expand Down Expand Up @@ -163,7 +163,7 @@ pub fn update_action_state_from_interaction<A: Actionlike>(

/// Generates an [`Events`](bevy::ecs::event::Events) stream of [`ActionDiff`] from [`ActionState`]
///
/// The `ID` generic type should be a stable entity identifer,
/// The `ID` generic type should be a stable entity identifier,
/// suitable to be sent across a network.
///
/// This system is not part of the [`InputManagerPlugin`](crate::plugin::InputManagerPlugin) and must be added manually.
Expand All @@ -190,7 +190,7 @@ pub fn generate_action_diffs<A: Actionlike, ID: Eq + Clone + Component>(

/// Generates an [`Events`](bevy::ecs::event::Events) stream of [`ActionDiff`] from [`ActionState`]
///
/// The `ID` generic type should be a stable entity identifer,
/// The `ID` generic type should be a stable entity identifier,
/// suitable to be sent across a network.
///
/// This system is not part of the [`InputManagerPlugin`](crate::plugin::InputManagerPlugin) and must be added manually.
Expand Down
4 changes: 2 additions & 2 deletions src/user_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,9 @@ impl From<Modifier> for UserInput {
pub enum InputKind {
/// A button on a gamepad
GamepadButton(GamepadButtonType),
/// A single axis of continous motion
/// A single axis of continuous motion
SingleAxis(SingleAxis),
/// Two paired axes of continous motion
/// Two paired axes of continuous motion
DualAxis(DualAxis),
/// A logical key on the keyboard.
///
Expand Down

0 comments on commit 6de79df

Please sign in to comment.