Rework input buffer to match HDR closer (#79)
## Summary - Preserve distinct same-action bindings in rollback input frames. - Add independent command lifetimes with tap and state-scoped hold buffering. - Detect second shield bindings and consume shield commands for air dodge. - Fix duplicate keyboard mappings being overwritten. Reviewed-on: #79 Co-authored-by: Álex Román Núñez <eirexe@eirteam.moe>
This commit was merged in pull request #79.
This commit is contained in:
@@ -14,10 +14,13 @@ pub fn sample_gamepad(pad: &Gamepad, input_map: &BaseInputMap) -> FighterInputFr
|
||||
match &gamepad_element.binding {
|
||||
GamepadBinding::Button(button) => {
|
||||
let pressed = pad.pressed(*button);
|
||||
if let Some(action) = gamepad_element.action.digital_action() {
|
||||
input_frame
|
||||
.bindings
|
||||
.set(action, gamepad_element.binding_slot, pressed);
|
||||
}
|
||||
match gamepad_element.action {
|
||||
InputMapAction::Jump => input_frame.jump |= pressed,
|
||||
InputMapAction::Shield => input_frame.shield |= pressed,
|
||||
InputMapAction::Attack => input_frame.attack |= pressed,
|
||||
InputMapAction::Jump | InputMapAction::Shield | InputMapAction::Attack => {}
|
||||
// Digital buttons driving movement isn't used by the
|
||||
// default bindings (the stick covers that), but stay
|
||||
// consistent with the keyboard backend if one is added.
|
||||
|
||||
Reference in New Issue
Block a user