no more false clicks on minimap

if minimap was displayed outside of map, it was not possible to give 
mouse click commands there.
This commit is contained in:
titiger
2015-01-29 21:59:05 +01:00
parent 9aff9842a4
commit 504dc7dfd8

View File

@@ -257,8 +257,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
if(selectingPos) {
//give standard orders
Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
giveTwoClickOrders(x, y, prepared);
}
resetState();
@@ -267,8 +267,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
else if(selectingMeetingPoint) {
if(selection.isCommandable()) {
Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos);
}
}
@@ -288,15 +288,15 @@ void Gui::mouseDownRightGraphics(int x, int y , bool prepared) {
else if(selection.isCommandable()) {
if(prepared) {
Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true )) {
givePreparedDefaultOrders(x, y);
}
}
else {
Vec2i targetPos=game->getMouseCellPos();
if(game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
if(prepared || (game->isValidMouseCellPos() &&
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
giveDefaultOrders(x, y);
}
}