diff --git a/.gitignore b/.gitignore
index 90829018a..40d909039 100644
--- a/.gitignore
+++ b/.gitignore
@@ -92,6 +92,7 @@ $RECYCLE.BIN/
*.exe
*.msi
*.pdb
+*.aps
unsuccessfulbuild
/mk/windows/dependencies/openssl
/mk/windows/dependencies/src
diff --git a/mk/shared/g3d_viewer.ico b/mk/shared/g3d_viewer.ico
new file mode 100644
index 000000000..0d2a9f342
Binary files /dev/null and b/mk/shared/g3d_viewer.ico differ
diff --git a/mk/shared/map_editor.ico b/mk/shared/map_editor.ico
new file mode 100644
index 000000000..4f1073868
Binary files /dev/null and b/mk/shared/map_editor.ico differ
diff --git a/mk/shared/zetaglest.ico b/mk/shared/zetaglest.ico
new file mode 100644
index 000000000..f2ce53b69
Binary files /dev/null and b/mk/shared/zetaglest.ico differ
diff --git a/mk/windows/g3d_viewer.rc b/mk/windows/g3d_viewer.rc
index 8b319ed55..cbcefaaa5 100644
--- a/mk/windows/g3d_viewer.rc
+++ b/mk/windows/g3d_viewer.rc
@@ -1 +1 @@
-IDI_ICON1 ICON DISCARDABLE "..\shared\g3dviewer.ico"
+IDI_ICON1 ICON DISCARDABLE "..\shared\g3d_viewer.ico"
diff --git a/mk/windows/glest_editor.rc b/mk/windows/glest_editor.rc
deleted file mode 100644
index 2cdc1b4ae..000000000
--- a/mk/windows/glest_editor.rc
+++ /dev/null
@@ -1 +0,0 @@
-IDI_ICON1 ICON DISCARDABLE "..\shared\editor.ico"
diff --git a/mk/windows/group-binaries.bat b/mk/windows/group-binaries.bat
index 31b6f97b9..c79cf5c96 100644
--- a/mk/windows/group-binaries.bat
+++ b/mk/windows/group-binaries.bat
@@ -18,8 +18,8 @@ copy /y ..\shared\glestkeys.ini bin\vs2017\glestkeys.ini
copy /y ..\shared\servers.ini bin\vs2015\servers.ini
copy /y ..\shared\servers.ini bin\vs2017\servers.ini
-copy /y vs2015-32\g3dviewerWin32\Release\g3dviewer.exe bin\vs2015\g3dviewer-32.exe
-copy /y vs2017-32\g3dviewerWin32\Release\g3dviewer.exe bin\vs2017\g3dviewer-32.exe
+copy /y vs2015-32\g3d_viewerWin32\Release\g3d_viewer.exe bin\vs2015\g3d_viewer-32.exe
+copy /y vs2017-32\g3d_viewerWin32\Release\g3d_viewer.exe bin\vs2017\g3d_viewer-32.exe
copy /y vs2015-32\map_editorWin32\Release\map_editor.exe bin\vs2015\map_editor-32.exe
copy /y vs2017-32\map_editorWin32\Release\map_editor.exe bin\vs2017\map_editor-32.exe
@@ -27,8 +27,8 @@ copy /y vs2017-32\map_editorWin32\Release\map_editor.exe bin\vs2017\map_editor-3
copy /y vs2015-32\zetaglest\zetaglest.exe bin\vs2015\zetaglest-32.exe
copy /y vs2017-32\zetaglest\zetaglest.exe bin\vs2017\zetaglest-32.exe
-copy /y vs2015-64\g3dviewerx64\Release\g3dviewer.exe bin\vs2015\g3dviewer-64.exe
-copy /y vs2017-64\g3dviewerx64\Release\g3dviewer.exe bin\vs2017\g3dviewer-64.exe
+copy /y vs2015-64\g3d_viewerx64\Release\g3d_viewer.exe bin\vs2015\g3d_viewer-64.exe
+copy /y vs2017-64\g3d_viewerx64\Release\g3d_viewer.exe bin\vs2017\g3d_viewer-64.exe
copy /y vs2015-64\map_editorx64\Release\map_editor.exe bin\vs2015\map_editor-64.exe
copy /y vs2017-64\map_editorx64\Release\map_editor.exe bin\vs2017\map_editor-64.exe
diff --git a/mk/windows/map_editor.rc b/mk/windows/map_editor.rc
new file mode 100644
index 000000000..4b3757a9c
--- /dev/null
+++ b/mk/windows/map_editor.rc
@@ -0,0 +1 @@
+IDI_ICON1 ICON DISCARDABLE "..\shared\map_editor.ico"
diff --git a/mk/windows/vs2015-32/ZetaGlest.sln b/mk/windows/vs2015-32/ZetaGlest.sln
index b0f0fb571..fdc429045 100644
--- a/mk/windows/vs2015-32/ZetaGlest.sln
+++ b/mk/windows/vs2015-32/ZetaGlest.sln
@@ -9,7 +9,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zetaglest", "zetaglest.vcxp
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g2xml", "g2xml.vcxproj", "{407355A4-D12A-4E3B-A7EB-A835E573B376}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3dviewer", "g3dviewer.vcxproj", "{FE5C7C7C-F109-44F5-8329-25A4E24F162C}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3d_viewer", "g3d_viewer.vcxproj", "{FE5C7C7C-F109-44F5-8329-25A4E24F162C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map_editor", "map_editor.vcxproj", "{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}"
EndProject
diff --git a/mk/windows/vs2015-32/g3dviewer.vcxproj b/mk/windows/vs2015-32/g3d_viewer.vcxproj
similarity index 98%
rename from mk/windows/vs2015-32/g3dviewer.vcxproj
rename to mk/windows/vs2015-32/g3d_viewer.vcxproj
index 605f8122b..350b8aad9 100644
--- a/mk/windows/vs2015-32/g3dviewer.vcxproj
+++ b/mk/windows/vs2015-32/g3d_viewer.vcxproj
@@ -12,9 +12,9 @@
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}
- g3dviewer
+ g3d_viewer
Win32Proj
- g3dviewer
+ g3d_viewer
8.1
@@ -90,10 +90,10 @@
false
false
false
- g3dviewer
- g3dviewer
- g3dviewer
- g3dviewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
false
false
false
diff --git a/mk/windows/vs2015-32/map_editor.vcxproj b/mk/windows/vs2015-32/map_editor.vcxproj
index cd5f1e8e5..ee70caf8f 100644
--- a/mk/windows/vs2015-32/map_editor.vcxproj
+++ b/mk/windows/vs2015-32/map_editor.vcxproj
@@ -242,7 +242,7 @@
-
+
diff --git a/mk/windows/vs2015-32/zetaglest.vcxproj b/mk/windows/vs2015-32/zetaglest.vcxproj
index a5570a3fc..1a09e891b 100644
--- a/mk/windows/vs2015-32/zetaglest.vcxproj
+++ b/mk/windows/vs2015-32/zetaglest.vcxproj
@@ -752,7 +752,7 @@
-
+
diff --git a/mk/windows/vs2015-64/g3d_viewer.vcxproj b/mk/windows/vs2015-64/g3d_viewer.vcxproj
index 377ccbbda..328153887 100644
--- a/mk/windows/vs2015-64/g3d_viewer.vcxproj
+++ b/mk/windows/vs2015-64/g3d_viewer.vcxproj
@@ -90,10 +90,10 @@
false
false
false
- g3dviewer
- g3dviewer
- g3dviewer
- g3dviewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
false
false
false
diff --git a/mk/windows/vs2015-64/map_editor.vcxproj b/mk/windows/vs2015-64/map_editor.vcxproj
index 20110ae06..323f86a39 100644
--- a/mk/windows/vs2015-64/map_editor.vcxproj
+++ b/mk/windows/vs2015-64/map_editor.vcxproj
@@ -316,7 +316,7 @@
-
+
diff --git a/mk/windows/vs2015-64/zetaglest.vcxproj b/mk/windows/vs2015-64/zetaglest.vcxproj
index a87cbec18..02a70ab02 100644
--- a/mk/windows/vs2015-64/zetaglest.vcxproj
+++ b/mk/windows/vs2015-64/zetaglest.vcxproj
@@ -564,7 +564,7 @@
-
+
diff --git a/mk/windows/vs2017-32/ZetaGlest.sln b/mk/windows/vs2017-32/ZetaGlest.sln
index 46c5572e0..b27774ac0 100644
--- a/mk/windows/vs2017-32/ZetaGlest.sln
+++ b/mk/windows/vs2017-32/ZetaGlest.sln
@@ -9,7 +9,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zetaglest", "zetaglest.vcxp
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g2xml", "g2xml.vcxproj", "{407355A4-D12A-4E3B-A7EB-A835E573B376}"
EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3dviewer", "g3dviewer.vcxproj", "{FE5C7C7C-F109-44F5-8329-25A4E24F162C}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "g3d_viewer", "g3d_viewer.vcxproj", "{FE5C7C7C-F109-44F5-8329-25A4E24F162C}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "map_editor", "map_editor.vcxproj", "{5D09BE33-81EC-450B-8A7B-2E7B941ADC56}"
EndProject
diff --git a/mk/windows/vs2017-32/g3dviewer.vcxproj b/mk/windows/vs2017-32/g3d_viewer.vcxproj
similarity index 98%
rename from mk/windows/vs2017-32/g3dviewer.vcxproj
rename to mk/windows/vs2017-32/g3d_viewer.vcxproj
index 488bdd2e9..bd9c67bfa 100644
--- a/mk/windows/vs2017-32/g3dviewer.vcxproj
+++ b/mk/windows/vs2017-32/g3d_viewer.vcxproj
@@ -12,9 +12,9 @@
{FE5C7C7C-F109-44F5-8329-25A4E24F162C}
- g3dviewer
+ g3d_viewer
Win32Proj
- g3dviewer
+ g3d_viewer
8.1
@@ -90,10 +90,10 @@
false
false
false
- g3dviewer
- g3dviewer
- g3dviewer
- g3dviewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
false
false
false
diff --git a/mk/windows/vs2017-32/map_editor.vcxproj b/mk/windows/vs2017-32/map_editor.vcxproj
index 0b8759cb5..108c6ef16 100644
--- a/mk/windows/vs2017-32/map_editor.vcxproj
+++ b/mk/windows/vs2017-32/map_editor.vcxproj
@@ -242,7 +242,7 @@
-
+
diff --git a/mk/windows/vs2017-32/zetaglest.vcxproj b/mk/windows/vs2017-32/zetaglest.vcxproj
index 38586f929..d324e0b67 100644
--- a/mk/windows/vs2017-32/zetaglest.vcxproj
+++ b/mk/windows/vs2017-32/zetaglest.vcxproj
@@ -752,7 +752,7 @@
-
+
diff --git a/mk/windows/vs2017-64/g3d_viewer.vcxproj b/mk/windows/vs2017-64/g3d_viewer.vcxproj
index 4c90d0627..6f575d431 100644
--- a/mk/windows/vs2017-64/g3d_viewer.vcxproj
+++ b/mk/windows/vs2017-64/g3d_viewer.vcxproj
@@ -90,10 +90,10 @@
false
false
false
- g3dviewer
- g3dviewer
- g3dviewer
- g3dviewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
+ g3d_viewer
false
false
false
diff --git a/mk/windows/vs2017-64/map_editor.vcxproj b/mk/windows/vs2017-64/map_editor.vcxproj
index 1c59ad02d..df01204c7 100644
--- a/mk/windows/vs2017-64/map_editor.vcxproj
+++ b/mk/windows/vs2017-64/map_editor.vcxproj
@@ -316,7 +316,7 @@
-
+
diff --git a/mk/windows/vs2017-64/zetaglest.vcxproj b/mk/windows/vs2017-64/zetaglest.vcxproj
index 1b702cc70..961c3c663 100644
--- a/mk/windows/vs2017-64/zetaglest.vcxproj
+++ b/mk/windows/vs2017-64/zetaglest.vcxproj
@@ -564,7 +564,7 @@
-
+
diff --git a/mk/windows/glest.rc b/mk/windows/zetaglest.rc
similarity index 100%
rename from mk/windows/glest.rc
rename to mk/windows/zetaglest.rc
diff --git a/source/glest_game/game/commander.cpp b/source/glest_game/game/commander.cpp
index dc298e703..f7d306f7b 100644
--- a/source/glest_game/game/commander.cpp
+++ b/source/glest_game/game/commander.cpp
@@ -426,7 +426,7 @@ namespace
const Vec2i & pos,
const Unit * targetUnit,
bool tryQueue,
- int unitCommandGroupId) const {
+ int unitCommandGroupId, bool isMove) const {
if (this->pauseNetworkCommands == true) {
return std::pair < CommandResult, string >(crFailUndefined, "");
}
@@ -468,8 +468,6 @@ namespace
command[i] = commandType;
}
Game* game = world->getGame();
- bool isMove = game->SendMove;
- game->SendMove = false;
for (int i = 0; i < selection->getCount(); ++i) {
const Unit * unit = selection->getUnit(i);
const CommandType *commandType = command[i];
@@ -691,7 +689,7 @@ namespace
}
//add the command to the interface
- gameNetworkInterface->requestCommand(networkCommand);
+ gameNetworkInterface->requestCommand(networkCommand, true);
//calculate the result of the command
if (unit != NULL
diff --git a/source/glest_game/game/commander.h b/source/glest_game/game/commander.h
index e7821a71d..6ffcc7e15 100644
--- a/source/glest_game/game/commander.h
+++ b/source/glest_game/game/commander.h
@@ -148,7 +148,7 @@ namespace
string >
tryGiveCommand(const Selection * selection, const Vec2i & pos,
const Unit * targetUnit = NULL, bool tryQueue =
- false, int unitCommandGroupId = -1) const;
+ false, int unitCommandGroupId = -1, bool isMove = false) const;
CommandResult
tryCancelCommand(const Selection * selection) const;
void
diff --git a/source/glest_game/game/game.cpp b/source/glest_game/game/game.cpp
index 9045d79f2..b007c4c37 100644
--- a/source/glest_game/game/game.cpp
+++ b/source/glest_game/game/game.cpp
@@ -85,7 +85,6 @@ namespace Glest {
aiInterfaces.clear();
videoPlayer = NULL;
playingStaticVideo = false;
- SendMove = false;
mouse2d = 0;
mouseX = 0;
mouseY = 0;
@@ -213,7 +212,6 @@ namespace Glest {
GameConstants::updateFps = 40;
GameConstants::cameraFps = 100;
captureAvgTestStatus = false;
- SendMove = false;
updateFpsAvgTest = 0;
renderFpsAvgTest = 0;
lastRenderLog2d = 0;
@@ -360,7 +358,6 @@ namespace Glest {
updateFpsAvgTest = 0;
renderFpsAvgTest = 0;
cameraDragAllowed = false;
- SendMove = false;
if (this->masterserverMode == true) {
printf("Starting a new game...\n");
@@ -5731,23 +5728,14 @@ namespace Glest {
ym * (static_cast <
float>(map->getH()) / metrics.getMinimapH()));
- if (map->isInside(xCell, yCell)
- && map->
- isInsideSurface(map->toSurfCoords(Vec2i(xCell, yCell)))) {
- if (checkRightDoubleClick())
- SendMove = true;
+ if (map->isInside(xCell, yCell) && map->isInsideSurface(map->toSurfCoords(Vec2i(xCell, yCell))))
gui.mouseDownRightGraphics(xCell, yCell, true);
- }
} else {
Vec2i targetPos;
Vec2i screenPos(x, y);
targetPos = getMouseCellPos();
- if (isValidMouseCellPos() == true &&
- map->isInsideSurface(map->toSurfCoords(targetPos)) == true) {
- if (checkRightDoubleClick())
- SendMove = true;
+ if (isValidMouseCellPos() == true && map->isInsideSurface(map->toSurfCoords(targetPos)) == true)
gui.mouseDownRightGraphics(x, y, false);
- }
}
} catch (const exception & ex) {
char szBuf[8096] = "";
@@ -5885,25 +5873,67 @@ namespace Glest {
}
}
- bool Game::checkRightDoubleClick(void) {
- static Uint32 LastClickTicks;
- Uint32 CurrentClickTicks;
- /* The first time this function is called, LastClickTicks has not been initialised yet. */
- if (!LastClickTicks) {
- LastClickTicks = SDL_GetTicks();
- return false;
- } else {
- CurrentClickTicks = SDL_GetTicks();
- /* If the period between the two clicks is smaller or equal to a pre-defined number, we report a DoubleClick event. */
- if (CurrentClickTicks - LastClickTicks <= 400) {
- /* Update LastClickTicks and signal a DoubleClick. */
- LastClickTicks = CurrentClickTicks;
- return true;
- } else {
- /* Update LastClickTicks and signal a SingleClick. */
- LastClickTicks = CurrentClickTicks;
- return false;
+ void Game::mouseDoubleClickRight(int x, int y) {
+ if (this->masterserverMode == true) {
+ return;
+ }
+
+ try {
+ if (gameStarted == false || totalRenderFps <= 0)
+ return;
+ if (currentUIState != NULL) {
+ currentUIState->mouseDoubleClickRight(x, y);
+ return;
}
+
+ Map *map = world.getMap();
+ const Metrics & metrics = Metrics::getInstance();
+
+ if (metrics.isInMinimap(x, y)) {
+ int xm = x - metrics.getMinimapX();
+ int ym = y - metrics.getMinimapY();
+ int
+ xCell =
+ static_cast <
+ int>(xm *
+ (static_cast <
+ float>(map->getW()) / metrics.getMinimapW()));
+ int
+ yCell =
+ static_cast <
+ int>(map->getH() -
+ ym * (static_cast <
+ float>(map->getH()) / metrics.getMinimapH()));
+
+ if (map->isInside(xCell, yCell) && map->isInsideSurface(map->toSurfCoords(Vec2i(xCell, yCell))))
+ gui.mouseDoubleClickRightGraphics(xCell, yCell, true);
+ } else {
+ Vec2i targetPos;
+ Vec2i screenPos(x, y);
+ targetPos = getMouseCellPos();
+ if (isValidMouseCellPos() == true && map->isInsideSurface(map->toSurfCoords(targetPos)) == true)
+ gui.mouseDoubleClickRightGraphics(x, y, false);
+ }
+ } catch (const exception & ex) {
+ char szBuf[8096] = "";
+ snprintf(szBuf, 8096, "In [%s::%s Line: %d] Error [%s]\n",
+ extractFileFromDirectoryPath(__FILE__).c_str(),
+ __FUNCTION__, __LINE__, ex.what());
+
+ SystemFlags::OutputDebug(SystemFlags::debugError, szBuf);
+ if (SystemFlags::
+ getSystemSettingType(SystemFlags::debugSystem).enabled)
+ SystemFlags::OutputDebug(SystemFlags::debugSystem, szBuf);
+
+ NetworkManager & networkManager = NetworkManager::getInstance();
+ if (networkManager.getGameNetworkInterface() != NULL) {
+ GameNetworkInterface *networkInterface =
+ NetworkManager::getInstance().getGameNetworkInterface();
+ networkInterface->sendTextMessage(szBuf, -1, true, "");
+ sleep(10);
+ networkManager.getGameNetworkInterface()->quitGame(true);
+ }
+ ErrorDisplayMessage(ex.what(), true);
}
}
diff --git a/source/glest_game/game/game.h b/source/glest_game/game/game.h
index 8ba775022..5fc64b075 100644
--- a/source/glest_game/game/game.h
+++ b/source/glest_game/game/game.h
@@ -87,7 +87,6 @@ namespace Glest {
public CustomInputCallbackInterface, public ClientLagCallbackInterface {
public:
static const float highlightTime;
- bool SendMove;
private:
typedef vector < Ai * > Ais;
@@ -370,7 +369,6 @@ namespace Glest {
virtual void updateCamera();
virtual void render();
virtual void tick();
- bool checkRightDoubleClick(void);
//event managing
virtual bool textInput(std::string text);
@@ -383,7 +381,7 @@ namespace Glest {
virtual void mouseUpCenter(int x, int y);
virtual void mouseUpLeft(int x, int y);
virtual void mouseDoubleClickLeft(int x, int y);
- //virtual void mouseDoubleClickRight(int x, int y);
+ virtual void mouseDoubleClickRight(int x, int y);
virtual void eventMouseWheel(int x, int y, int zDelta);
virtual void mouseMove(int x, int y, const MouseState * mouseState);
diff --git a/source/glest_game/gui/gui.cpp b/source/glest_game/gui/gui.cpp
index ac762a58d..adf8a24b5 100644
--- a/source/glest_game/gui/gui.cpp
+++ b/source/glest_game/gui/gui.cpp
@@ -345,6 +345,22 @@ namespace Glest {
}
}
+ void Gui::mouseDoubleClickRightGraphics(int x, int y, bool prepared) {
+ if (selectingPos || selectingMeetingPoint) {
+ resetState();
+ } else if (selection.isCommandable()) {
+ if (prepared) {
+ //Vec2i targetPos=game->getMouseCellPos();
+ givePreparedDefaultOrders(x, y, true);
+ } else {
+ Vec2i targetPos = game->getMouseCellPos();
+ if (game->isValidMouseCellPos() && world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)
+ giveDefaultOrders(x, y, true);
+ }
+ }
+ computeDisplay();
+ }
+
void Gui::groupKey(int groupIndex) {
if (isKeyDown(vkControl)) {
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d] groupIndex = %d\n", __FILE__, __FUNCTION__, __LINE__, groupIndex);
@@ -459,7 +475,7 @@ namespace Glest {
activeCommandClass = ccStop;
}
- void Gui::giveDefaultOrders(int x, int y) {
+ void Gui::giveDefaultOrders(int x, int y, bool isMove) {
//compute target
//printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
@@ -470,23 +486,23 @@ namespace Glest {
return;
}
//printf("In [%s::%s Line: %d] targetUnit = %p\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,targetUnit);
- giveDefaultOrders(targetPos.x, targetPos.y, targetUnit, true);
+ giveDefaultOrders(targetPos.x, targetPos.y, targetUnit, true, isMove);
//printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
}
- void Gui::givePreparedDefaultOrders(int x, int y) {
+ void Gui::givePreparedDefaultOrders(int x, int y, bool isMove) {
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
- giveDefaultOrders(x, y, NULL, false);
+ giveDefaultOrders(x, y, NULL, false, isMove);
}
- void Gui::giveDefaultOrders(int x, int y, const Unit *targetUnit, bool paintMouse3d) {
+ void Gui::giveDefaultOrders(int x, int y, const Unit *targetUnit, bool paintMouse3d, bool isMove) {
//printf("In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
bool queueKeyDown = isKeyDown(queueCommandKey);
Vec2i targetPos = Vec2i(x, y);
//give order
//printf("In [%s::%s Line: %d]\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__);
- std::pair result = commander->tryGiveCommand(&selection, targetPos, targetUnit, queueKeyDown);
+ std::pair result = commander->tryGiveCommand(&selection, targetPos, targetUnit, queueKeyDown, -1, isMove);
//printf("In [%s::%s Line: %d] selected units = %d result.first = %d\n",extractFileFromDirectoryPath(__FILE__).c_str(),__FUNCTION__,__LINE__,selection.getCount(),result.first);
diff --git a/source/glest_game/gui/gui.h b/source/glest_game/gui/gui.h
index 0b888cfd5..a40f14681 100644
--- a/source/glest_game/gui/gui.h
+++ b/source/glest_game/gui/gui.h
@@ -235,6 +235,7 @@ namespace Glest {
void mouseUpLeftGraphics(int x, int y);
void mouseMoveGraphics(int x, int y);
void mouseDoubleClickLeftGraphics(int x, int y);
+ void mouseDoubleClickRightGraphics(int x, int y, bool prepared);
void groupKey(int groupIndex);
void hotKey(SDL_KeyboardEvent key);
@@ -248,9 +249,9 @@ namespace Glest {
private:
//orders
- void giveDefaultOrders(int x, int y);
- void giveDefaultOrders(int x, int y, const Unit *targetUnit, bool paintMouse3d);
- void givePreparedDefaultOrders(int x, int y);
+ void giveDefaultOrders(int x, int y, bool isMove = false);
+ void giveDefaultOrders(int x, int y, const Unit *targetUnit, bool paintMouse3d, bool isMove = false);
+ void givePreparedDefaultOrders(int x, int y, bool isMove = false);
void giveOneClickOrders();
void giveTwoClickOrders(int x, int y, bool prepared);
diff --git a/source/shared_lib/sources/platform/sdl/window.cpp b/source/shared_lib/sources/platform/sdl/window.cpp
index 016af5185..7faafd003 100644
--- a/source/shared_lib/sources/platform/sdl/window.cpp
+++ b/source/shared_lib/sources/platform/sdl/window.cpp
@@ -682,9 +682,10 @@ namespace Shared {
if (ticks - lastMouseDown[n] < DOUBLECLICKTIME
&& abs(lastMouseX[n] - event.button.x) < DOUBLECLICKDELTA
&& abs(lastMouseY[n] - event.button.y) < DOUBLECLICKDELTA) {
-
- if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
- eventMouseDown(event.button.x, event.button.y, button);
+ //if (button != MouseButton::mbLeft) {
+ if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
+ eventMouseDown(event.button.x, event.button.y, button);
+ //}
if (SystemFlags::getSystemSettingType(SystemFlags::debugSystem).enabled) SystemFlags::OutputDebug(SystemFlags::debugSystem, "In [%s::%s Line: %d]\n", extractFileFromDirectoryPath(__FILE__).c_str(), __FUNCTION__, __LINE__);
eventMouseDoubleClick(event.button.x, event.button.y, button);
} else {