diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index 178f68b4..1768476d 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -5005,7 +5005,10 @@ void Game::keyUp(SDL_KeyboardEvent key) { gameCamera.setMoveX(0); camRightButtonDown= false; calcCameraMoveX(); + } else { + gui.hotKeyReleased(key); } + } } catch(const exception &ex) { diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp index 608a4beb..1f9c80b3 100644 --- a/source/glest_game/gui/gui.cpp +++ b/source/glest_game/gui/gui.cpp @@ -447,6 +447,16 @@ void Gui::hotKey(SDL_KeyboardEvent key) { else if(isKeyPressed(configKeys.getSDLKey("HotKeySelectedUnitsStop"),key) == true) { clickCommonCommand(ccStop); } + + if(isKeyDown(queueCommandKey)) { + computeDisplay(); + } +} + +void Gui::hotKeyReleased(SDL_KeyboardEvent key) { + if(!isKeyDown(queueCommandKey)) { + computeDisplay(); + } } void Gui::switchToNextDisplayColor(){ @@ -975,7 +985,7 @@ void Gui::computeDisplay(){ auto mct = u->getCurrMorphCt(); if(mct && isKeyDown(queueCommandKey)) {//Morph Queue ut=mct->getMorphUnit(); - }//TODO subscribe on queueCommandKey presed => resetState() and may remove stop cmd + }//TODO on queueCommandKey presed disable stop cmd int morphPos= 8; for(int i= 0; i < ut->getCommandTypeCount(); ++i){ @@ -996,7 +1006,7 @@ void Gui::computeDisplay(){ display.setCommandType(displayPos, ct); display.setCommandClass(displayPos, ct->getClass()); bool reqOk=u->getFaction()->reqsOk(ct); - display.setDownLighted(displayPos,reqOk); + display.setDownLighted(displayPos, reqOk && !(!ct->isQueueAppendable() && isKeyDown(queueCommandKey))); if (reqOk && produced != NULL) { if (possibleAmount == 0) { diff --git a/source/glest_game/gui/gui.h b/source/glest_game/gui/gui.h index c9c8905c..fe8db1e3 100644 --- a/source/glest_game/gui/gui.h +++ b/source/glest_game/gui/gui.h @@ -196,6 +196,7 @@ public: void mouseDoubleClickLeftGraphics(int x, int y); void groupKey(int groupIndex); void hotKey(SDL_KeyboardEvent key); + void hotKeyReleased(SDL_KeyboardEvent key); //misc void switchToNextDisplayColor();