use bevy::prelude::*;
#[derive(Resource, Default, Debug)]
pub struct ActiveGamepad(pub Option<Gamepad>);
#[derive(Resource, Debug, Clone)]
pub struct DebugCameraActive {
pub keymouse: bool,
pub gamepad: bool,
}
impl Default for DebugCameraActive {
fn default() -> DebugCameraActive {
DebugCameraActive {
keymouse: true,
gamepad: true,
}
}
}
#[derive(Resource, Debug, Clone)]
pub struct KeyboardBindings {
pub fwd: KeyCode,
pub bwd: KeyCode,
pub up: KeyCode,
pub down: KeyCode,
pub left: KeyCode,
pub right: KeyCode,
pub roll_left: KeyCode,
pub roll_right: KeyCode,
}
impl Default for KeyboardBindings {
fn default() -> KeyboardBindings {
KeyboardBindings {
fwd: KeyCode::W,
bwd: KeyCode::S,
up: KeyCode::Space,
down: KeyCode::LShift,
left: KeyCode::A,
right: KeyCode::D,
roll_left: KeyCode::Q,
roll_right: KeyCode::E,
}
}
}
#[derive(Resource, Debug, Clone)]
pub struct GamepadBindings {
pub fwd_bwd: GamepadAxisType,
pub up: GamepadButtonType,
pub down: GamepadButtonType,
pub left_right: GamepadAxisType,
pub roll_left: GamepadButtonType,
pub roll_right: GamepadButtonType,
pub yaw: GamepadAxisType,
pub pitch: GamepadAxisType,
}
impl Default for GamepadBindings {
fn default() -> GamepadBindings {
GamepadBindings {
fwd_bwd: GamepadAxisType::LeftStickY,
up: GamepadButtonType::RightTrigger2,
down: GamepadButtonType::LeftTrigger2,
left_right: GamepadAxisType::LeftStickX,
roll_left: GamepadButtonType::LeftTrigger,
roll_right: GamepadButtonType::RightTrigger,
yaw: GamepadAxisType::RightStickX,
pitch: GamepadAxisType::RightStickY,
}
}
}