Add Ultimate-style input binding buffers
CI / build-and-test (pull_request) Successful in 2m19s
CI / production-build (pull_request) Successful in 11m44s

This commit is contained in:
2026-09-29 19:59:50 +02:00
parent adf83ba03f
commit 6bab92fe25
9 changed files with 549 additions and 166 deletions
+6 -3
View File
@@ -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.