X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fui%2Fui.cpp;h=5a39fa8109ebfc810ed1a333c0d089d407db7706;hb=80a9a59d71a7b144c12f64cbef4644751bd54745;hp=048aed1ac81559e21e2eee740d90a195bf5df22b;hpb=33b37e7242e4cbfa76e4a0d6e5bb54223b541162;p=blank.git diff --git a/src/ui/ui.cpp b/src/ui/ui.cpp index 048aed1..5a39fa8 100644 --- a/src/ui/ui.cpp +++ b/src/ui/ui.cpp @@ -457,10 +457,20 @@ Interface::Interface( , fwd(0) , rev(0) , slot(0) -, num_slots(10) { +, num_slots(10) +, locked(false) { } +void Interface::Lock() { + fwd = glm::ivec3(0); + rev = glm::ivec3(0); + locked = true; +} + +void Interface::Unlock() { + locked = false; +} void Interface::HandlePress(const SDL_KeyboardEvent &event) { if (!config.input.keyboard) return; @@ -592,7 +602,7 @@ void Interface::HandleRelease(const SDL_KeyboardEvent &event) { } void Interface::Handle(const SDL_MouseMotionEvent &event) { - if (!config.input.mouse) return; + if (locked || !config.input.mouse) return; player_ctrl.TurnHead( event.yrel * config.input.pitch_sensitivity, event.xrel * config.input.yaw_sensitivity);