diff --git a/perovskite_client/src/game_state/input.rs b/perovskite_client/src/game_state/input.rs index d8a074c..aa42ce0 100644 --- a/perovskite_client/src/game_state/input.rs +++ b/perovskite_client/src/game_state/input.rs @@ -220,8 +220,12 @@ impl InputState { } else if let &WindowEvent::MouseInput { state, button, .. } = event { match state { ElementState::Pressed => { - self.active_keybinds.insert(Keybind::MouseButton(button)); - self.new_presses.insert(Keybind::MouseButton(button)); + if self.mouse_captured { + self.active_keybinds.insert(Keybind::MouseButton(button)); + self.new_presses.insert(Keybind::MouseButton(button)); + } else { + self.mouse_captured = true; + } } ElementState::Released => { self.active_keybinds.remove(&Keybind::MouseButton(button)); diff --git a/perovskite_client/src/game_state/mod.rs b/perovskite_client/src/game_state/mod.rs index 1226652..35fef92 100644 --- a/perovskite_client/src/game_state/mod.rs +++ b/perovskite_client/src/game_state/mod.rs @@ -506,7 +506,13 @@ impl ClientState { * cgmath::Matrix4::from_angle_y(Deg(180.) - Deg(az)); // TODO figure out why this is needed let coordinate_correction = cgmath::Matrix4::from_nonuniform_scale(-1., 1., 1.); - let projection = cgmath::perspective(Deg(45.0), aspect_ratio, 0.01, 1000.); + + let projection = cgmath::perspective( + Deg(self.settings.load().render.fov_degrees), + aspect_ratio, + 0.01, + 1000., + ); let view_proj_matrix = (projection * coordinate_correction * rotation) .cast() .unwrap(); diff --git a/perovskite_client/src/game_state/settings.rs b/perovskite_client/src/game_state/settings.rs index b81d3f0..003935c 100644 --- a/perovskite_client/src/game_state/settings.rs +++ b/perovskite_client/src/game_state/settings.rs @@ -16,6 +16,7 @@ pub(crate) struct RenderSettings { pub(crate) physics_debug: bool, pub(crate) preferred_gpu: String, pub(crate) scale_inventories_with_high_dpi: bool, + pub(crate) fov_degrees: f64, } impl Default for RenderSettings { @@ -28,6 +29,7 @@ impl Default for RenderSettings { physics_debug: false, preferred_gpu: String::from(""), scale_inventories_with_high_dpi: false, + fov_degrees: 75.0, } } }