From 1bb8a53bdfb670a3d3792f582ba19168efb5ecd7 Mon Sep 17 00:00:00 2001
From: Treeco <5021038-Treeco@users.noreply.gitlab.com>
Date: Sat, 23 May 2020 15:11:42 +0100
Subject: [PATCH] Change a bunch of settings defaults, fix sprite looting key

---
 voxygen/src/hud/settings_window.rs |  2 +-
 voxygen/src/session.rs             | 11 ++++++-----
 voxygen/src/settings.rs            |  4 ++--
 voxygen/src/window.rs              |  8 +++++++-
 4 files changed, 16 insertions(+), 9 deletions(-)

diff --git a/voxygen/src/hud/settings_window.rs b/voxygen/src/hud/settings_window.rs
index 803cbd794d..4279d7b964 100644
--- a/voxygen/src/hud/settings_window.rs
+++ b/voxygen/src/hud/settings_window.rs
@@ -1192,7 +1192,7 @@ impl<'a> Widget for SettingsWindow<'a> {
             if let Some(new_val) = ImageSlider::discrete(
                 display_zoom,
                 1,
-                800,
+                300,
                 self.imgs.slider_indicator,
                 self.imgs.slider,
             )
diff --git a/voxygen/src/session.rs b/voxygen/src/session.rs
index ff67858882..5f683c46dc 100644
--- a/voxygen/src/session.rs
+++ b/voxygen/src/session.rs
@@ -271,11 +271,6 @@ impl PlayState for SessionState {
                             }
                         } else {
                             self.inputs.secondary.set_state(state);
-
-                            // Check for select_block that is highlighted
-                            if let Some(select_pos) = self.scene.select_pos() {
-                                client.collect_block(select_pos);
-                            }
                         }
                     },
 
@@ -391,6 +386,12 @@ impl PlayState for SessionState {
                     Event::InputUpdate(GameInput::Interact, state) => {
                         let mut client = self.client.borrow_mut();
 
+                        // Collect terrain sprites
+                        if let Some(select_pos) = self.scene.select_pos() {
+                            client.collect_block(select_pos);
+                        }
+
+                        // Collect lootable entities
                         let player_pos = client
                             .state()
                             .read_storage::<comp::Pos>()
diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs
index fcf8e24204..39675cf51b 100644
--- a/voxygen/src/settings.rs
+++ b/voxygen/src/settings.rs
@@ -135,7 +135,7 @@ impl ControlSettings {
             GameInput::ToggleIngameUi => KeyMouse::Key(VirtualKeyCode::F6),
             GameInput::Roll => MIDDLE_CLICK_KEY,
             GameInput::Respawn => KeyMouse::Key(VirtualKeyCode::Space),
-            GameInput::Interact => KeyMouse::Mouse(MouseButton::Right),
+            GameInput::Interact => KeyMouse::Key(VirtualKeyCode::E),
             GameInput::ToggleWield => KeyMouse::Key(VirtualKeyCode::T),
             //GameInput::Charge => KeyMouse::Key(VirtualKeyCode::Key1),
             GameInput::FreeLook => KeyMouse::Key(VirtualKeyCode::L),
@@ -568,7 +568,7 @@ impl Default for GraphicsSettings {
     fn default() -> Self {
         Self {
             view_distance: 10,
-            sprite_render_distance: 250,
+            sprite_render_distance: 150,
             figure_lod_render_distance: 250,
             max_fps: 60,
             fov: 50,
diff --git a/voxygen/src/window.rs b/voxygen/src/window.rs
index d2356aec47..20e4f11f90 100644
--- a/voxygen/src/window.rs
+++ b/voxygen/src/window.rs
@@ -620,6 +620,12 @@ impl Window {
                     },
                     glutin::DeviceEvent::MouseWheel { delta, .. } if cursor_grabbed && *focused => {
                         events.push(Event::Zoom({
+                            // Since scrolling apparently acts different depending on platform
+                            #[cfg(target_os = "windows")]
+                            const PLATFORM_FACTOR: f32 = -4.0;
+                            #[cfg(not(target_os = "windows"))]
+                            const PLATFORM_FACTOR: f32 = 1.0;
+
                             let y = match delta {
                                 glutin::MouseScrollDelta::LineDelta(_x, y) => y,
                                 // TODO: Check to see if there is a better way to find the "line
@@ -629,7 +635,7 @@ impl Window {
                                 // across operating systems.
                                 glutin::MouseScrollDelta::PixelDelta(pos) => (pos.y / 16.0) as f32,
                             };
-                            y * (zoom_sensitivity as f32 / 100.0) * zoom_inversion
+                            y * (zoom_sensitivity as f32 / 100.0) * zoom_inversion * PLATFORM_FACTOR
                         }))
                     },
                     _ => {},