mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
associated zoom inversion to GameplaySettings
This commit is contained in:
parent
131204f308
commit
f149182290
@ -95,6 +95,7 @@ impl Default for ControlSettings {
|
|||||||
pub struct GameplaySettings {
|
pub struct GameplaySettings {
|
||||||
pub pan_sensitivity: u32,
|
pub pan_sensitivity: u32,
|
||||||
pub zoom_sensitivity: u32,
|
pub zoom_sensitivity: u32,
|
||||||
|
pub zoom_inversion: bool,
|
||||||
pub crosshair_transp: f32,
|
pub crosshair_transp: f32,
|
||||||
pub crosshair_type: CrosshairType,
|
pub crosshair_type: CrosshairType,
|
||||||
pub xp_bar: XpBar,
|
pub xp_bar: XpBar,
|
||||||
@ -108,6 +109,7 @@ impl Default for GameplaySettings {
|
|||||||
Self {
|
Self {
|
||||||
pan_sensitivity: 100,
|
pan_sensitivity: 100,
|
||||||
zoom_sensitivity: 100,
|
zoom_sensitivity: 100,
|
||||||
|
zoom_inversion: false,
|
||||||
crosshair_transp: 0.6,
|
crosshair_transp: 0.6,
|
||||||
crosshair_type: CrosshairType::Round,
|
crosshair_type: CrosshairType::Round,
|
||||||
xp_bar: XpBar::OnGain,
|
xp_bar: XpBar::OnGain,
|
||||||
|
@ -91,6 +91,7 @@ pub struct Window {
|
|||||||
cursor_grabbed: bool,
|
cursor_grabbed: bool,
|
||||||
pub pan_sensitivity: u32,
|
pub pan_sensitivity: u32,
|
||||||
pub zoom_sensitivity: u32,
|
pub zoom_sensitivity: u32,
|
||||||
|
pub zoom_inversion: bool,
|
||||||
fullscreen: bool,
|
fullscreen: bool,
|
||||||
needs_refresh_resize: bool,
|
needs_refresh_resize: bool,
|
||||||
key_map: HashMap<KeyMouse, Vec<GameInput>>,
|
key_map: HashMap<KeyMouse, Vec<GameInput>>,
|
||||||
@ -236,6 +237,7 @@ impl Window {
|
|||||||
cursor_grabbed: false,
|
cursor_grabbed: false,
|
||||||
pan_sensitivity: settings.gameplay.pan_sensitivity,
|
pan_sensitivity: settings.gameplay.pan_sensitivity,
|
||||||
zoom_sensitivity: settings.gameplay.zoom_sensitivity,
|
zoom_sensitivity: settings.gameplay.zoom_sensitivity,
|
||||||
|
zoom_inversion: settings.gameplay.zoom_inversion,
|
||||||
fullscreen: false,
|
fullscreen: false,
|
||||||
needs_refresh_resize: false,
|
needs_refresh_resize: false,
|
||||||
key_map: map,
|
key_map: map,
|
||||||
@ -271,6 +273,10 @@ impl Window {
|
|||||||
let keypress_map = &mut self.keypress_map;
|
let keypress_map = &mut self.keypress_map;
|
||||||
let pan_sensitivity = self.pan_sensitivity;
|
let pan_sensitivity = self.pan_sensitivity;
|
||||||
let zoom_sensitivity = self.zoom_sensitivity;
|
let zoom_sensitivity = self.zoom_sensitivity;
|
||||||
|
let zoom_inversion = match self.zoom_inversion {
|
||||||
|
true => -1.0,
|
||||||
|
false => 1.0,
|
||||||
|
};
|
||||||
let mut toggle_fullscreen = false;
|
let mut toggle_fullscreen = false;
|
||||||
let mut take_screenshot = false;
|
let mut take_screenshot = false;
|
||||||
|
|
||||||
@ -373,7 +379,7 @@ impl Window {
|
|||||||
delta: glutin::MouseScrollDelta::LineDelta(_x, y),
|
delta: glutin::MouseScrollDelta::LineDelta(_x, y),
|
||||||
..
|
..
|
||||||
} if cursor_grabbed && *focused => {
|
} if cursor_grabbed && *focused => {
|
||||||
events.push(Event::Zoom(y * (zoom_sensitivity as f32 / 100.0)))
|
events.push(Event::Zoom(y * (zoom_sensitivity as f32 / 100.0) * zoom_inversion))
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user