mirror of
https://github.com/glest/glest-source.git
synced 2025-08-28 02:09:54 +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) {
|
||||
//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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user