From b2e869acc38508ff5961cebe79c6d575141b69f3 Mon Sep 17 00:00:00 2001 From: Titus Tscharntke Date: Sat, 1 Sep 2012 19:18:31 +0000 Subject: [PATCH] scrolling stops when entering chat mode and holding down cursor keys, but scrolling with mouse is still possible. --- source/glest_game/game/game.cpp | 47 ++++++++------------------------- 1 file changed, 11 insertions(+), 36 deletions(-) diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 4830f54b..6a4f4fc8 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -2721,18 +2721,6 @@ 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) { @@ -2758,7 +2746,7 @@ void Game::mouseMove(int x, int y, const MouseState *ms) { } else { bool mouseMoveScrollsWorld = Config::getInstance().getBool("MouseMoveScrollsWorld","true"); - if(mouseMoveScrollsWorld == true && isInSpecialKeyCaptureEvent() == false) { + if(mouseMoveScrollsWorld == true) { if (y < 10) { gameCamera.setMoveZ(-scrollSpeed); } @@ -2888,10 +2876,19 @@ void Game::keyDown(SDL_KeyboardEvent key) { } Lang &lang= Lang::getInstance(); - + bool formerChatState=chatManager.getEditEnabled(); //send key to the chat manager chatManager.keyDown(key); + if( formerChatState==false && chatManager.getEditEnabled()) { + camUpButtonDown= false; + camDownButtonDown = false; + camLeftButtonDown = false; + camRightButtonDown = false; + + gameCamera.stopMove(); + } + //printf("GAME KEYDOWN #1\n"); if(chatManager.getEditEnabled() == false) { @@ -3116,17 +3113,6 @@ 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!"); } @@ -3163,17 +3149,6 @@ 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); }