From: <aki...@us...> - 2008-09-24 18:59:28
|
Revision: 5215 http://gridarta.svn.sourceforge.net/gridarta/?rev=5215&view=rev Author: akirschbaum Date: 2008-09-24 18:59:09 +0000 (Wed, 24 Sep 2008) Log Message: ----------- Unify error checks. Modified Paths: -------------- trunk/crossfire/src/cfeditor/MapActions.java trunk/daimonin/src/daieditor/MapActions.java Modified: trunk/crossfire/src/cfeditor/MapActions.java =================================================================== --- trunk/crossfire/src/cfeditor/MapActions.java 2008-09-24 18:53:18 UTC (rev 5214) +++ trunk/crossfire/src/cfeditor/MapActions.java 2008-09-24 18:59:09 UTC (rev 5215) @@ -384,10 +384,8 @@ if (destinationPoint != null) { if (destinationPoint.x == 0 && destinationPoint.y == 0) { ACTION_FACTORY.showMessageDialog(parent, "enterExitNowhere"); - } else if (currentMap.getMapModel().isPointValid(destinationPoint)) { + } else { showLocation(currentMapView, destinationPoint); - } else { - ACTION_FACTORY.showMessageDialog(parent, "enterExitOutside"); } } return; @@ -439,6 +437,11 @@ * @param point the tile */ private void showLocation(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView, final Point point) { + if (!mapView.getMapControl().getMapModel().isPointValid(point)) { + ACTION_FACTORY.showMessageDialog(parent, "enterExitOutside"); + return; + } + mapView.getMapViewBasic().setCursorPosition(point); } Modified: trunk/daimonin/src/daieditor/MapActions.java =================================================================== --- trunk/daimonin/src/daieditor/MapActions.java 2008-09-24 18:53:18 UTC (rev 5214) +++ trunk/daimonin/src/daieditor/MapActions.java 2008-09-24 18:59:09 UTC (rev 5215) @@ -376,10 +376,8 @@ if (destinationPoint != null) { if (destinationPoint.x == 0 && destinationPoint.y == 0) { ACTION_FACTORY.showMessageDialog(parent, "enterExitNowhere"); - } else if (currentMap.getMapModel().isPointValid(destinationPoint)) { + } else { showLocation(currentMapView, destinationPoint); - } else { - ACTION_FACTORY.showMessageDialog(parent, "enterExitOutside"); } } return; @@ -431,6 +429,11 @@ * @param point the tile */ private void showLocation(final MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> mapView, final Point point) { + if (!mapView.getMapControl().getMapModel().isPointValid(point)) { + ACTION_FACTORY.showMessageDialog(parent, "enterExitOutside"); + return; + } + mapView.getMapViewBasic().setCursorPosition(point); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |