mirror of
https://github.com/glest/glest-source.git
synced 2025-08-29 19:00:07 +02:00
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:
@@ -257,8 +257,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
|
|||||||
if(selectingPos) {
|
if(selectingPos) {
|
||||||
//give standard orders
|
//give standard orders
|
||||||
Vec2i targetPos=game->getMouseCellPos();
|
Vec2i targetPos=game->getMouseCellPos();
|
||||||
if(game->isValidMouseCellPos() &&
|
if(prepared || (game->isValidMouseCellPos() &&
|
||||||
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
|
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
|
||||||
giveTwoClickOrders(x, y, prepared);
|
giveTwoClickOrders(x, y, prepared);
|
||||||
}
|
}
|
||||||
resetState();
|
resetState();
|
||||||
@@ -267,8 +267,8 @@ void Gui::mouseDownLeftGraphics(int x, int y, bool prepared) {
|
|||||||
else if(selectingMeetingPoint) {
|
else if(selectingMeetingPoint) {
|
||||||
if(selection.isCommandable()) {
|
if(selection.isCommandable()) {
|
||||||
Vec2i targetPos=game->getMouseCellPos();
|
Vec2i targetPos=game->getMouseCellPos();
|
||||||
if(game->isValidMouseCellPos() &&
|
if(prepared || (game->isValidMouseCellPos() &&
|
||||||
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
|
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
|
||||||
commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos);
|
commander->trySetMeetingPoint(selection.getFrontUnit(), targetPos);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -288,15 +288,15 @@ void Gui::mouseDownRightGraphics(int x, int y , bool prepared) {
|
|||||||
else if(selection.isCommandable()) {
|
else if(selection.isCommandable()) {
|
||||||
if(prepared) {
|
if(prepared) {
|
||||||
Vec2i targetPos=game->getMouseCellPos();
|
Vec2i targetPos=game->getMouseCellPos();
|
||||||
if(game->isValidMouseCellPos() &&
|
if(prepared || (game->isValidMouseCellPos() &&
|
||||||
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
|
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true )) {
|
||||||
givePreparedDefaultOrders(x, y);
|
givePreparedDefaultOrders(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
Vec2i targetPos=game->getMouseCellPos();
|
Vec2i targetPos=game->getMouseCellPos();
|
||||||
if(game->isValidMouseCellPos() &&
|
if(prepared || (game->isValidMouseCellPos() &&
|
||||||
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true) {
|
world->getMap()->isInsideSurface(world->getMap()->toSurfCoords(targetPos)) == true)) {
|
||||||
giveDefaultOrders(x, y);
|
giveDefaultOrders(x, y);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user