mirror of
https://gitlab.com/veloren/veloren.git
synced 2024-08-30 18:12:32 +00:00
Rather than lock the cursor to the middle of the screen, the cursor will move to it's last known coordinates when a menu or the minimap is not open.
This commit is contained in:
parent
88079cfd30
commit
7df0413be4
@ -46,6 +46,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Server kicks old client when a user is trying to log in again (often the case when a user's original connection gets dropped)
|
- Server kicks old client when a user is trying to log in again (often the case when a user's original connection gets dropped)
|
||||||
- Added a raycast check to beams to prevent their effect applying through walls
|
- Added a raycast check to beams to prevent their effect applying through walls
|
||||||
- Flying agents raycast more angles to check for obstacles.
|
- Flying agents raycast more angles to check for obstacles.
|
||||||
|
- Mouse Cursor now stays in the same position when menu is not open
|
||||||
|
|
||||||
## [0.9.0] - 2021-03-20
|
## [0.9.0] - 2021-03-20
|
||||||
|
|
||||||
|
@ -1036,7 +1036,17 @@ impl Window {
|
|||||||
self.events.push(Event::Focused(state));
|
self.events.push(Event::Focused(state));
|
||||||
},
|
},
|
||||||
WindowEvent::CursorMoved { position, .. } => {
|
WindowEvent::CursorMoved { position, .. } => {
|
||||||
self.cursor_position = position;
|
if self.cursor_grabbed {
|
||||||
|
if let Err(err) = self
|
||||||
|
.window
|
||||||
|
.window()
|
||||||
|
.set_cursor_position(self.cursor_position)
|
||||||
|
{
|
||||||
|
error!("Error setting cursor position: {:?}", err);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
self.cursor_position = position;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
WindowEvent::MouseWheel { delta, .. } if self.cursor_grabbed && self.focused => {
|
WindowEvent::MouseWheel { delta, .. } if self.cursor_grabbed && self.focused => {
|
||||||
const DIFFERENCE_FROM_DEVICE_EVENT_ON_X11: f32 = -15.0;
|
const DIFFERENCE_FROM_DEVICE_EVENT_ON_X11: f32 = -15.0;
|
||||||
|
Loading…
Reference in New Issue
Block a user