diff options
Diffstat (limited to 'client')
-rw-r--r-- | client/src/scene_prepare.rs | 2 | ||||
-rw-r--r-- | client/src/window.rs | 10 |
2 files changed, 10 insertions, 2 deletions
diff --git a/client/src/scene_prepare.rs b/client/src/scene_prepare.rs index fcc7932..6d50035 100644 --- a/client/src/scene_prepare.rs +++ b/client/src/scene_prepare.rs @@ -222,7 +222,7 @@ impl ScenePreparer { } } let mut texture = None; - if let Some(albedores) = part.tex_pbr_albedo { + if let Some(albedores) = part.tex_albedo { if let Some((_tex, bg)) = self.textures.try_get(albedores) { texture = Some(bg) } diff --git a/client/src/window.rs b/client/src/window.rs index ac90f71..8b3ee9e 100644 --- a/client/src/window.rs +++ b/client/src/window.rs @@ -7,7 +7,7 @@ use winit::{ event::{DeviceEvent, ElementState, WindowEvent}, event_loop::ActiveEventLoop, keyboard::{KeyCode, PhysicalKey}, - window::{Window, WindowAttributes, WindowId}, + window::{CursorGrabMode, Window, WindowAttributes, WindowId}, }; pub struct WindowState { @@ -53,6 +53,14 @@ impl ApplicationHandler for WindowState { if event.repeat { return; } + if event.state == ElementState::Pressed { + match event.physical_key { + PhysicalKey::Code(KeyCode::Escape) => { + win.set_cursor_grab(CursorGrabMode::Locked).unwrap(); + } + _ => (), + } + } sta.delta.move_dir += match event.physical_key { PhysicalKey::Code(KeyCode::KeyW) => Vec3::X, PhysicalKey::Code(KeyCode::KeyS) => Vec3::NEG_X, |