Skip to content

Commit

Permalink
fix typos
Browse files Browse the repository at this point in the history
  • Loading branch information
aecsocket committed Dec 1, 2024
1 parent d38d97a commit 12f4b7f
Show file tree
Hide file tree
Showing 14 changed files with 30 additions and 30 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ jobs:
sudo apt-get update
sudo apt-get install --no-install-recommends libudev-dev
- name: Instal; stable toolchain
- name: Install stable toolchain
uses: dtolnay/rust-toolchain@stable

- name: Cache crates
Expand Down
6 changes: 3 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- All events now have typed values, based on `InputAction::Output`.
- Rename `ActionBind::with` into `ActionBind::to`.
- All presets now structs (see `input_context::context_instance::input_preset`) that can be passed directly into `ActionBind::to`.
- Rename `Modifiers` into `ModKeys` to avod confusion with input modifiers.
- Rename `Modifiers` into `ModKeys` to avoid confusion with input modifiers.
- Rename all `modifiers` fields in the `Input` enum into `mod_keys`.
- Rename `Input::with_modifiers` and `Input::without_modifiers` into `Input::with_mod_keys` and `Input::without_mod_keys`, respectively.
- `Input::with_mod_keys` now a trait method which implemented for any type that can be converted into an input to ergonomically assign keyboard modifiers.
Expand Down Expand Up @@ -77,7 +77,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- All events now separate structs instead of enum.
- Modifiers now accept `ActionsData`.
- Rework `ConditionKind` and the logic around it to make the behavior close to UE.
- Rework `ConditionKind` and the logic around it to make the behavior close to Unreal Engine.
- Consume inputs only if the action state is not equal to `ActionState::None`.
- Remove world access from conditions and modifiers. This means that you no longer can write game-specific conditions or modifiers. But it's much nicer (and faster) to just do it in observers instead.
- Values from `Input` are now converted to the action-level dimension only after applying all input-level modifiers and conditions. This allows things like mapping the Y-axis of `ActionValue::Axis2D` into an action with `ActionValueDim::Axis1D`.
Expand All @@ -91,7 +91,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Use `isize` for `InputContext::PRIORITY`.
- Replace `SmoothDelta` with `LerpDelta` that does only linear interpolation. Using easing functions for inputs doesn't make much sense.
- Modifiers are now allowed to change passed value dimensions.
- All built-in modifiers now handle values of any dimention.
- All built-in modifiers now handle values of any dimension.
- Replace `with_held_timer` with `relative_speed` that just accepts a boolean.
- Rename `HeldTimer` into `ConditionTimer`.
- Use `trace!` instead of `debug!` for triggered events.
Expand Down
8 changes: 4 additions & 4 deletions src/action_value.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub enum ActionValue {
}

impl ActionValue {
/// Creates a zero-initialized value for the specified dimention.
/// Creates a zero-initialized value for the specified dimension.
pub fn zero(dim: ActionValueDim) -> Self {
match dim {
ActionValueDim::Bool => ActionValue::Bool(false),
Expand All @@ -23,7 +23,7 @@ impl ActionValue {
}
}

/// Returns dimention.
/// Returns dimension.
pub fn dim(self) -> ActionValueDim {
match self {
Self::Bool(_) => ActionValueDim::Bool,
Expand All @@ -33,7 +33,7 @@ impl ActionValue {
}
}

/// Converts the value into the specified variant based on the dimention.
/// Converts the value into the specified variant based on the dimension.
///
/// If the new dimension is larger, the additional axes will be set to zero.
/// If the new dimension is smaller, the extra axes will be discarded.
Expand Down Expand Up @@ -124,7 +124,7 @@ impl ActionValue {
}
}

/// A dimention discriminant for [`ActionValue`].
/// A dimension discriminant for [`ActionValue`].
#[derive(Serialize, Deserialize, Clone, Copy, PartialEq, Eq, PartialOrd, Ord, Debug)]
pub enum ActionValueDim {
Bool,
Expand Down
2 changes: 1 addition & 1 deletion src/input/input_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ impl InputReader<'_, '_> {
.sum();
}

/// Assignes a gamepad from which [`Self::value`] should read input.
/// Assigns a gamepad from which [`Self::value`] should read input.
pub(crate) fn set_gamepad(&mut self, gamepad: impl Into<GamepadDevice>) {
*self.gamepad_device = gamepad.into();
}
Expand Down
2 changes: 1 addition & 1 deletion src/input_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ impl InstanceGroup {
///
/// impl InputContext for Player {
/// fn context_instance(world: &World, entity: Entity) -> ContextInstance {
/// // You can use world to access the necessaary data.
/// // You can use world to access the necessary data.
/// let settings = world.resource::<AppSettings>();
///
/// // To can also access the context
Expand Down
2 changes: 1 addition & 1 deletion src/input_context/context_instance.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,7 +438,7 @@ impl ActionsData {

/// Inserts a state for action `A`.
///
/// Returns previosly associated state if present.
/// Returns previously associated state if present.
pub fn insert_action<A: InputAction>(&mut self, action: ActionData) -> Option<ActionData> {
self.insert(TypeId::of::<A>(), action)
}
Expand Down
4 changes: 2 additions & 2 deletions src/input_context/context_instance/trigger_tracker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ impl TriggerTracker {

/// Replaces the state with `other`.
///
/// Preserves the value dimention.
/// Preserves the value dimension.
pub(super) fn overwrite(&mut self, other: TriggerTracker) {
let dim = self.value.dim();
*self = other;
Expand All @@ -131,7 +131,7 @@ impl TriggerTracker {

/// Merges two trackers.
///
/// Preserves the value dimention.
/// Preserves the value dimension.
pub(super) fn combine(&mut self, other: Self, accumulation: Accumulation) {
let accumulated = match accumulation {
Accumulation::MaxAbs => {
Expand Down
2 changes: 1 addition & 1 deletion src/input_context/input_action.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ pub trait ActionOutput: Send + Sync + Debug + Clone + Copy {
///
/// # Panics
///
/// Panics if the value represets a different type.
/// Panics if the value represents a different type.
fn as_output(value: ActionValue) -> Self;
}

Expand Down
2 changes: 1 addition & 1 deletion src/input_context/input_condition/block_by.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ pub struct BlockBy<A: InputAction> {
/// Action that blocks this condition when active.
marker: PhantomData<A>,

/// Wheter to block the state or only the events.
/// Whether to block the state or only the events.
///
/// By default set to false.
pub events_only: bool,
Expand Down
4 changes: 2 additions & 2 deletions src/input_context/input_condition/just_press.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ impl InputCondition for JustPress {
_time: &Time<Virtual>,
value: ActionValue,
) -> ActionState {
let previosly_actuated = self.actuated;
let previously_actuated = self.actuated;
self.actuated = value.is_actuated(self.actuation);

if self.actuated && !previosly_actuated {
if self.actuated && !previously_actuated {
ActionState::Fired
} else {
ActionState::None
Expand Down
4 changes: 2 additions & 2 deletions src/input_context/input_condition/release.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ impl InputCondition for Release {
_time: &Time<Virtual>,
value: ActionValue,
) -> ActionState {
let previosly_actuated = self.actuated;
let previously_actuated = self.actuated;
self.actuated = value.is_actuated(self.actuation);

if self.actuated {
// Ongoing on hold.
ActionState::Ongoing
} else if previosly_actuated {
} else if previously_actuated {
// Fired on release.
ActionState::Fired
} else {
Expand Down
8 changes: 4 additions & 4 deletions src/input_context/input_modifier/negate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,18 @@ use crate::{action_value::ActionValue, input_context::context_instance::ActionsD
/// [`ActionValue::Bool`] will be transformed into [`ActionValue::Axis1D`].
#[derive(Clone, Copy, Debug)]
pub struct Negate {
/// Wheter to inverse the X axis.
/// Whether to inverse the X axis.
pub x: bool,

/// Wheter to inverse the Y axis.
/// Whether to inverse the Y axis.
pub y: bool,

/// Wheter to inverse the Z axis.
/// Whether to inverse the Z axis.
pub z: bool,
}

impl Negate {
/// Returns [`Self`] with invertion for all axes set to `invert`
/// Returns [`Self`] with inversion for all axes set to `invert`
#[must_use]
pub fn splat(invert: bool) -> Self {
Self {
Expand Down
12 changes: 6 additions & 6 deletions src/input_context/preset.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::{
input_modifier::{negate::Negate, swizzle_axis::SwizzleAxis},
};

/// A preset to map buttons as 2-dimentional input.
/// A preset to map buttons as 2-dimensional input.
///
/// This is a convenience preset that uses [`SwizzleAxis`] and [`Negate`] to
/// bind the buttons to X and Y axes.
Expand Down Expand Up @@ -68,7 +68,7 @@ pub struct Cardinal<I: InputBindings> {
}

impl Cardinal<KeyCode> {
/// Maps WASD keys as 2-dimentional input.
/// Maps WASD keys as 2-dimensional input.
///
/// See also [`Self::arrow_keys`].
#[must_use]
Expand All @@ -81,7 +81,7 @@ impl Cardinal<KeyCode> {
}
}

/// Maps keyboard arrow keys as 2-dimentional input.
/// Maps keyboard arrow keys as 2-dimensional input.
///
/// See also [`Self::wasd_keys`].
#[must_use]
Expand All @@ -96,7 +96,7 @@ impl Cardinal<KeyCode> {
}

impl Cardinal<GamepadButton> {
/// Maps D-pad as 2-dimentional input.
/// Maps D-pad as 2-dimensional input.
///
/// See also [`Self::wasd_keys`].
#[must_use]
Expand Down Expand Up @@ -137,7 +137,7 @@ impl<I: InputBindings> InputBindings for Cardinal<I> {
}
}

/// A preset to map buttons as 2-dimentional input.
/// A preset to map buttons as 2-dimensional input.
///
/// Positive binding will be passed as is and negative will be reversed using [`Negate`].
///
Expand All @@ -160,7 +160,7 @@ impl<I: InputBindings> InputBindings for Bidirectional<I> {
}
}

/// A preset to map a stick as 2-dimentional input.
/// A preset to map a stick as 2-dimensional input.
///
/// Represents the side of a gamepad's analog stick.
#[derive(Debug, Clone, Copy)]
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ while interacting with the UI, we implement temporary workarounds enabled by spe
# Troubleshooting
If you face any issue, try to enable logging to see what is going on.
To enable logging, you can temporarely set `RUST_LOG` environment variable to `bevy_enhanced_input=debug`
To enable logging, you can temporarily set `RUST_LOG` environment variable to `bevy_enhanced_input=debug`
(or `bevy_enhanced_input=trace` for more noisy output) like this:
```bash
Expand Down

0 comments on commit 12f4b7f

Please sign in to comment.