world map mouse listener: consume click if icon is clicked on
This stops the map from being closed when clicking on an icon overlapping the close button.
This commit is contained in:
@@ -60,6 +60,12 @@ public class WorldMapOverlayMouseListener extends MouseAdapter
|
|||||||
if (SwingUtilities.isLeftMouseButton(e) && !worldMapPoints.isEmpty())
|
if (SwingUtilities.isLeftMouseButton(e) && !worldMapPoints.isEmpty())
|
||||||
{
|
{
|
||||||
Point mousePos = client.getMouseCanvasPosition();
|
Point mousePos = client.getMouseCanvasPosition();
|
||||||
|
final Widget view = client.getWidget(WidgetInfo.WORLD_MAP_VIEW);
|
||||||
|
|
||||||
|
if (view == null)
|
||||||
|
{
|
||||||
|
return e;
|
||||||
|
}
|
||||||
|
|
||||||
for (WorldMapPoint worldMapPoint : worldMapPoints)
|
for (WorldMapPoint worldMapPoint : worldMapPoints)
|
||||||
{
|
{
|
||||||
@@ -77,6 +83,7 @@ public class WorldMapOverlayMouseListener extends MouseAdapter
|
|||||||
RenderOverview renderOverview = client.getRenderOverview();
|
RenderOverview renderOverview = client.getRenderOverview();
|
||||||
renderOverview.setWorldMapPositionTarget(target);
|
renderOverview.setWorldMapPositionTarget(target);
|
||||||
}
|
}
|
||||||
|
e.consume();
|
||||||
return worldMapPoint.onClick(e);
|
return worldMapPoint.onClick(e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user