Update to glutin 0.29.0, winit 0.27.0. Closes #695
This commit is contained in:
parent
c710dc0837
commit
58a2f9c5e1
File diff suppressed because it is too large
Load Diff
|
@ -30,7 +30,7 @@ opt-level = 1
|
|||
[dependencies]
|
||||
cfg-if = "1.0.0"
|
||||
wasm-bindgen = "0.2.81"
|
||||
winit = { version = "0.25.0", features = [ "web-sys" ]}
|
||||
winit = "0.27.0"
|
||||
glow = "0.11.2"
|
||||
byteorder = "1.4.3"
|
||||
serde = "1.0.140"
|
||||
|
@ -55,7 +55,7 @@ dirs = "4.0.0"
|
|||
|
||||
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
|
||||
reqwest = { version = "0.11.11", features = [ "blocking" ]}
|
||||
glutin = "0.27.0"
|
||||
glutin = "0.29.0"
|
||||
|
||||
[target.'cfg(target_arch = "wasm32")'.dependencies]
|
||||
console_error_panic_hook = "0.1.7"
|
||||
|
|
12
src/main.rs
12
src/main.rs
|
@ -659,7 +659,7 @@ fn handle_window_event<T>(
|
|||
use std::f64::consts::PI;
|
||||
|
||||
if game.focused {
|
||||
window.set_cursor_grab(true).unwrap();
|
||||
window.set_cursor_grab(winit::window::CursorGrabMode::Locked).unwrap();
|
||||
window.set_cursor_visible(false);
|
||||
if let Some(player) = game.server.player {
|
||||
let rotation = game
|
||||
|
@ -677,7 +677,7 @@ fn handle_window_event<T>(
|
|||
}
|
||||
}
|
||||
} else {
|
||||
window.set_cursor_grab(false).unwrap();
|
||||
window.set_cursor_grab(winit::window::CursorGrabMode::None).unwrap();
|
||||
window.set_cursor_visible(true);
|
||||
}
|
||||
}
|
||||
|
@ -715,12 +715,12 @@ fn handle_window_event<T>(
|
|||
&& !game.screen_sys.is_current_closable()
|
||||
{
|
||||
game.focused = true;
|
||||
window.set_cursor_grab(true).unwrap();
|
||||
window.set_cursor_grab(winit::window::CursorGrabMode::Locked).unwrap();
|
||||
window.set_cursor_visible(false);
|
||||
} else if !game.focused {
|
||||
#[cfg(not(target_arch = "wasm32"))]
|
||||
// TODO: after Pointer Lock https://github.com/rust-windowing/winit/issues/1674
|
||||
window.set_cursor_grab(false).unwrap();
|
||||
window.set_cursor_grab(winit::window::CursorGrabMode::None).unwrap();
|
||||
window.set_cursor_visible(true);
|
||||
ui_container.click_at(
|
||||
game,
|
||||
|
@ -766,14 +766,14 @@ fn handle_window_event<T>(
|
|||
match (input.state, input.virtual_keycode) {
|
||||
(ElementState::Released, Some(VirtualKeyCode::Escape)) => {
|
||||
if game.focused {
|
||||
window.set_cursor_grab(false).unwrap();
|
||||
window.set_cursor_grab(winit::window::CursorGrabMode::None).unwrap();
|
||||
window.set_cursor_visible(true);
|
||||
game.focused = false;
|
||||
game.screen_sys.replace_screen(Box::new(
|
||||
screen::SettingsMenu::new(game.vars.clone(), true),
|
||||
));
|
||||
} else if game.screen_sys.is_current_closable() {
|
||||
window.set_cursor_grab(true).unwrap();
|
||||
window.set_cursor_grab(winit::window::CursorGrabMode::Locked).unwrap();
|
||||
window.set_cursor_visible(false);
|
||||
game.focused = true;
|
||||
game.screen_sys.pop_screen();
|
||||
|
|
Loading…
Reference in New Issue