diff --git a/mk/linux/glestkeys.ini b/mk/linux/glestkeys.ini index 01cfcd4c..374b4061 100644 --- a/mk/linux/glestkeys.ini +++ b/mk/linux/glestkeys.ini @@ -43,6 +43,7 @@ HotKeyToggleOSMouseEnabled=/ ChatTeamMode=H ToggleMusic=K SaveGUILayout=f10 +SetMarker=X ReloadINI=f5 TogglePhotoMode=f8 SwitchLanguage=L diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp index a755a004..2972c6d0 100644 --- a/source/glest_game/game/game.cpp +++ b/source/glest_game/game/game.cpp @@ -80,6 +80,7 @@ Game::Game() : ProgramState(NULL) { gameOver=false; renderNetworkStatus=false; showFullConsole=false; + setMarker=false; mouseMoved=false; scrollSpeed=0; camLeftButtonDown=false; @@ -205,7 +206,7 @@ void Game::resetMembers() { renderNetworkStatus= false; speed= sNormal; showFullConsole= false; - + setMarker = false; camLeftButtonDown=false; camRightButtonDown=false; camUpButtonDown=false; @@ -2206,10 +2207,12 @@ void Game::mouseDownLeft(int x, int y) { } else { - gameCamera.setPos(Vec2f(static_cast(xCell), static_cast(yCell))); + if(!setMarker) { + gameCamera.setPos(Vec2f(static_cast(xCell), static_cast(yCell))); + } } - if(isKeyDown(vkShift)) { + if(setMarker) { Vec2i surfaceCellPos = map->toSurfCoords(Vec2i(xCell,yCell)); SurfaceCell *sc = map->getSurfaceCell(surfaceCellPos); Vec3f vertex = sc->getVertex(); @@ -2284,7 +2287,7 @@ void Game::mouseDownLeft(int x, int y) { else { gui.mouseDownLeftGraphics(x, y, false); - if(isKeyDown(vkShift)) { + if(setMarker) { Vec2i targetPos; Vec2i screenPos(x,y-60); Renderer &renderer= Renderer::getInstance(); @@ -2620,7 +2623,9 @@ void Game::mouseMove(int x, int y, const MouseState *ms) { } else { - gameCamera.setPos(Vec2f(static_cast(xCell), static_cast(yCell))); + if(!setMarker) { + gameCamera.setPos(Vec2f(static_cast(xCell), static_cast(yCell))); + } } } } @@ -2777,6 +2782,9 @@ void Game::keyDown(SDL_KeyboardEvent key) { else if(isKeyPressed(configKeys.getSDLKey("ShowFullConsole"),key, false) == true) { showFullConsole= true; } + else if(isKeyPressed(configKeys.getSDLKey("SetMarker"),key, false) == true) { + setMarker= true; + } //else if(key == configKeys.getCharKey("TogglePhotoMode")) { else if(isKeyPressed(configKeys.getSDLKey("TogglePhotoMode"),key, false) == true) { photoModeEnabled = !photoModeEnabled; @@ -3022,6 +3030,9 @@ void Game::keyUp(SDL_KeyboardEvent key) { if(isKeyPressed(configKeys.getSDLKey("ShowFullConsole"),key) == true) { showFullConsole= false; } + else if(isKeyPressed(configKeys.getSDLKey("SetMarker"),key) == true) { + setMarker= false; + } //else if(key == configKeys.getCharKey("CameraRotateLeft") || // key == configKeys.getCharKey("CameraRotateRight")) { else if(isKeyPressed(configKeys.getSDLKey("CameraRotateLeft"),key) == true || diff --git a/source/glest_game/game/game.h b/source/glest_game/game/game.h index c32f2449..287ca102 100644 --- a/source/glest_game/game/game.h +++ b/source/glest_game/game/game.h @@ -96,6 +96,7 @@ private: bool gameOver; bool renderNetworkStatus; bool showFullConsole; + bool setMarker; bool mouseMoved; float scrollSpeed; bool camLeftButtonDown; diff --git a/source/glest_game/graphics/renderer.cpp b/source/glest_game/graphics/renderer.cpp index 46056780..fdc5d948 100644 --- a/source/glest_game/graphics/renderer.cpp +++ b/source/glest_game/graphics/renderer.cpp @@ -4790,7 +4790,7 @@ void Renderer::renderUnitsToBuild(const int renderFps) { const UnitBuildInfo &buildUnit = qCache.visibleQuadUnitBuildList[visibleUnitIndex]; //Vec4f modelColor= Vec4f(0.f, 1.f, 0.f, 0.5f); const Vec3f teamColor = buildUnit.unit->getFaction()->getTexture()->getPixmapConst()->getPixel3f(0,0); - Vec4f modelColor= Vec4f(teamColor.x,teamColor.y,teamColor.z,0.2f); + Vec4f modelColor= Vec4f(teamColor.x,teamColor.y,teamColor.z,0.4f); renderGhostModel(buildUnit.buildUnit, buildUnit.pos, buildUnit.facing, &modelColor); //printf("Rendering to build unit index = %d\n",visibleUnitIndex); diff --git a/source/glest_game/network/server_interface.cpp b/source/glest_game/network/server_interface.cpp index 32ea16c2..b2508d6c 100644 --- a/source/glest_game/network/server_interface.cpp +++ b/source/glest_game/network/server_interface.cpp @@ -1166,10 +1166,7 @@ void ServerInterface::dispatchPendingHighlightCellMessages(std::vector this->setHighlightedCell(msg); NetworkMessageHighlightCell networkMessageHighlightCell(msg.getTargetPos(),msg.getFactionIndex()); - printf("und jetzt für alle\n"); broadcastMessage(&networkMessageHighlightCell, connectionSlot->getPlayerIndex(),i); - - //if(SystemFlags::getSystemSettingType(SystemFlags::debugNetwork).enabled) SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] after broadcast chatTeamIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,newChatTeamIndex); } }