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
+27
View File
@@ -19,6 +19,15 @@ pub enum InputMapAction {
Attack,
}
#[derive(Debug)]
pub enum MenuInputMapAction {
MovementXDir(i32),
MovementYDir(i32),
Accept,
Back,
Start,
}
#[derive(Debug)]
pub struct KeyboardInputMapElement {
pub key: KeyCode,
@@ -37,8 +46,26 @@ pub struct GamepadInputMapElement {
pub action: InputMapAction,
}
#[derive(Debug)]
pub struct MenuKeyboardInputMapElement {
pub key: KeyCode,
pub action: MenuInputMapAction,
}
#[derive(Debug)]
pub struct MenuGamepadInputMapElement {
pub binding: GamepadBinding,
pub action: MenuInputMapAction,
}
#[derive(Resource)]
pub struct BaseInputMap {
pub keyboard: Vec<KeyboardInputMapElement>,
pub gamepad: Vec<GamepadInputMapElement>,
}
#[derive(Resource)]
pub struct MenuInputMap {
pub keyboard: Vec<MenuKeyboardInputMapElement>,
pub gamepad: Vec<MenuGamepadInputMapElement>,
}