From 390812f54e9685ec8e4c1f61014bab83602ca1a3 Mon Sep 17 00:00:00 2001 From: AdaLovegirls <37942530+AdaLovegirls@users.noreply.github.com> Date: Sun, 14 Feb 2021 18:51:49 -0600 Subject: [PATCH] Improve controller keybindings --- CHANGELOG.md | 2 ++ voxygen/src/controller.rs | 9 +++++++++ voxygen/src/settings.rs | 30 +++++++++++++++--------------- voxygen/src/window.rs | 4 +++- 4 files changed, 29 insertions(+), 16 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 532b0a2e51..c4aa167d9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,6 +45,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Changed crafting recipes involving shiny gems to use diamonds instead. - Cave scatter now includes all 6 gems. - Adjusted Stonework Defender loot table to remove mindflayer drops (bag, staff, glider). +- Changed default controller key bindings ### Removed @@ -61,6 +62,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 one of them active at the same time - Made zooming work on wayland - Fixed AI behavior so only humanoids will attempt to roll +- Fixed missing GameInputs (sneak, swimup, swimdown) in controller mapping ## [0.8.0] - 2020-11-28 diff --git a/voxygen/src/controller.rs b/voxygen/src/controller.rs index 172353c110..3c058c0262 100644 --- a/voxygen/src/controller.rs +++ b/voxygen/src/controller.rs @@ -104,6 +104,15 @@ impl From<&crate::settings::GamepadSettings> for ControllerSettings { map.entry(settings.game_buttons.climb_down) .or_default() .push(GameInput::ClimbDown); + map.entry(settings.game_buttons.swimup) + .or_default() + .push(GameInput::SwimUp); + map.entry(settings.game_buttons.swimdown) + .or_default() + .push(GameInput::SwimDown); + map.entry(settings.game_buttons.sneak) + .or_default() + .push(GameInput::Sneak); /*map.entry(settings.game_buttons.wall_leap) .or_default() .push(GameInput::WallLeap);*/ diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index be468b76d6..0aaf47cde0 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -393,8 +393,8 @@ pub mod con_settings { Self { primary: Button::Simple(GilButton::RightTrigger2), secondary: Button::Simple(GilButton::LeftTrigger2), - toggle_cursor: Button::Simple(GilButton::Select), - escape: Button::Simple(GilButton::Mode), + toggle_cursor: Button::Simple(GilButton::Unknown), + escape: Button::Simple(GilButton::Start), enter: Button::Simple(GilButton::Unknown), command: Button::Simple(GilButton::Unknown), move_forward: Button::Simple(GilButton::Unknown), @@ -402,36 +402,36 @@ pub mod con_settings { move_back: Button::Simple(GilButton::Unknown), move_right: Button::Simple(GilButton::Unknown), jump: Button::Simple(GilButton::South), - sit: Button::Simple(GilButton::West), + sit: Button::Simple(GilButton::Unknown), dance: Button::Simple(GilButton::Unknown), glide: Button::Simple(GilButton::LeftTrigger), climb: Button::Simple(GilButton::South), - climb_down: Button::Simple(GilButton::Unknown), + climb_down: Button::Simple(GilButton::East), swimup: Button::Simple(GilButton::South), - swimdown: Button::Simple(GilButton::Unknown), - sneak: Button::Simple(GilButton::Unknown), + swimdown: Button::Simple(GilButton::East), + sneak: Button::Simple(GilButton::East), //wall_leap: Button::Simple(GilButton::Unknown), - toggle_lantern: Button::Simple(GilButton::East), + toggle_lantern: Button::Simple(GilButton::DPadLeft), mount: Button::Simple(GilButton::North), - map: Button::Simple(GilButton::DPadRight), - bag: Button::Simple(GilButton::DPadDown), + map: Button::Simple(GilButton::Select), + bag: Button::Simple(GilButton::DPadRight), quest_log: Button::Simple(GilButton::Unknown), character_window: Button::Simple(GilButton::Unknown), social: Button::Simple(GilButton::Unknown), - crafting: Button::Simple(GilButton::Unknown), + crafting: Button::Simple(GilButton::DPadDown), spellbook: Button::Simple(GilButton::Unknown), settings: Button::Simple(GilButton::Unknown), help: Button::Simple(GilButton::Unknown), toggle_interface: Button::Simple(GilButton::Unknown), toggle_debug: Button::Simple(GilButton::Unknown), fullscreen: Button::Simple(GilButton::Unknown), - screenshot: Button::Simple(GilButton::DPadUp), + screenshot: Button::Simple(GilButton::Unknown), toggle_ingame_ui: Button::Simple(GilButton::Unknown), roll: Button::Simple(GilButton::RightTrigger), - respawn: Button::Simple(GilButton::RightTrigger2), - interact: Button::Simple(GilButton::LeftTrigger2), - toggle_wield: Button::Simple(GilButton::DPadLeft), - swap_loadout: Button::Simple(GilButton::Unknown), + respawn: Button::Simple(GilButton::South), + interact: Button::Simple(GilButton::North), + toggle_wield: Button::Simple(GilButton::West), + swap_loadout: Button::Simple(GilButton::LeftThumb), //charge: Button::Simple(GilButton::Unknown), } } diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs index 9b49993dce..ffd0b387b7 100644 --- a/voxygen/src/window.rs +++ b/voxygen/src/window.rs @@ -778,7 +778,9 @@ impl Window { AxisGameAction::CameraY => { self.events.push(Event::AnalogGameInput( AnalogGameInput::CameraY( - value + // TODO: Use pan_invert_y here. Remove - in + // front of `value` as well + -value * self.controller_settings.pan_sensitivity as f32 / 100.0,