(mut actions: Vec<InputAction>)
| 29 | } |
| 30 | |
| 31 | pub fn from_actions(mut actions: Vec<InputAction>) -> Self { |
| 32 | for action in &mut actions { |
| 33 | action.name_hash = action_hash(&action.name); |
| 34 | } |
| 35 | let mut input_map = Self { |
| 36 | actions, |
| 37 | action_slots: Vec::new(), |
| 38 | key_actions: vec![Vec::new(); KeyCode::COUNT], |
| 39 | mouse_actions: vec![Vec::new(); MouseButton::COUNT], |
| 40 | gamepad_actions: vec![Vec::new(); GamepadButton::COUNT], |
| 41 | joycon_actions: vec![Vec::new(); JoyConButton::COUNT], |
| 42 | }; |
| 43 | input_map.rebuild_indexes(); |
| 44 | input_map |
| 45 | } |
| 46 | |
| 47 | #[inline] |
| 48 | pub fn actions(&self) -> &[InputAction] { |
nothing calls this directly
no test coverage detected