- bugfix when moving camera and entering chat mode
This commit is contained in:
parent
e2fcf9ed94
commit
3c1651d084
|
@ -2722,6 +2722,17 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
|
|||
}
|
||||
else {
|
||||
//main window
|
||||
if(isInSpecialKeyCaptureEvent() == true &&
|
||||
gameCamera.isMoving() == true) {
|
||||
|
||||
camUpButtonDown= false;
|
||||
camDownButtonDown = false;
|
||||
camLeftButtonDown = false;
|
||||
camRightButtonDown = false;
|
||||
|
||||
gameCamera.stopMove();
|
||||
}
|
||||
|
||||
//if(Window::isKeyDown() == false)
|
||||
if(!camLeftButtonDown && !camRightButtonDown && !camUpButtonDown && !camDownButtonDown)
|
||||
{
|
||||
|
@ -2747,7 +2758,7 @@ void Game::mouseMove(int x, int y, const MouseState *ms) {
|
|||
}
|
||||
else {
|
||||
bool mouseMoveScrollsWorld = Config::getInstance().getBool("MouseMoveScrollsWorld","true");
|
||||
if(mouseMoveScrollsWorld == true) {
|
||||
if(mouseMoveScrollsWorld == true && isInSpecialKeyCaptureEvent() == false) {
|
||||
if (y < 10) {
|
||||
gameCamera.setMoveZ(-scrollSpeed);
|
||||
}
|
||||
|
@ -3105,6 +3116,17 @@ void Game::keyDown(SDL_KeyboardEvent key) {
|
|||
saveGame();
|
||||
}
|
||||
}
|
||||
else if(isInSpecialKeyCaptureEvent() == true &&
|
||||
gameCamera.isMoving() == true) {
|
||||
|
||||
camUpButtonDown= false;
|
||||
camDownButtonDown = false;
|
||||
camLeftButtonDown = false;
|
||||
camRightButtonDown = false;
|
||||
|
||||
gameCamera.stopMove();
|
||||
}
|
||||
|
||||
|
||||
//throw megaglest_runtime_error("Test Error!");
|
||||
}
|
||||
|
@ -3141,6 +3163,17 @@ void Game::keyUp(SDL_KeyboardEvent key) {
|
|||
}
|
||||
|
||||
if(chatManager.getEditEnabled()) {
|
||||
if(isInSpecialKeyCaptureEvent() == true &&
|
||||
gameCamera.isMoving() == true) {
|
||||
|
||||
camUpButtonDown= false;
|
||||
camDownButtonDown = false;
|
||||
camLeftButtonDown = false;
|
||||
camRightButtonDown = false;
|
||||
|
||||
gameCamera.stopMove();
|
||||
}
|
||||
|
||||
//send key to the chat manager
|
||||
chatManager.keyUp(key);
|
||||
}
|
||||
|
|
|
@ -113,6 +113,15 @@ public:
|
|||
void setMoveY(float f) {this->move.y= f;}
|
||||
void setMoveZ(float f) {this->move.z= f;}
|
||||
|
||||
inline bool isMoving() const {
|
||||
return (this->move.x != 0.0 || this->move.y != 0.0 || this->move.z != 0.0);
|
||||
}
|
||||
inline void stopMove() {
|
||||
this->move.x = 0.0;
|
||||
this->move.y = 0.0;
|
||||
this->move.z = 0.0;
|
||||
}
|
||||
|
||||
void stop() {
|
||||
destPos = pos;
|
||||
destAng.x = vAng;
|
||||
|
|
Loading…
Reference in New Issue
Block a user