Skip to content

Commit

Permalink
Add getters and setters for InputAxis and ButtonSettings (bevyeng…
Browse files Browse the repository at this point in the history
…ine#6088)

# Objective
Fixes bevyengine#3418

## Solution

Originally a rebase of bevyengine#3446.  Work was originally done by mfdorst, who should receive considerable credit.  Then the error types were extensively reworked by targrub.

## Migration Guide

`AxisSettings` now has a `new()`, which may return an `AxisSettingsError`.
`AxisSettings` fields made private; now must be accessed through getters and setters.  There's a dead zone, from `.deadzone_upperbound()` to `.deadzone_lowerbound()`, and a live zone, from `.deadzone_upperbound()` to `.livezone_upperbound()` and from `.deadzone_lowerbound()` to `.livezone_lowerbound()`.
`AxisSettings` setters no longer panic.
`ButtonSettings` fields made private; now must be accessed through getters and setters.
`ButtonSettings` now has a `new()`, which may return a `ButtonSettingsError`.

Co-authored-by: targrub <62773321+targrub@users.noreply.github.com>
  • Loading branch information
2 people authored and james7132 committed Oct 28, 2022
1 parent e41edf1 commit 76f9dd2
Show file tree
Hide file tree
Showing 3 changed files with 621 additions and 69 deletions.
1 change: 1 addition & 0 deletions crates/bevy_input/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,4 @@ bevy_reflect = { path = "../bevy_reflect", version = "0.9.0-dev" }

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

0 comments on commit 76f9dd2

Please sign in to comment.