Refactor menu input a bit

This commit is contained in:
2026-09-11 11:38:01 +02:00
parent 3dbda96d31
commit cc850debf2
11 changed files with 282 additions and 189 deletions
+2 -3
View File
@@ -21,9 +21,8 @@ pub fn sample_gamepad(pad: &Gamepad, input_map: &BaseInputMap) -> FighterInputFr
// 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.
InputMapAction::MovementXDir(sign) if pressed => movement.x += sign as f32,
InputMapAction::MovementYDir(sign) if pressed => movement.y += sign as f32,
_ => {}
InputMapAction::MovementXDir(sign) => if pressed { movement.x += sign as f32 },
InputMapAction::MovementYDir(sign) => if pressed { movement.y += sign as f32 },
}
}
// gamepad does not have a separate axis for left and right, so sign here should be 1