Leafwing-Studios / leafwing-input-manager

A straightforward stateful input manager for the Bevy game engine.
Apache License 2.0
721 stars 109 forks source link

Fix action diffing #580

Closed alice-i-cecile closed 3 months ago

alice-i-cecile commented 3 months ago

Fixes #565.

The actual fixes here are pretty small, and mostly incidental to action-diffing: ActionState::pressed and just_pressed were returning true for uninitialized data. Overall, the tests were simply wrong, and expecting bizarre, extremely verbose action-diffs (buttonlike inputs having values, axislike inputs being released...).

The tests are substantially simpler now, there's unit tests for action-diffing, all of the action-diffing code lives together, and now there's some nice set_value and set_axis_pair helper methods!