From: <aki...@us...> - 2008-10-21 19:03:16
|
Revision: 5575 http://gridarta.svn.sourceforge.net/gridarta/?rev=5575&view=rev Author: akirschbaum Date: 2008-10-21 19:03:12 +0000 (Tue, 21 Oct 2008) Log Message: ----------- Add Map|Next Exit and Map|Previous Exit: select next/previous exit tile on map. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/action.properties trunk/daimonin/ChangeLog trunk/daimonin/src/daieditor/action.properties trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/crossfire/ChangeLog 2008-10-21 19:03:12 UTC (rev 5575) @@ -1,3 +1,8 @@ +2008-10-21 Andreas Kirschbaum + + * Add Map|Next Exit and Map|Previous Exit: select next/previous + exit tile on map. + 2008-10-19 Andreas Kirschbaum * Add map validator "Tile path invalid": checks whether tiled map Modified: trunk/crossfire/src/cfeditor/action.properties =================================================================== --- trunk/crossfire/src/cfeditor/action.properties 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/crossfire/src/cfeditor/action.properties 2008-10-21 19:03:12 UTC (rev 5575) @@ -27,7 +27,7 @@ main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=createNew open recent close - save saveAs saveAll revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodfill - selectAll -map.menu=autoJoin - enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize +map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta resources.menu=collectArches - reloadFaces - viewTreasurelists @@ -42,7 +42,7 @@ mapwindowFile.menu=save saveAs createImage - revert - close mapwindowEdit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodfill - selectAll -mapwindowMap.menu=gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize +mapwindowMap.menu=gridVisible enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap tileShow - mapCreateView mapProperties shrinkMapSize mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes ########## Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/daimonin/ChangeLog 2008-10-21 19:03:12 UTC (rev 5575) @@ -1,3 +1,8 @@ +2008-10-21 Andreas Kirschbaum + + * Add Map|Next Exit and Map|Previous Exit: select next/previous + exit tile on map. + 2008-10-13 Andreas Kirschbaum * (Somewhat) fix "reload faces". Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/daimonin/src/daieditor/action.properties 2008-10-21 19:03:12 UTC (rev 5575) @@ -27,7 +27,7 @@ main.menubar=file edit map archetypes pickmaps resources tools analyze view plugins window help file.menu=createNew open recent close - save saveAs saveAll revert createImage - options - exit edit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodfill - selectAll -map.menu=autoJoin - enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize +map.menu=autoJoin - enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize archetypes.menu=displayGameObjectNames displayArchetypeNames displayIconsOnly - findArchetypes #pickmaps.menu: See gridarta resources.menu=collectArches collectSpells - reloadFaces - viewTreasurelists @@ -42,7 +42,7 @@ mapwindowFile.menu=save saveAs createImage - revert - close mapwindowEdit.menu=undo redo - clear cut copy paste - shift - replace fillAuto fillAbove fillBelow randFillAuto randFillAbove randFillBelow floodfill - selectAll -mapwindowMap.menu=gridVisible enterExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize +mapwindowMap.menu=gridVisible enterExit nextExit prevExit enterNorthMap enterEastMap enterSouthMap enterWestMap enterNorthEastMap enterSouthEastMap enterSouthWestMap enterNorthWestMap - mapCreateView mapProperties shrinkMapSize mapwindowCursor.menu=moveCursor - selectTile startStopDrag addToSelection subFromSelection releaseDrag - insertArch deleteArch - selectArchAbove selectArchBelow - archAttributes ########## Modified: trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java 2008-10-21 19:03:12 UTC (rev 5575) @@ -35,6 +35,7 @@ import net.sf.gridarta.GlobalSettings; import net.sf.gridarta.MainControl; import net.sf.gridarta.MapManager; +import net.sf.gridarta.Size2D; import net.sf.gridarta.gameobject.Archetype; import net.sf.gridarta.gameobject.GameObject; import net.sf.gridarta.gameobject.match.GameObjectMatcher; @@ -42,6 +43,7 @@ import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.map.MapArchObject; import net.sf.gridarta.map.MapControl; +import net.sf.gridarta.map.MapModel; import net.sf.japi.swing.ActionFactory; import net.sf.japi.swing.ToggleAction; import org.jetbrains.annotations.NotNull; @@ -90,6 +92,12 @@ /** Action for "enter exit". */ private final Action aEnterExit; + /** Action for "next exit". */ + private final Action aNextExit; + + /** Action for "previous exit". */ + private final Action aPrevExit; + /** Action for "enter xxx map". */ private final Action[] aDirections = new Action[directionsMap.length]; @@ -182,6 +190,8 @@ aAutoJoin = (ToggleAction) actionFactory.createToggle(true, "autoJoin", this); aShrinkMapSize = actionFactory.createAction(true, "shrinkMapSize", this); aEnterExit = actionFactory.createAction(true, "enterExit", this); + aNextExit = actionFactory.createAction(true, "nextExit", this); + aPrevExit = actionFactory.createAction(true, "prevExit", this); autoJoin = prefs.getBoolean(AUTOJOIN_KEY, false); for (int i = 0; i < directionsMap.length; i++) { @@ -320,6 +330,120 @@ enterMap(currentMapListener.getCurrentMapView(), path, 0, exitPos); } + /** + * Select the next exit. + */ + public void nextExit() { + final MapView<G, A, R, V> mapView = getNextExitEnabled(); + if (mapView == null) { + return; + } + + final MapCursor mapCursor = mapView.getMapViewBasic().getMapCursor(); + final Point cursorLocation = mapCursor.getLocation(); + if (cursorLocation == null) { + selectExit(mapView, -1, 0, 1); + } else { + selectExit(mapView, cursorLocation.x, cursorLocation.y, 1); + } + } + + /** + * Select the previous exit. + */ + public void prevExit() { + final MapView<G, A, R, V> mapView = getPrevExitEnabled(); + if (mapView == null) { + return; + } + + final MapCursor mapCursor = mapView.getMapViewBasic().getMapCursor(); + final Point cursorLocation = mapCursor.getLocation(); + if (cursorLocation == null) { + final Size2D mapSize = mapView.getMapControl().getMapModel().getMapSize(); + selectExit(mapView, mapSize.getWidth(), mapSize.getHeight() - 1, -1); + } else { + selectExit(mapView, cursorLocation.x, cursorLocation.y, -1); + } + } + + /** + * Selects an exit tile. + * @param mapView the map view to operate on + * @param xStart the x-coordinate to start searching + * @param yStart the y-coordinate to start searching + * @param direction the direction to search + */ + private void selectExit(final MapView<G, A, R, V> mapView, final int xStart, final int yStart, final int direction) { + final MapCursor mapCursor = mapView.getMapViewBasic().getMapCursor(); + final MapModel<G, A, R> mapModel = mapView.getMapControl().getMapModel(); + final Size2D mapSize = mapModel.getMapSize(); + final int width = mapSize.getWidth(); + final int height = mapSize.getHeight(); + final Point point = new Point(xStart, yStart); + final G currentExit = getValidExit(mapModel, point); + for (int i = width * height; i > 0; i--) { + if (direction > 0) { + point.x++; + if (point.x >= width) { + point.x = 0; + point.y++; + if (point.y >= height) { + point.y = 0; + } + } + } else { + point.x--; + if (point.x < 0) { + point.x = width - 1; + point.y--; + if (point.y < 0) { + point.y = height - 1; + } + } + } + + final G exit = getValidExit(mapModel, point); + if (exit != null && exit != currentExit) { + mapCursor.setLocation(point); + return; + } + } + if (currentExit == null) { + mapCursor.setLocation(null); + } + } + + /** + * Returns an exit game object on a given map tile. + * @param mapModel the map model to check + * @param point the map tile to check + * @return the head of the exit game object or <code>null</code> if none + * was found + */ + @Nullable + private G getValidExit(@NotNull final MapModel<G, A, R> mapModel, @Nullable final Point point) { + return point == null ? null : getValidExit(mapModel.getExit(point)); + } + + /** + * Returns whether the given game object is an exit game object. + * @param exit the game object to check + * @return the game object's head if it is an exit game object or else + * <code>null</code> + */ + @Nullable + private G getValidExit(@Nullable final G exit) { + if (exit == null) { + return null; + } + final G head = exit.getHead(); + if (!exitMatcher.isMatching(head) || head.getAttributeString("slaying").length() <= 0) { + return null; + } + return head; + } + /** Action method for entering the north map. */ public void enterNorthMap() { enterMap(CommonConstants.NORTH); @@ -521,20 +645,38 @@ return null; } - final G selectedExit = selectedSquareView.getSelectedGameObject(); - if (selectedExit != null && exitMatcher.isMatching(selectedExit.getHead()) && selectedExit.getHead().getAttributeString("slaying").length() > 0) { + final G selectedExit = getValidExit(selectedSquareView.getSelectedGameObject()); + if (selectedExit != null) { return selectedExit.getHead(); } - final G cursorExit = mapView.getMapControl().getMapModel().getExit(mapView.getMapViewBasic().getMapCursor().getLocation()); - if (cursorExit != null && exitMatcher.isMatching(cursorExit) && cursorExit.getAttributeString("slaying").length() > 0) { - return cursorExit.getHead(); + final G cursorExit = getValidExit(mapView.getMapControl().getMapModel(), mapView.getMapViewBasic().getMapCursor().getLocation()); + if (cursorExit != null) { + return cursorExit; } return null; } /** + * Determines whether "next exit" is enabled. + * @return the map view if "next exit" is enabled + */ + @Nullable + private MapView<G, A, R, V> getNextExitEnabled() { + return currentMapListener.getCurrentMapView(); + } + + /** + * Determines whether "previous exit" is enabled. + * @return the map view if "previous exit" is enabled + */ + @Nullable + private MapView<G, A, R, V> getPrevExitEnabled() { + return currentMapListener.getCurrentMapView(); + } + + /** * Determine whether "enter xxx map" is enabled. * @param direction the direction to go * @return the destination map, or <code>null</code> if "enter xxx map" is @@ -564,6 +706,8 @@ aMapCreateView.setEnabled(getCreateViewEnabled() != null); aMapProperties.setEnabled(getMapPropertiesEnabled() != null); aEnterExit.setEnabled(getEnterExitEnabled() != null); + aNextExit.setEnabled(getNextExitEnabled() != null); + aPrevExit.setEnabled(getPrevExitEnabled() != null); for (int i = 0; i < directionsDir.length; i++) { aDirections[i].setEnabled(getEnterMapEnabled(directionsDir[i]) != null); } Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-10-21 19:03:12 UTC (rev 5575) @@ -134,6 +134,13 @@ enterExitNotSaved.title=Map not saved enterExitNotSaved.message=You must save the map first to follow a relative path. +nextExit.text=Next Exit +nextExit.mnemonic=N +nextExit.accel=ctrl shift pressed E + +prevExit.text=Previous Exit +prevExit.mnemonic=P + enterNorthMap.text=Enter North Map enterNorthEastMap.text=Enter Northeast Map Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-10-21 19:03:12 UTC (rev 5575) @@ -120,6 +120,12 @@ enterExitNotSaved.title=Karte nicht gesichert enterExitNotSaved.message=Der Ausgang verwendet einen relativen Dateinamen. Um ihm zu folgen m\xFCssen Sie die Karte vorher sichern. +nextExit.text=N\xE4chster Ausgang +nextExit.mnemonic=N + +prevExit.text=Vorheriger Ausgang +prevExit.mnemonic=O + enterNorthMap.text=Gehe zu Nord-Karte enterNorthEastMap.text=Gehe zu Nordost-Karte Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-10-21 19:03:12 UTC (rev 5575) @@ -119,6 +119,12 @@ #enterExitNotSaved.title= #enterExitNotSaved.message= +#nextExit.text= +#nextExit.mnemonic= + +#prevExit.text= +prevExit.mnemonic= + enterNorthMap.text=Aller Carte Nord enterNorthEastMap.text=Aller Carte Nord-Est Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-10-21 05:50:43 UTC (rev 5574) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-10-21 19:03:12 UTC (rev 5575) @@ -119,6 +119,12 @@ #enterExitNotSaved.title= #enterExitNotSaved.message= +#nextExit.text= +#nextExit.mnemonic= + +#prevExit.text= +#prevExit.mnemonic= + enterNorthMap.text=G\xE5 norr enterNorthEastMap.text=G\xE5 nordost This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-22 05:23:47
|
Revision: 5576 http://gridarta.svn.sourceforge.net/gridarta/?rev=5576&view=rev Author: akirschbaum Date: 2008-10-22 05:23:39 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Remove descriptions for empty packages. Removed Paths: ------------- trunk/crossfire/src/cfeditor/gui/package-info.java trunk/daimonin/src/daieditor/gui/package-info.java Deleted: trunk/crossfire/src/cfeditor/gui/package-info.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/package-info.java 2008-10-21 19:03:12 UTC (rev 5575) +++ trunk/crossfire/src/cfeditor/gui/package-info.java 2008-10-22 05:23:39 UTC (rev 5576) @@ -1,25 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * Graphical User Interface of Gridarta4Crossfire. - * @note Not all classes are here yet, they are currently moving to here. - */ - -package cfeditor.gui; Deleted: trunk/daimonin/src/daieditor/gui/package-info.java =================================================================== --- trunk/daimonin/src/daieditor/gui/package-info.java 2008-10-21 19:03:12 UTC (rev 5575) +++ trunk/daimonin/src/daieditor/gui/package-info.java 2008-10-22 05:23:39 UTC (rev 5576) @@ -1,25 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * Graphical User Interface of Gridarta4Daimonin. - * @note Not all classes are here yet, they are currently moving to here. - */ - -package daieditor.gui; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-22 05:28:37
|
Revision: 5577 http://gridarta.svn.sourceforge.net/gridarta/?rev=5577&view=rev Author: akirschbaum Date: 2008-10-22 05:28:33 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Move MapCursorTest to common code base. Added Paths: ----------- trunk/src/test/net/sf/gridarta/gui/map/MapCursorTest.java Removed Paths: ------------- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java Deleted: trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java =================================================================== --- trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2008-10-22 05:23:39 UTC (rev 5576) +++ trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java 2008-10-22 05:28:33 UTC (rev 5577) @@ -1,416 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package test.daieditor.gui.map; - -import java.awt.Dimension; -import java.awt.Point; -import junit.framework.JUnit4TestAdapter; -import net.sf.gridarta.CommonConstants; -import net.sf.gridarta.Size2D; -import net.sf.gridarta.gui.map.MapCursor; -import net.sf.gridarta.gui.map.MapCursorEvent; -import net.sf.gridarta.gui.map.MapCursorListener; -import net.sf.gridarta.gui.map.MapGrid; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; -import org.junit.AfterClass; -import org.junit.Assert; -import org.junit.Before; -import org.junit.BeforeClass; -import org.junit.Test; - -/** - * Unit test for {@link MapCursor}. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> - */ -public class MapCursorTest implements MapCursorListener { - - @Nullable - private static MapCursor cursor; - - private static final Size2D gridSize = new Size2D(6, 7); - - private static final MapGrid grid = new MapGrid(gridSize); - - private static int changedPosCounter = 0; - - private static int changedModeCounter = 0; - - @BeforeClass - public static void createCursor() { - cursor = new MapCursor(grid); - final MapCursorTest listener = new MapCursorTest(); - cursor.addMapCursorListener(listener); - Assert.assertFalse("MapCursor has to be disabled when created.", cursor.isActive()); - } - - @Before - public static void deactivateCursor() { - cursor.deactivate(); - Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); - changedPosCounter = 0; - changedModeCounter = 0; - } - - @Test - public void setOutside() { - final Point p = new Point(); - for (int i = -2; i < gridSize.getWidth() + 2; i++) { - p.setLocation(i, -1); - Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); - testEvents(0, 0); - Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); - testEvents(0, 0); - p.setLocation(i, gridSize.getHeight()); - Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); - testEvents(0, 0); - Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); - testEvents(0, 0); - } - for (int i = -2; i < gridSize.getHeight() + 2; i++) { - p.setLocation(-1, i); - Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); - testEvents(0, 0); - Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); - testEvents(0, 0); - p.setLocation(gridSize.getWidth(), i); - Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); - testEvents(0, 0); - Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); - testEvents(0, 0); - } - } - - @Test - public void setInside() { - boolean first = true; - final Point p = new Point(); - for (int j = 0; j < gridSize.getHeight(); j++) { - for (int i = 0; i < gridSize.getWidth(); i++) { - p.setLocation(i, j); - Assert.assertTrue("setLocation(" + p + ") should return true", cursor.setLocation(p)); - if (first) { - // Only the first after activation should fire a change mode event - testEvents(1, 1); - first = false; - } else { - testEvents(1, 0); - } - Assert.assertTrue("MapCursor should be active after setLocation(" + p + ")", cursor.isActive()); - testEvents(0, 0); - final Point res = cursor.getLocation(); - testEvents(0, 0); - Assert.assertEquals("getLocation()", p, res); - } - } - } - - @Test - public void setSameLocation() { - final Point p = new Point(-1, -1); - Assert.assertFalse("setLocation(null) should return false", cursor.setLocation(null)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); - testEvents(0, 0); - Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); - testEvents(0, 0); - p.setLocation(3, 4); - Assert.assertTrue("setLocation(" + p + ") should return true", cursor.setLocation(p)); - testEvents(1, 1); - Assert.assertTrue("MapCursor should be active", cursor.isActive()); - testEvents(0, 0); - Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); - testEvents(0, 0); - Assert.assertTrue("MapCursor should be active", cursor.isActive()); - testEvents(0, 0); - p.setLocation(-1, -1); - Assert.assertTrue("setLocation(" + p + ") should return true", cursor.setLocation(p)); - testEvents(1, 1); - Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); - testEvents(0, 0); - } - - @Test - public void setLocationSafe() { - final Point p = new Point(-1, -1); - Assert.assertFalse("setLocationSafe(null) should return false", cursor.setLocationSafe(null)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); - testEvents(0, 0); - Assert.assertFalse("setLocationSafe(" + p + ") should return false", cursor.setLocationSafe(p)); - testEvents(0, 0); - Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); - testEvents(0, 0); - p.setLocation(3, 4); - Assert.assertTrue("setLocationSafe(" + p + ") should return true", cursor.setLocationSafe(p)); - testEvents(1, 1); - Assert.assertTrue("MapCursor should be active", cursor.isActive()); - testEvents(0, 0); - Assert.assertFalse("setLocationSafe(" + p + ") should return false", cursor.setLocationSafe(p)); - testEvents(0, 0); - Assert.assertTrue("MapCursor should be active", cursor.isActive()); - testEvents(0, 0); - p.setLocation(-1, -1); - Assert.assertFalse("setLocationSafe(" + p + ") should return false", cursor.setLocationSafe(p)); - testEvents(0, 0); - Assert.assertTrue("MapCursor should be active", cursor.isActive()); - testEvents(0, 0); - Assert.assertFalse("setLocationSafe(null) should return false", cursor.setLocationSafe(null)); - testEvents(0, 0); - Assert.assertTrue("MapCursor should be active", cursor.isActive()); - testEvents(0, 0); - } - - @Test - public void testIsOnGrid() { - final Point p = new Point(); - for (int j = -2; j < gridSize.getHeight() + 2; j++) { - for (int i = -2; i < gridSize.getWidth() + 2; i++) { - p.setLocation(i, j); - if (i >= 0 && i < gridSize.getWidth() && j >= 0 && j < gridSize.getHeight()) { - Assert.assertTrue(p + " should be on the grid.", cursor.isOnGrid(p)); - } else { - Assert.assertFalse(p + " should not be on the grid.", cursor.isOnGrid(p)); - } - } - } - Assert.assertFalse("Null should not be on the grid.", cursor.isOnGrid(null)); - } - - @Test - public void testGoTo() { - for (int dir = 0; dir < 8; dir++) { - Assert.assertFalse("go(" + dir + ") should return false.", cursor.goTo(dir)); - testEvents(0, 0); - } - final Point pStart = new Point(2, 3); - final Point p = new Point(pStart); - cursor.setLocation(p); - testEvents(1, 1); - for (int dir = 0; dir < 8; dir++) { - Assert.assertTrue("go(" + dir + ") should return true. (Maybe the grid was too small.)", cursor.goTo(dir)); - testEvents(1, 0); - p.x += MapCursor.direction[dir][0]; - p.y += MapCursor.direction[dir][1]; - Assert.assertEquals("Moving cursor.", p, cursor.getLocation()); - } - Assert.assertEquals("Moving in a circle.", pStart, cursor.getLocation()); - } - - @Test - public void dragging() { - Assert.assertFalse("MapCursor should not drag while deactivated.", cursor.isDragging()); - cursor.dragStart(); - testEvents(0, 0); - Assert.assertFalse("MapCursor should not drag while deactivated.", cursor.isDragging()); - Assert.assertNull("Drag offset should be null", cursor.getDragOffset()); - final Point dragStart = new Point(3, 4); - final Point p = new Point(dragStart); - final Dimension offset = new Dimension(0, 0); - cursor.setLocation(dragStart); - testEvents(1, 1); - cursor.dragStart(); - testEvents(0, 1); - Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); - Assert.assertEquals("Wrong offset", offset, cursor.getDragOffset()); - cursor.deactivate(); - testEvents(1, 1); - Assert.assertFalse("MapCursor should not drag while deactivated.", cursor.isDragging()); - Assert.assertNull("Drag offset should be null", cursor.getDragOffset()); - cursor.setLocation(dragStart); - testEvents(1, 1); - cursor.dragStart(); - testEvents(0, 1); - Assert.assertEquals("Wrong offset", offset, cursor.getDragOffset()); - dragTo(CommonConstants.WEST, dragStart, p, offset); - dragTo(CommonConstants.EAST, dragStart, p, offset); - dragTo(CommonConstants.EAST, dragStart, p, offset); - dragTo(CommonConstants.NORTH_WEST, dragStart, p, offset); - dragTo(CommonConstants.SOUTH, dragStart, p, offset); - dragTo(CommonConstants.SOUTH, dragStart, p, offset); - dragTo(CommonConstants.WEST, dragStart, p, offset); - dragTo(CommonConstants.NORTH_EAST, dragStart, p, offset); - } - - private static void dragTo(final int dir, final Point start, final Point p, final Dimension offset) { - final Point d = new Point(MapCursor.direction[dir][0], MapCursor.direction[dir][1]); - p.x += d.x; - p.y += d.y; - Assert.assertTrue("dragTo(" + p + ")", cursor.dragTo(p)); - testEvents(1, 0); - Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); - Assert.assertEquals("Wrong position", p, cursor.getLocation()); - offset.width = p.x - start.x; - offset.height = p.y - start.y; - Assert.assertEquals("Wrong offset", offset, cursor.getDragOffset()); - assertPreSelection(start, p); - } - - private static void assertPreSelection(final Point start, final Point end) { - final int minX = Math.min(start.x, end.x); - final int maxX = Math.max(start.x, end.x); - final int minY = Math.min(start.y, end.y); - final int maxY = Math.max(start.y, end.y); - final int height = gridSize.getHeight(); - final int width = gridSize.getWidth(); - for (int j = 0; j < height; j++) { - for (int i = 0; i < width; i++) { - if (i < minX || i > maxX || j < minY || j > maxY) { - //Not preselected - Assert.assertFalse("Preselection", (grid.getFlags(i, j) & MapGrid.GRID_FLAG_SELECTING) > 0); - } else { - //Preselected - Assert.assertTrue("Preselection", (grid.getFlags(i, j) & MapGrid.GRID_FLAG_SELECTING) > 0); - } - } - - } - } - - private static void assertSelection(final Point start, final Point end, final boolean flag) { - final int minX = Math.min(start.x, end.x); - final int maxX = Math.max(start.x, end.x); - final int minY = Math.min(start.y, end.y); - final int maxY = Math.max(start.y, end.y); - for (int j = minY; j <= maxY; j++) { - for (int i = minX; i <= maxX; i++) { - Assert.assertSame("Selection", flag, (grid.getFlags(i, j) & MapGrid.GRID_FLAG_SELECTION) > 0); - } - - } - } - - @Test - public void selecting() { - final Point start = new Point(2, 3); - final Point end = new Point(4, 5); - final Point gridMaxIndex = new Point(gridSize.getWidth() - 1, gridSize.getHeight() - 1); - cursor.dragRelease(); - testEvents(0, 0); - cursor.setLocation(start); - testEvents(1, 1); - cursor.dragStart(); - testEvents(0, 1); - cursor.dragTo(end); - testEvents(1, 0); - Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); - cursor.dragRelease(); - testEvents(0, 1); - Assert.assertFalse("MapCursor should not be in drag mode.", cursor.isDragging()); - cursor.setLocation(start); - testEvents(1, 0); - cursor.dragStart(); - testEvents(0, 1); - cursor.dragTo(end); - testEvents(1, 0); - Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); - cursor.setLocation(null); - testEvents(1, 1); - Assert.assertFalse("MapCursor should not be in drag mode.", cursor.isDragging()); - cursor.setLocation(start); - testEvents(1, 1); - cursor.dragStart(); - testEvents(0, 1); - cursor.dragTo(end); - testEvents(1, 0); - Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); - assertSelection(new Point(0, 0), gridMaxIndex, false); - cursor.dragSelect(MapGrid.SelectionMode.ADD); - testEvents(0, 1); - assertSelection(start, end, true); - //Check if nothing is preselected - assertPreSelection(new Point(-1, -1), new Point(-1, -1)); - cursor.setLocation(start); - testEvents(1, 0); - cursor.dragStart(); - testEvents(0, 1); - cursor.dragTo(end); - testEvents(1, 0); - cursor.dragSelect(MapGrid.SelectionMode.SUB); - testEvents(0, 1); - assertSelection(new Point(0, 0), gridMaxIndex, false); - cursor.setLocation(start); - testEvents(1, 0); - cursor.dragStart(); - testEvents(0, 1); - cursor.dragTo(end); - testEvents(1, 0); - cursor.dragSelect(MapGrid.SelectionMode.FLIP); - testEvents(0, 1); - assertSelection(start, end, true); - start.setLocation(3, 4); - end.setLocation(5, 1); - cursor.setLocation(start); - testEvents(1, 0); - cursor.dragStart(); - testEvents(0, 1); - cursor.dragTo(end); - testEvents(1, 0); - cursor.dragSelect(MapGrid.SelectionMode.FLIP); - testEvents(0, 1); - assertSelection(start, new Point(4, 4), false); - assertSelection(new Point(3, 2), end, true); - assertSelection(new Point(5, 3), new Point(5, 4), true); - cursor.deactivate(); - testEvents(1, 1); - assertSelection(new Point(0, 0), gridMaxIndex, false); - } - - @AfterClass - public static void deleteCursor() { - cursor = null; - } - - public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { - changedPosCounter++; - } - - public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { - changedModeCounter++; - } - - /** - * Test if number of events fired is correct. - * @param nPos number of position events. - * @param nMode number of mode events. - */ - private static void testEvents(final int nPos, final int nMode) { - Assert.assertEquals("Position change event", nPos, changedPosCounter); - changedPosCounter = 0; - Assert.assertEquals("Mode change event", nMode, changedModeCounter); - changedModeCounter = 0; - } - - public static junit.framework.Test suite() { - return new JUnit4TestAdapter(MapCursorTest.class); - } - -} // class MapCursorTest Copied: trunk/src/test/net/sf/gridarta/gui/map/MapCursorTest.java (from rev 5573, trunk/daimonin/src/test/daieditor/gui/map/MapCursorTest.java) =================================================================== --- trunk/src/test/net/sf/gridarta/gui/map/MapCursorTest.java (rev 0) +++ trunk/src/test/net/sf/gridarta/gui/map/MapCursorTest.java 2008-10-22 05:28:33 UTC (rev 5577) @@ -0,0 +1,416 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package test.net.sf.gridarta.gui.map; + +import java.awt.Dimension; +import java.awt.Point; +import junit.framework.JUnit4TestAdapter; +import net.sf.gridarta.CommonConstants; +import net.sf.gridarta.Size2D; +import net.sf.gridarta.gui.map.MapCursor; +import net.sf.gridarta.gui.map.MapCursorEvent; +import net.sf.gridarta.gui.map.MapCursorListener; +import net.sf.gridarta.gui.map.MapGrid; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; +import org.junit.AfterClass; +import org.junit.Assert; +import org.junit.Before; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * Unit test for {@link MapCursor}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + * @author <a href="mailto:dlv...@gm...">Daniel Viegas</a> + */ +public class MapCursorTest implements MapCursorListener { + + @Nullable + private static MapCursor cursor; + + private static final Size2D gridSize = new Size2D(6, 7); + + private static final MapGrid grid = new MapGrid(gridSize); + + private static int changedPosCounter = 0; + + private static int changedModeCounter = 0; + + @BeforeClass + public static void createCursor() { + cursor = new MapCursor(grid); + final MapCursorTest listener = new MapCursorTest(); + cursor.addMapCursorListener(listener); + Assert.assertFalse("MapCursor has to be disabled when created.", cursor.isActive()); + } + + @Before + public static void deactivateCursor() { + cursor.deactivate(); + Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); + changedPosCounter = 0; + changedModeCounter = 0; + } + + @Test + public void setOutside() { + final Point p = new Point(); + for (int i = -2; i < gridSize.getWidth() + 2; i++) { + p.setLocation(i, -1); + Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); + testEvents(0, 0); + Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); + testEvents(0, 0); + p.setLocation(i, gridSize.getHeight()); + Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); + testEvents(0, 0); + Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); + testEvents(0, 0); + } + for (int i = -2; i < gridSize.getHeight() + 2; i++) { + p.setLocation(-1, i); + Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); + testEvents(0, 0); + Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); + testEvents(0, 0); + p.setLocation(gridSize.getWidth(), i); + Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be disabled after setLocation(" + p + ")", cursor.isActive()); + testEvents(0, 0); + Assert.assertNull("getLocation() should return null after setLocation(" + p + ")", cursor.getLocation()); + testEvents(0, 0); + } + } + + @Test + public void setInside() { + boolean first = true; + final Point p = new Point(); + for (int j = 0; j < gridSize.getHeight(); j++) { + for (int i = 0; i < gridSize.getWidth(); i++) { + p.setLocation(i, j); + Assert.assertTrue("setLocation(" + p + ") should return true", cursor.setLocation(p)); + if (first) { + // Only the first after activation should fire a change mode event + testEvents(1, 1); + first = false; + } else { + testEvents(1, 0); + } + Assert.assertTrue("MapCursor should be active after setLocation(" + p + ")", cursor.isActive()); + testEvents(0, 0); + final Point res = cursor.getLocation(); + testEvents(0, 0); + Assert.assertEquals("getLocation()", p, res); + } + } + } + + @Test + public void setSameLocation() { + final Point p = new Point(-1, -1); + Assert.assertFalse("setLocation(null) should return false", cursor.setLocation(null)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); + testEvents(0, 0); + Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); + testEvents(0, 0); + p.setLocation(3, 4); + Assert.assertTrue("setLocation(" + p + ") should return true", cursor.setLocation(p)); + testEvents(1, 1); + Assert.assertTrue("MapCursor should be active", cursor.isActive()); + testEvents(0, 0); + Assert.assertFalse("setLocation(" + p + ") should return false", cursor.setLocation(p)); + testEvents(0, 0); + Assert.assertTrue("MapCursor should be active", cursor.isActive()); + testEvents(0, 0); + p.setLocation(-1, -1); + Assert.assertTrue("setLocation(" + p + ") should return true", cursor.setLocation(p)); + testEvents(1, 1); + Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); + testEvents(0, 0); + } + + @Test + public void setLocationSafe() { + final Point p = new Point(-1, -1); + Assert.assertFalse("setLocationSafe(null) should return false", cursor.setLocationSafe(null)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); + testEvents(0, 0); + Assert.assertFalse("setLocationSafe(" + p + ") should return false", cursor.setLocationSafe(p)); + testEvents(0, 0); + Assert.assertFalse("MapCursor should be deactivated", cursor.isActive()); + testEvents(0, 0); + p.setLocation(3, 4); + Assert.assertTrue("setLocationSafe(" + p + ") should return true", cursor.setLocationSafe(p)); + testEvents(1, 1); + Assert.assertTrue("MapCursor should be active", cursor.isActive()); + testEvents(0, 0); + Assert.assertFalse("setLocationSafe(" + p + ") should return false", cursor.setLocationSafe(p)); + testEvents(0, 0); + Assert.assertTrue("MapCursor should be active", cursor.isActive()); + testEvents(0, 0); + p.setLocation(-1, -1); + Assert.assertFalse("setLocationSafe(" + p + ") should return false", cursor.setLocationSafe(p)); + testEvents(0, 0); + Assert.assertTrue("MapCursor should be active", cursor.isActive()); + testEvents(0, 0); + Assert.assertFalse("setLocationSafe(null) should return false", cursor.setLocationSafe(null)); + testEvents(0, 0); + Assert.assertTrue("MapCursor should be active", cursor.isActive()); + testEvents(0, 0); + } + + @Test + public void testIsOnGrid() { + final Point p = new Point(); + for (int j = -2; j < gridSize.getHeight() + 2; j++) { + for (int i = -2; i < gridSize.getWidth() + 2; i++) { + p.setLocation(i, j); + if (i >= 0 && i < gridSize.getWidth() && j >= 0 && j < gridSize.getHeight()) { + Assert.assertTrue(p + " should be on the grid.", cursor.isOnGrid(p)); + } else { + Assert.assertFalse(p + " should not be on the grid.", cursor.isOnGrid(p)); + } + } + } + Assert.assertFalse("Null should not be on the grid.", cursor.isOnGrid(null)); + } + + @Test + public void testGoTo() { + for (int dir = 0; dir < 8; dir++) { + Assert.assertFalse("go(" + dir + ") should return false.", cursor.goTo(dir)); + testEvents(0, 0); + } + final Point pStart = new Point(2, 3); + final Point p = new Point(pStart); + cursor.setLocation(p); + testEvents(1, 1); + for (int dir = 0; dir < 8; dir++) { + Assert.assertTrue("go(" + dir + ") should return true. (Maybe the grid was too small.)", cursor.goTo(dir)); + testEvents(1, 0); + p.x += MapCursor.direction[dir][0]; + p.y += MapCursor.direction[dir][1]; + Assert.assertEquals("Moving cursor.", p, cursor.getLocation()); + } + Assert.assertEquals("Moving in a circle.", pStart, cursor.getLocation()); + } + + @Test + public void dragging() { + Assert.assertFalse("MapCursor should not drag while deactivated.", cursor.isDragging()); + cursor.dragStart(); + testEvents(0, 0); + Assert.assertFalse("MapCursor should not drag while deactivated.", cursor.isDragging()); + Assert.assertNull("Drag offset should be null", cursor.getDragOffset()); + final Point dragStart = new Point(3, 4); + final Point p = new Point(dragStart); + final Dimension offset = new Dimension(0, 0); + cursor.setLocation(dragStart); + testEvents(1, 1); + cursor.dragStart(); + testEvents(0, 1); + Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); + Assert.assertEquals("Wrong offset", offset, cursor.getDragOffset()); + cursor.deactivate(); + testEvents(1, 1); + Assert.assertFalse("MapCursor should not drag while deactivated.", cursor.isDragging()); + Assert.assertNull("Drag offset should be null", cursor.getDragOffset()); + cursor.setLocation(dragStart); + testEvents(1, 1); + cursor.dragStart(); + testEvents(0, 1); + Assert.assertEquals("Wrong offset", offset, cursor.getDragOffset()); + dragTo(CommonConstants.WEST, dragStart, p, offset); + dragTo(CommonConstants.EAST, dragStart, p, offset); + dragTo(CommonConstants.EAST, dragStart, p, offset); + dragTo(CommonConstants.NORTH_WEST, dragStart, p, offset); + dragTo(CommonConstants.SOUTH, dragStart, p, offset); + dragTo(CommonConstants.SOUTH, dragStart, p, offset); + dragTo(CommonConstants.WEST, dragStart, p, offset); + dragTo(CommonConstants.NORTH_EAST, dragStart, p, offset); + } + + private static void dragTo(final int dir, final Point start, final Point p, final Dimension offset) { + final Point d = new Point(MapCursor.direction[dir][0], MapCursor.direction[dir][1]); + p.x += d.x; + p.y += d.y; + Assert.assertTrue("dragTo(" + p + ")", cursor.dragTo(p)); + testEvents(1, 0); + Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); + Assert.assertEquals("Wrong position", p, cursor.getLocation()); + offset.width = p.x - start.x; + offset.height = p.y - start.y; + Assert.assertEquals("Wrong offset", offset, cursor.getDragOffset()); + assertPreSelection(start, p); + } + + private static void assertPreSelection(final Point start, final Point end) { + final int minX = Math.min(start.x, end.x); + final int maxX = Math.max(start.x, end.x); + final int minY = Math.min(start.y, end.y); + final int maxY = Math.max(start.y, end.y); + final int height = gridSize.getHeight(); + final int width = gridSize.getWidth(); + for (int j = 0; j < height; j++) { + for (int i = 0; i < width; i++) { + if (i < minX || i > maxX || j < minY || j > maxY) { + //Not preselected + Assert.assertFalse("Preselection", (grid.getFlags(i, j) & MapGrid.GRID_FLAG_SELECTING) > 0); + } else { + //Preselected + Assert.assertTrue("Preselection", (grid.getFlags(i, j) & MapGrid.GRID_FLAG_SELECTING) > 0); + } + } + + } + } + + private static void assertSelection(final Point start, final Point end, final boolean flag) { + final int minX = Math.min(start.x, end.x); + final int maxX = Math.max(start.x, end.x); + final int minY = Math.min(start.y, end.y); + final int maxY = Math.max(start.y, end.y); + for (int j = minY; j <= maxY; j++) { + for (int i = minX; i <= maxX; i++) { + Assert.assertSame("Selection", flag, (grid.getFlags(i, j) & MapGrid.GRID_FLAG_SELECTION) > 0); + } + + } + } + + @Test + public void selecting() { + final Point start = new Point(2, 3); + final Point end = new Point(4, 5); + final Point gridMaxIndex = new Point(gridSize.getWidth() - 1, gridSize.getHeight() - 1); + cursor.dragRelease(); + testEvents(0, 0); + cursor.setLocation(start); + testEvents(1, 1); + cursor.dragStart(); + testEvents(0, 1); + cursor.dragTo(end); + testEvents(1, 0); + Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); + cursor.dragRelease(); + testEvents(0, 1); + Assert.assertFalse("MapCursor should not be in drag mode.", cursor.isDragging()); + cursor.setLocation(start); + testEvents(1, 0); + cursor.dragStart(); + testEvents(0, 1); + cursor.dragTo(end); + testEvents(1, 0); + Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); + cursor.setLocation(null); + testEvents(1, 1); + Assert.assertFalse("MapCursor should not be in drag mode.", cursor.isDragging()); + cursor.setLocation(start); + testEvents(1, 1); + cursor.dragStart(); + testEvents(0, 1); + cursor.dragTo(end); + testEvents(1, 0); + Assert.assertTrue("MapCursor should be in drag mode.", cursor.isDragging()); + assertSelection(new Point(0, 0), gridMaxIndex, false); + cursor.dragSelect(MapGrid.SelectionMode.ADD); + testEvents(0, 1); + assertSelection(start, end, true); + //Check if nothing is preselected + assertPreSelection(new Point(-1, -1), new Point(-1, -1)); + cursor.setLocation(start); + testEvents(1, 0); + cursor.dragStart(); + testEvents(0, 1); + cursor.dragTo(end); + testEvents(1, 0); + cursor.dragSelect(MapGrid.SelectionMode.SUB); + testEvents(0, 1); + assertSelection(new Point(0, 0), gridMaxIndex, false); + cursor.setLocation(start); + testEvents(1, 0); + cursor.dragStart(); + testEvents(0, 1); + cursor.dragTo(end); + testEvents(1, 0); + cursor.dragSelect(MapGrid.SelectionMode.FLIP); + testEvents(0, 1); + assertSelection(start, end, true); + start.setLocation(3, 4); + end.setLocation(5, 1); + cursor.setLocation(start); + testEvents(1, 0); + cursor.dragStart(); + testEvents(0, 1); + cursor.dragTo(end); + testEvents(1, 0); + cursor.dragSelect(MapGrid.SelectionMode.FLIP); + testEvents(0, 1); + assertSelection(start, new Point(4, 4), false); + assertSelection(new Point(3, 2), end, true); + assertSelection(new Point(5, 3), new Point(5, 4), true); + cursor.deactivate(); + testEvents(1, 1); + assertSelection(new Point(0, 0), gridMaxIndex, false); + } + + @AfterClass + public static void deleteCursor() { + cursor = null; + } + + public void mapCursorChangedPos(@NotNull final MapCursorEvent e) { + changedPosCounter++; + } + + public void mapCursorChangedMode(@NotNull final MapCursorEvent e) { + changedModeCounter++; + } + + /** + * Test if number of events fired is correct. + * @param nPos number of position events. + * @param nMode number of mode events. + */ + private static void testEvents(final int nPos, final int nMode) { + Assert.assertEquals("Position change event", nPos, changedPosCounter); + changedPosCounter = 0; + Assert.assertEquals("Mode change event", nMode, changedModeCounter); + changedModeCounter = 0; + } + + public static junit.framework.Test suite() { + return new JUnit4TestAdapter(MapCursorTest.class); + } + +} // class MapCursorTest Property changes on: trunk/src/test/net/sf/gridarta/gui/map/MapCursorTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-22 05:33:24
|
Revision: 5579 http://gridarta.svn.sourceforge.net/gridarta/?rev=5579&view=rev Author: akirschbaum Date: 2008-10-22 05:33:18 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Move PathManagerTest to common code base. Added Paths: ----------- trunk/src/test/net/sf/gridarta/io/ trunk/src/test/net/sf/gridarta/io/PathManagerTest.java trunk/src/test/net/sf/gridarta/io/package-info.java Removed Paths: ------------- trunk/daimonin/src/test/daieditor/io/PathManagerTest.java trunk/daimonin/src/test/daieditor/io/package-info.java Deleted: trunk/daimonin/src/test/daieditor/io/PathManagerTest.java =================================================================== --- trunk/daimonin/src/test/daieditor/io/PathManagerTest.java 2008-10-22 05:29:47 UTC (rev 5578) +++ trunk/daimonin/src/test/daieditor/io/PathManagerTest.java 2008-10-22 05:33:18 UTC (rev 5579) @@ -1,74 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package test.daieditor.io; - -import net.sf.gridarta.io.PathManager; -import org.junit.Assert; -import org.junit.Test; - -/** - * Test for {@link PathManager}. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class PathManagerTest { - - /** Test case for {@link PathManager#path(String)}. */ - @Test - public void testPath() { - Assert.assertEquals("Expecting trailing slash from directories being removed.", "/foo", PathManager.path("/foo/")); - Assert.assertEquals("Expecting file: URIs being converted to URIs without scheme.", "/foo", PathManager.path("file:/foo/")); - Assert.assertEquals("Expecting multiple // characters to be collapsed.", "/foo/bar", PathManager.path("//foo///bar")); - } - - /** Test case for {@link PathManager#absoluteToRelative(String, String)}. */ - @Test - public void testAbsoluteToRelavive() { - Assert.assertEquals("../stoneglow/stoneglow_0000", PathManager.absoluteToRelative("/relic/castle_0000", "/stoneglow/stoneglow_0000")); - Assert.assertEquals("../stoneglow/stoneglow_0000", PathManager.absoluteToRelative("/relic/", "/stoneglow/stoneglow_0000")); - } - - /** Test case for {@link PathManager#absoluteToRelative(String, String)}. */ - @Test - public void testRelativeToAbsolute() { - Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/castle_0000", "../stoneglow/stoneglow_0000")); - Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/", "../stoneglow/stoneglow_0000")); - Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/castle_0000", "/stoneglow/stoneglow_0000")); - Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/", "/stoneglow/stoneglow_0000")); - } - - /** Test case for {@link PathManager#isRelative(String)}. */ - @Test - public void testIsRelative() { - Assert.assertTrue(PathManager.isRelative("../stoneglow/stoneglow_0000")); - Assert.assertTrue(PathManager.isRelative("stoneglow/stoneglow_0000")); - Assert.assertFalse(PathManager.isRelative("/stoneglow/stoneglow_0000")); - Assert.assertTrue(PathManager.isRelative("")); - } - - /** Test case for {@link PathManager#isAbsolute(String)}. */ - @Test - public void testIsAbsolute() { - Assert.assertFalse(PathManager.isAbsolute("../stoneglow/stoneglow_0000")); - Assert.assertFalse(PathManager.isAbsolute("stoneglow/stoneglow_0000")); - Assert.assertTrue(PathManager.isAbsolute("/stoneglow/stoneglow_0000")); - Assert.assertFalse(PathManager.isAbsolute("")); - } - -} // class PathManagerTest \ No newline at end of file Deleted: trunk/daimonin/src/test/daieditor/io/package-info.java =================================================================== --- trunk/daimonin/src/test/daieditor/io/package-info.java 2008-10-22 05:29:47 UTC (rev 5578) +++ trunk/daimonin/src/test/daieditor/io/package-info.java 2008-10-22 05:33:18 UTC (rev 5579) @@ -1,24 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * Unit tests for classes from the {@link daieditor.io} package. - */ - -package test.daieditor.io; Copied: trunk/src/test/net/sf/gridarta/io/PathManagerTest.java (from rev 5577, trunk/daimonin/src/test/daieditor/io/PathManagerTest.java) =================================================================== --- trunk/src/test/net/sf/gridarta/io/PathManagerTest.java (rev 0) +++ trunk/src/test/net/sf/gridarta/io/PathManagerTest.java 2008-10-22 05:33:18 UTC (rev 5579) @@ -0,0 +1,74 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package test.net.sf.gridarta.io; + +import net.sf.gridarta.io.PathManager; +import org.junit.Assert; +import org.junit.Test; + +/** + * Test for {@link PathManager}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class PathManagerTest { + + /** Test case for {@link PathManager#path(String)}. */ + @Test + public void testPath() { + Assert.assertEquals("Expecting trailing slash from directories being removed.", "/foo", PathManager.path("/foo/")); + Assert.assertEquals("Expecting file: URIs being converted to URIs without scheme.", "/foo", PathManager.path("file:/foo/")); + Assert.assertEquals("Expecting multiple // characters to be collapsed.", "/foo/bar", PathManager.path("//foo///bar")); + } + + /** Test case for {@link PathManager#absoluteToRelative(String, String)}. */ + @Test + public void testAbsoluteToRelavive() { + Assert.assertEquals("../stoneglow/stoneglow_0000", PathManager.absoluteToRelative("/relic/castle_0000", "/stoneglow/stoneglow_0000")); + Assert.assertEquals("../stoneglow/stoneglow_0000", PathManager.absoluteToRelative("/relic/", "/stoneglow/stoneglow_0000")); + } + + /** Test case for {@link PathManager#absoluteToRelative(String, String)}. */ + @Test + public void testRelativeToAbsolute() { + Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/castle_0000", "../stoneglow/stoneglow_0000")); + Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/", "../stoneglow/stoneglow_0000")); + Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/castle_0000", "/stoneglow/stoneglow_0000")); + Assert.assertEquals("/stoneglow/stoneglow_0000", PathManager.relativeToAbsolute("/relic/", "/stoneglow/stoneglow_0000")); + } + + /** Test case for {@link PathManager#isRelative(String)}. */ + @Test + public void testIsRelative() { + Assert.assertTrue(PathManager.isRelative("../stoneglow/stoneglow_0000")); + Assert.assertTrue(PathManager.isRelative("stoneglow/stoneglow_0000")); + Assert.assertFalse(PathManager.isRelative("/stoneglow/stoneglow_0000")); + Assert.assertTrue(PathManager.isRelative("")); + } + + /** Test case for {@link PathManager#isAbsolute(String)}. */ + @Test + public void testIsAbsolute() { + Assert.assertFalse(PathManager.isAbsolute("../stoneglow/stoneglow_0000")); + Assert.assertFalse(PathManager.isAbsolute("stoneglow/stoneglow_0000")); + Assert.assertTrue(PathManager.isAbsolute("/stoneglow/stoneglow_0000")); + Assert.assertFalse(PathManager.isAbsolute("")); + } + +} // class PathManagerTest \ No newline at end of file Property changes on: trunk/src/test/net/sf/gridarta/io/PathManagerTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/src/test/net/sf/gridarta/io/package-info.java (from rev 5577, trunk/daimonin/src/test/daieditor/io/package-info.java) =================================================================== --- trunk/src/test/net/sf/gridarta/io/package-info.java (rev 0) +++ trunk/src/test/net/sf/gridarta/io/package-info.java 2008-10-22 05:33:18 UTC (rev 5579) @@ -0,0 +1,24 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * Unit tests for classes from the {@link net.sf.gridarta.io} package. + */ + +package test.net.sf.gridarta.io; Property changes on: trunk/src/test/net/sf/gridarta/io/package-info.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-22 05:36:14
|
Revision: 5580 http://gridarta.svn.sourceforge.net/gridarta/?rev=5580&view=rev Author: akirschbaum Date: 2008-10-22 05:36:11 +0000 (Wed, 22 Oct 2008) Log Message: ----------- Move AbstractValidatorTest to common code base. Added Paths: ----------- trunk/src/test/net/sf/gridarta/map/validation/ trunk/src/test/net/sf/gridarta/map/validation/AbstractValidatorTest.java trunk/src/test/net/sf/gridarta/map/validation/package-info.java Removed Paths: ------------- trunk/daimonin/src/test/daieditor/map/validation/AbstractValidatorTest.java trunk/daimonin/src/test/daieditor/map/validation/package-info.java Deleted: trunk/daimonin/src/test/daieditor/map/validation/AbstractValidatorTest.java =================================================================== --- trunk/daimonin/src/test/daieditor/map/validation/AbstractValidatorTest.java 2008-10-22 05:33:18 UTC (rev 5579) +++ trunk/daimonin/src/test/daieditor/map/validation/AbstractValidatorTest.java 2008-10-22 05:36:11 UTC (rev 5580) @@ -1,59 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package test.daieditor.map.validation; - -import junit.framework.TestCase; -import net.sf.gridarta.map.validation.AbstractValidator; -import org.jetbrains.annotations.Nullable; - -/** - * Test for {@link AbstractValidator}. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class AbstractValidatorTest extends TestCase { - - /** Object Under Test: A AbstractValidator. */ - @Nullable - private AbstractValidator oUT; - - /** {@inheritDoc} */ - @Override - public void setUp() throws Exception { - super.setUp(); - oUT = new AbstractValidator("") { - }; - } - - /** {@inheritDoc} */ - @Override - public void tearDown() throws Exception { - super.tearDown(); - oUT = null; - } - - /** Test case for {@link AbstractValidator#setEnabled(boolean)}. */ - public void testEnabled() { - oUT.setEnabled(false); - assertFalse(oUT.isEnabled()); - oUT.setEnabled(true); - assertTrue(oUT.isEnabled()); - } - -} // class AbstractValidatorTest Deleted: trunk/daimonin/src/test/daieditor/map/validation/package-info.java =================================================================== --- trunk/daimonin/src/test/daieditor/map/validation/package-info.java 2008-10-22 05:33:18 UTC (rev 5579) +++ trunk/daimonin/src/test/daieditor/map/validation/package-info.java 2008-10-22 05:36:11 UTC (rev 5580) @@ -1,24 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/** - * Unit tests for classes from the {@link daieditor.map.validation} package. - */ - -package test.daieditor.map.validation; Copied: trunk/src/test/net/sf/gridarta/map/validation/AbstractValidatorTest.java (from rev 5577, trunk/daimonin/src/test/daieditor/map/validation/AbstractValidatorTest.java) =================================================================== --- trunk/src/test/net/sf/gridarta/map/validation/AbstractValidatorTest.java (rev 0) +++ trunk/src/test/net/sf/gridarta/map/validation/AbstractValidatorTest.java 2008-10-22 05:36:11 UTC (rev 5580) @@ -0,0 +1,59 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package test.net.sf.gridarta.map.validation; + +import junit.framework.TestCase; +import net.sf.gridarta.map.validation.AbstractValidator; +import org.jetbrains.annotations.Nullable; + +/** + * Test for {@link AbstractValidator}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class AbstractValidatorTest extends TestCase { + + /** Object Under Test: A AbstractValidator. */ + @Nullable + private AbstractValidator oUT; + + /** {@inheritDoc} */ + @Override + public void setUp() throws Exception { + super.setUp(); + oUT = new AbstractValidator("") { + }; + } + + /** {@inheritDoc} */ + @Override + public void tearDown() throws Exception { + super.tearDown(); + oUT = null; + } + + /** Test case for {@link AbstractValidator#setEnabled(boolean)}. */ + public void testEnabled() { + oUT.setEnabled(false); + assertFalse(oUT.isEnabled()); + oUT.setEnabled(true); + assertTrue(oUT.isEnabled()); + } + +} // class AbstractValidatorTest Property changes on: trunk/src/test/net/sf/gridarta/map/validation/AbstractValidatorTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Copied: trunk/src/test/net/sf/gridarta/map/validation/package-info.java (from rev 5577, trunk/daimonin/src/test/daieditor/map/validation/package-info.java) =================================================================== --- trunk/src/test/net/sf/gridarta/map/validation/package-info.java (rev 0) +++ trunk/src/test/net/sf/gridarta/map/validation/package-info.java 2008-10-22 05:36:11 UTC (rev 5580) @@ -0,0 +1,24 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +/** + * Unit tests for classes from the {@link net.sf.gridarta.map.validation} package. + */ + +package test.net.sf.gridarta.map.validation; Property changes on: trunk/src/test/net/sf/gridarta/map/validation/package-info.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:mergeinfo + Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-23 05:41:19
|
Revision: 5583 http://gridarta.svn.sourceforge.net/gridarta/?rev=5583&view=rev Author: akirschbaum Date: 2008-10-23 05:41:15 +0000 (Thu, 23 Oct 2008) Log Message: ----------- Make "grid visible" affect all maps. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gui/map/CMapViewBasic.java trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java trunk/crossfire/src/cfeditor/gui/map/DefaultMapViewFactory.java trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java trunk/crossfire/src/cfeditor/gui/map/PickmapRenderer.java trunk/crossfire/src/cfeditor/gui/map/SimpleLevelRenderer.java trunk/daimonin/ChangeLog trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gui/map/CMapViewBasic.java trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/gui/map/DefaultMapViewFactory.java trunk/daimonin/src/daieditor/gui/map/MapRenderer.java trunk/daimonin/src/daieditor/gui/map/PickmapRenderer.java trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/gui/map/AbstractLevelRenderer.java trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java trunk/src/app/net/sf/gridarta/gui/map/LevelRenderer.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gui/map/MapViewSettings.java trunk/src/app/net/sf/gridarta/gui/map/event/MapViewSettingsEvent.java trunk/src/app/net/sf/gridarta/gui/map/event/MapViewSettingsListener.java Removed Paths: ------------- trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/ChangeLog 2008-10-23 05:41:15 UTC (rev 5583) @@ -1,3 +1,7 @@ +2008-10-23 Andreas Kirschbaum + + * Make "grid visible" affect all maps. + 2008-10-21 Andreas Kirschbaum * Add Map|Next Exit and Map|Previous Exit: select next/previous Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -75,6 +75,7 @@ import net.sf.gridarta.gui.map.MapActions; import net.sf.gridarta.gui.map.MapPropertiesDialogFactory; import net.sf.gridarta.gui.map.MapViewFactory; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.prefs.AppPrefs; @@ -174,8 +175,8 @@ /** {@inheritDoc} */ @NotNull @Override - protected MapViewFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapViewFactory(@NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final AbstractMainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { - return new DefaultMapViewFactory(faceObjects, selectedSquareView, mainControl, mainView, editTypes, mapImageCache, toolPalette, filterControl); + protected MapViewFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapViewFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final AbstractMainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { + return new DefaultMapViewFactory(mapViewSettings, faceObjects, selectedSquareView, mainControl, mainView, editTypes, mapImageCache, toolPalette, filterControl); } /** {@inheritDoc} */ @@ -259,7 +260,7 @@ /** {@inheritDoc} */ @NotNull @Override - protected MapActions init1(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final MapArchObjectParserFactory<MapArchObject> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final MapViewManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapViewManager, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final GameObjectMatcher exitMatcher) { + protected MapActions init1(@NotNull final MapViewSettings mapViewSettings, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final MapArchObjectParserFactory<MapArchObject> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final MapViewManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapViewManager, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final GameObjectMatcher exitMatcher) { archetypeTypeSet.getListTable().put("event", scriptArchUtils.getEventTypes()); final int[] directionMap = new int[] { CommonConstants.NORTH, @@ -272,7 +273,7 @@ CommonConstants.NORTH_WEST, }; final MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> mapPropertiesDialogFactory = new DefaultMapPropertiesDialogFactory(mapManager, mapArchObjectParserFactory, mapArchObjectFactory, globalSettings); - return new DefaultMapActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, getMainView(), getMainView(), globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView, directionMap, true, mapPropertiesDialogFactory); + return new DefaultMapActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, getMainView(), getMainView(), globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView, directionMap, true, mapPropertiesDialogFactory, mapViewSettings); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/cfeditor/gui/map/CMapViewBasic.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/CMapViewBasic.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/src/cfeditor/gui/map/CMapViewBasic.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -28,6 +28,7 @@ import net.sf.gridarta.gui.map.MapUserListener; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.map.MapModel; @@ -92,6 +93,7 @@ /** * Constructs a level view. + * @param mapViewSettings the map view settings instance to use * @param filterControl the filter to use * @param editTypes the edit types instance * @param mapModel the map model to render @@ -103,10 +105,10 @@ * @param yScrollDistance the y distance when scrolling * @param selectedSquareView the selected square view */ - public CMapViewBasic(@NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, final boolean isPickmap, @Nullable final Point initial, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, final int xScrollDistance, final int yScrollDistance, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView) { + public CMapViewBasic(@NotNull final MapViewSettings mapViewSettings, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, final boolean isPickmap, @Nullable final Point initial, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, final int xScrollDistance, final int yScrollDistance, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView) { super(mapModel, isPickmap, xScrollDistance, yScrollDistance, selectedSquareView); - renderer = isPickmap ? new PickmapRenderer(mapModel, getMapGrid()) : new MapRenderer(filterControl, editTypes, mapModel, getMapGrid()); + renderer = isPickmap ? new PickmapRenderer(mapViewSettings, mapModel, getMapGrid()) : new MapRenderer(mapViewSettings, filterControl, editTypes, mapModel, getMapGrid()); setViewportView(renderer); if (initial != null) { getViewport().setViewPosition(initial); Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultLevelRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -37,6 +37,9 @@ import net.sf.gridarta.gui.map.MapGrid; import net.sf.gridarta.gui.map.MapGridEvent; import net.sf.gridarta.gui.map.MapGridListener; +import net.sf.gridarta.gui.map.MapViewSettings; +import net.sf.gridarta.gui.map.event.MapViewSettingsEvent; +import net.sf.gridarta.gui.map.event.MapViewSettingsListener; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapModelEvent; import net.sf.gridarta.map.MapModelListener; @@ -66,9 +69,6 @@ private final MapGrid mapGrid; - /** Set if the grid should be rendered. */ - private boolean gridVisible = false; - /** Used to avoid creation millions of points. */ private final Point tmpPoint = new Point(); @@ -91,6 +91,24 @@ private final Image warningSquareImg = SystemIcons.getWarningSquareIcon().getImage(); + /** + * The {@link MapViewSettings} instance to use. + */ + @NotNull + protected final MapViewSettings mapViewSettings; + + /** + * The {@link MapViewSettingsListener} attached to {@link #mapViewSettings}. + */ + private final MapViewSettingsListener mapViewSettingsListener = new MapViewSettingsListener() { + + /** {@inheritDoc} */ + public void mapViewSettingsChanged(final MapViewSettingsEvent e) { + forceRepaint(); + } + + }; + /** The map model listener to track changes in {@link #mapModel}. */ private final MapModelListener<GameObject, MapArchObject, Archetype> mapModelListener = new MapModelListener<GameObject, MapArchObject, Archetype>() { @@ -155,15 +173,19 @@ /** * Create a DefaultLevelRenderer. + * @param mapViewSettings the map view settings instance to use * @param mapModel the map model to render * @param mapGrid Grid to render * @param borderSize the size of the map borders in pixel */ - protected DefaultLevelRenderer(final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, final int borderSize) { + protected DefaultLevelRenderer(@NotNull final MapViewSettings mapViewSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, final int borderSize) { + this.mapViewSettings = mapViewSettings; this.mapModel = mapModel; mapSize = this.mapModel.getMapSize(); this.mapGrid = mapGrid; + mapViewSettings.addMapViewSettingsListener(mapViewSettingsListener); + setToolTipText("dummy"); setFocusable(true); borderOffset.setLocation(borderSize, borderSize); @@ -181,6 +203,7 @@ public void closeNotify() { mapModel.removeMapModelListener(mapModelListener); mapGrid.removeMapGridListener(mapGridListener); + mapViewSettings.removeMapViewSettingsListener(mapViewSettingsListener); } /** {@inheritDoc} */ @@ -280,7 +303,7 @@ * @param point the map coordinates of the square to draw */ protected void paintTileGrid(final Graphics grfx, final Point point) { - if (gridVisible) { + if (mapViewSettings.isGridVisible()) { grfx.drawLine(borderOffset.x + point.x * 32, borderOffset.y + point.y * 32, borderOffset.x + point.x * 32, borderOffset.y + point.y * 32 + 32); grfx.drawLine(borderOffset.x + point.x * 32, borderOffset.y + point.y * 32, borderOffset.x + point.x * 32 + 32, borderOffset.y + point.y * 32); } @@ -362,7 +385,7 @@ * @param grfx Graphics for painting */ private void paintMapGrid(final Graphics grfx) { - if (gridVisible) { + if (mapViewSettings.isGridVisible()) { final Size2D mapSize = mapGrid.getSize(); final int mapWidth = mapSize.getWidth(); final int mapHeight = mapSize.getHeight(); @@ -461,19 +484,4 @@ this.erroneousMapSquares = erroneousMapSquares; } - /** {@inheritDoc} */ - public boolean isGridVisible() { - return gridVisible; - } - - /** {@inheritDoc} */ - public void setGridVisible(final boolean gridVisible) { - if (this.gridVisible == gridVisible) { - return; - } - - this.gridVisible = gridVisible; - forceRepaint(); - } - } // class DefaultLevelRenderer Modified: trunk/crossfire/src/cfeditor/gui/map/DefaultMapViewFactory.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/DefaultMapViewFactory.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/src/cfeditor/gui/map/DefaultMapViewFactory.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -31,6 +31,7 @@ import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewFactory; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.map.MapControl; @@ -47,6 +48,12 @@ /** The action factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); + /** + * The {@link MapViewSettings} instance to use. + */ + @NotNull + private final MapViewSettings mapViewSettings; + /** The {@link SelectedSquareView} instance to use. */ @NotNull private final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView; @@ -73,6 +80,7 @@ /** * Creates a new instance. + * @param mapViewSettings the map view settings instance to use * @param faceObjects the FaceObjects instance * @param selectedSquareView the selected square view instance * @param mainControl the main control instance @@ -82,7 +90,8 @@ * @param toolPalette the tool palette instance * @param filterControl the filter control instance */ - public DefaultMapViewFactory(@NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { + public DefaultMapViewFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { + this.mapViewSettings = mapViewSettings; this.selectedSquareView = selectedSquareView; this.mainView = mainView; this.editTypes = editTypes; @@ -94,7 +103,7 @@ /** {@inheritDoc} */ @NotNull public MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapView(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl, @Nullable final Point viewPosition, final int viewCounter) { - return new MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>(mainView, mapControl, viewCounter, new CMapViewBasic(filterControl, editTypes, mapControl.getMapModel(), mapControl.isPickmap(), viewPosition, toolPalette, 32, 32, selectedSquareView), ACTION_FACTORY, mapImageCache); + return new MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>(mainView, mapControl, viewCounter, new CMapViewBasic(mapViewSettings, filterControl, editTypes, mapControl.getMapModel(), mapControl.isPickmap(), viewPosition, toolPalette, 32, 32, selectedSquareView), ACTION_FACTORY, mapImageCache); } } // class DefaultMapViewFactory Modified: trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/src/cfeditor/gui/map/MapRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -35,6 +35,7 @@ import net.sf.gridarta.filter.FilterState; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.map.MapGrid; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; import org.apache.log4j.Logger; @@ -85,13 +86,14 @@ /** * Creates a new instance. + * @param mapViewSettings the map view settings instance to use * @param filterControl the filter to use * @param editTypes the edit types instance * @param mapModel the map model to render * @param mapGrid Grid to render */ - public MapRenderer(@NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid) { - super(mapModel, mapGrid, 32); + public MapRenderer(@NotNull final MapViewSettings mapViewSettings, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid) { + super(mapViewSettings, mapModel, mapGrid, 32); this.filterControl = filterControl; this.editTypes = editTypes; init(); Modified: trunk/crossfire/src/cfeditor/gui/map/PickmapRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/PickmapRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/src/cfeditor/gui/map/PickmapRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -29,6 +29,7 @@ import javax.swing.ImageIcon; import net.sf.gridarta.CommonConstants; import net.sf.gridarta.gui.map.MapGrid; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; import org.jetbrains.annotations.NotNull; @@ -44,11 +45,12 @@ /** * Create a new instance. + * @param mapViewSettings the map view settings instance to use * @param mapModel the map model to render * @param mapGrid Grid to render */ - public PickmapRenderer(final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid) { - super(mapModel, mapGrid, 0); + public PickmapRenderer(@NotNull final MapViewSettings mapViewSettings, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid) { + super(mapViewSettings, mapModel, mapGrid, 0); setBackground(CommonConstants.BG_COLOR); init(); } Modified: trunk/crossfire/src/cfeditor/gui/map/SimpleLevelRenderer.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/map/SimpleLevelRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/crossfire/src/cfeditor/gui/map/SimpleLevelRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -124,15 +124,6 @@ } /** {@inheritDoc} */ - public boolean isGridVisible() { - return false; - } - - /** {@inheritDoc} */ - public void setGridVisible(final boolean gridVisible) { - } - - /** {@inheritDoc} */ @Override public void setErroneousArchObjects(final Map<GameObject, ValidationError<GameObject, MapArchObject, Archetype>> erroneousArchObjects) { } Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/ChangeLog 2008-10-23 05:41:15 UTC (rev 5583) @@ -1,3 +1,7 @@ +2008-10-23 Andreas Kirschbaum + + * Make "grid visible" affect all maps. + 2008-10-21 Andreas Kirschbaum * Add Map|Next Exit and Map|Previous Exit: select next/previous Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -79,6 +79,7 @@ import net.sf.gridarta.gui.map.MapActions; import net.sf.gridarta.gui.map.MapPropertiesDialogFactory; import net.sf.gridarta.gui.map.MapViewFactory; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.newmap.NewMapDialogFactory; import net.sf.gridarta.gui.prefs.AppPrefs; @@ -217,8 +218,8 @@ /** {@inheritDoc} */ @NotNull @Override - protected MapViewFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapViewFactory(@NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final AbstractMainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { - return new DefaultMapViewFactory(faceObjects, selectedSquareView, mainControl, mainView, editTypes, mapImageCache, toolPalette, filterControl); + protected MapViewFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapViewFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final AbstractMainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { + return new DefaultMapViewFactory(mapViewSettings, faceObjects, selectedSquareView, mainControl, mainView, editTypes, mapImageCache, toolPalette, filterControl); } /** {@inheritDoc} */ @@ -305,7 +306,7 @@ /** {@inheritDoc} */ @NotNull @Override - protected MapActions init1(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final MapArchObjectParserFactory<MapArchObject> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final MapViewManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapViewManager, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final GameObjectMatcher exitMatcher) { + protected MapActions init1(@NotNull final MapViewSettings mapViewSettings, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final MapArchObjectParserFactory<MapArchObject> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<MapArchObject> mapArchObjectFactory, @NotNull final GlobalSettings globalSettings, @NotNull final MapManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapManager, @NotNull final MapViewManager<GameObject, MapArchObject, Archetype, CMapViewBasic> mapViewManager, @NotNull final ArchetypeTypeSet<GameObject, MapArchObject, Archetype> archetypeTypeSet, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final GameObjectMatcher exitMatcher) { final int[] directionMap = new int[] { CommonConstants.NORTH_EAST, CommonConstants.SOUTH_EAST, @@ -317,7 +318,7 @@ CommonConstants.NORTH, }; final MapPropertiesDialogFactory<GameObject, MapArchObject, Archetype, CMapViewBasic> mapPropertiesDialogFactory = new DefaultMapPropertiesDialogFactory(mapManager, mapArchObjectParserFactory, mapArchObjectFactory, globalSettings); - return new DefaultMapActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, getMainView(), getMainView(), globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView, directionMap, false, mapPropertiesDialogFactory); + return new DefaultMapActions<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, getMainView(), getMainView(), globalSettings, mapManager, mapViewManager, exitMatcher, mapFileFilter, selectedSquareView, directionMap, false, mapPropertiesDialogFactory, mapViewSettings); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/gui/map/CMapViewBasic.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/CMapViewBasic.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/CMapViewBasic.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -30,6 +30,7 @@ import net.sf.gridarta.gui.map.MapUserListener; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.map.MapModel; @@ -96,6 +97,7 @@ /** * Constructs a level view. + * @param mapViewSettings the map view settings instance to use * @param mainControl the main controller * @param filterControl the filter to use * @param editTypes the edit types instance @@ -109,10 +111,10 @@ * @param yScrollDistance the y distance when scrolling * @param selectedSquareView the selected square view */ - public CMapViewBasic(@NotNull final CMainControl mainControl, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, final boolean isPickmap, @Nullable final Point initial, @NotNull final FaceObjects faceObjects, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, final int xScrollDistance, final int yScrollDistance, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView) { + public CMapViewBasic(@NotNull final MapViewSettings mapViewSettings, @NotNull final CMainControl mainControl, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, @NotNull final MapModel<GameObject, MapArchObject, Archetype> mapModel, final boolean isPickmap, @Nullable final Point initial, @NotNull final FaceObjects faceObjects, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, final int xScrollDistance, final int yScrollDistance, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView) { super(mapModel, isPickmap, xScrollDistance, yScrollDistance, selectedSquareView); - renderer = isPickmap ? new PickmapRenderer(mainControl, mapModel, getMapGrid(), faceObjects) : new MapRenderer(mainControl, filterControl, editTypes, mapModel, getMapGrid(), faceObjects); + renderer = isPickmap ? new PickmapRenderer(mapViewSettings, mainControl, mapModel, getMapGrid(), faceObjects) : new MapRenderer(mapViewSettings, mainControl, filterControl, editTypes, mapModel, getMapGrid(), faceObjects); setViewportView(renderer); if (initial != null) { getViewport().setViewPosition(initial); Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -44,6 +44,9 @@ import net.sf.gridarta.gui.map.MapGrid; import net.sf.gridarta.gui.map.MapGridEvent; import net.sf.gridarta.gui.map.MapGridListener; +import net.sf.gridarta.gui.map.MapViewSettings; +import net.sf.gridarta.gui.map.event.MapViewSettingsEvent; +import net.sf.gridarta.gui.map.event.MapViewSettingsListener; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; import net.sf.gridarta.map.validation.ValidationError; @@ -79,9 +82,6 @@ @NotNull private final FaceObjects faceObjects; - /** Set if the grid should be rendered. */ - private boolean gridVisible = false; - /** Whether to check for double arches. */ private transient boolean drawDoubleFaces; @@ -109,6 +109,24 @@ /** Used to avoid creation millions of points. */ private final Point tmpPoint = new Point(); + /** + * The {@link MapViewSettings} instance to use. + */ + @NotNull + protected final MapViewSettings mapViewSettings; + + /** + * The {@link MapViewSettingsListener} attached to {@link #mapViewSettings}. + */ + private final MapViewSettingsListener mapViewSettingsListener = new MapViewSettingsListener() { + + /** {@inheritDoc} */ + public void mapViewSettingsChanged(final MapViewSettingsEvent e) { + forceRepaint(); + } + + }; + /** The map grid listener to track changes in {@link #mapGrid}. */ private final MapGridListener mapGridListener = new MapGridListener() { @@ -129,6 +147,7 @@ /** * Create a DefaultLevelRenderer. + * @param mapViewSettings the map view settings instance to use * @param mainControl MainControl, used for getting icons and similar * @param mapModel the map model to render * @param mapGrid Grid to render @@ -136,7 +155,8 @@ * @param borderOffsetY the vertical border size * @param faceObjects the FaceObjects instance to use */ - protected DefaultLevelRenderer(final CMainControl mainControl, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, final int borderOffsetX, final int borderOffsetY, @NotNull final FaceObjects faceObjects) { + protected DefaultLevelRenderer(@NotNull final MapViewSettings mapViewSettings, final CMainControl mainControl, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, final int borderOffsetX, final int borderOffsetY, @NotNull final FaceObjects faceObjects) { + this.mapViewSettings = mapViewSettings; borderOffset = new Point(borderOffsetX, borderOffsetY); this.mainControl = mainControl; drawDoubleFaces = mainControl.isDrawDouble(); @@ -145,6 +165,8 @@ this.mapGrid = mapGrid; this.faceObjects = faceObjects; + mapViewSettings.addMapViewSettingsListener(mapViewSettingsListener); + setToolTipText("dummy"); setFocusable(true); calculateOrigin(); @@ -156,6 +178,7 @@ @Override public void closeNotify() { mapGrid.removeMapGridListener(mapGridListener); + mapViewSettings.removeMapViewSettingsListener(mapViewSettingsListener); } /** @@ -447,7 +470,7 @@ * @param grfx Graphics for painting */ private void paintMapGrid(final Graphics grfx) { - if (gridVisible) { + if (mapViewSettings.isGridVisible()) { // draw iso grid grfx.setColor(Color.black); @@ -500,21 +523,6 @@ this.erroneousMapSquares = erroneousMapSquares; } - /** {@inheritDoc} */ - public boolean isGridVisible() { - return gridVisible; - } - - /** {@inheritDoc} */ - public void setGridVisible(final boolean gridVisible) { - if (this.gridVisible == gridVisible) { - return; - } - - this.gridVisible = gridVisible; - forceRepaint(); - } - /** Refreshes the data in the view from the model. */ private void resizeFromModel() { // define how much drawing space we need for the map Modified: trunk/daimonin/src/daieditor/gui/map/DefaultMapViewFactory.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultMapViewFactory.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/DefaultMapViewFactory.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -33,6 +33,7 @@ import net.sf.gridarta.gui.MainView; import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewFactory; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.gui.map.tools.ToolPalette; import net.sf.gridarta.gui.selectedsquare.SelectedSquareView; import net.sf.gridarta.map.MapControl; @@ -49,6 +50,10 @@ /** The action factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); + /** The {@link MapViewSettings} instance to use. */ + @NotNull + private final MapViewSettings mapViewSettings; + /** The {@link FaceObjects} instance to use. */ private FaceObjects faceObjects = null; @@ -82,6 +87,7 @@ /** * Creates a new instance. + * @param mapViewSettings the map view settings instance to use * @param faceObjects the FaceObjects instance * @param selectedSquareView the selected square view instance * @param mainControl the main control instance @@ -91,7 +97,8 @@ * @param toolPalette the tool palette instance * @param filterControl the filter control instance */ - public DefaultMapViewFactory(@NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { + public DefaultMapViewFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView, @NotNull final MainControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mainControl, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<GameObject, MapArchObject, Archetype, CMapViewBasic> mapImageCache, @NotNull final ToolPalette<GameObject, MapArchObject, Archetype, CMapViewBasic> toolPalette, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl) { + this.mapViewSettings = mapViewSettings; this.faceObjects = faceObjects; this.selectedSquareView = selectedSquareView; this.mainControl = mainControl; @@ -105,7 +112,7 @@ /** {@inheritDoc} */ @NotNull public MapView<GameObject, MapArchObject, Archetype, CMapViewBasic> newMapView(@NotNull final MapControl<GameObject, MapArchObject, Archetype, CMapViewBasic> mapControl, @Nullable final Point viewPosition, final int viewCounter) { - return new MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>(mainView, mapControl, viewCounter, new CMapViewBasic((CMainControl) mainControl, filterControl, editTypes, mapControl.getMapModel(), mapControl.isPickmap(), viewPosition, faceObjects, toolPalette, IGUIConstants.TILE_ISO_XLEN, IGUIConstants.TILE_ISO_YLEN, selectedSquareView), ACTION_FACTORY, mapImageCache); + return new MapView<GameObject, MapArchObject, Archetype, CMapViewBasic>(mainView, mapControl, viewCounter, new CMapViewBasic(mapViewSettings, (CMainControl) mainControl, filterControl, editTypes, mapControl.getMapModel(), mapControl.isPickmap(), viewPosition, faceObjects, toolPalette, IGUIConstants.TILE_ISO_XLEN, IGUIConstants.TILE_ISO_YLEN, selectedSquareView), ACTION_FACTORY, mapImageCache); } } // class DefaultMapViewFactory Modified: trunk/daimonin/src/daieditor/gui/map/MapRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/MapRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -34,6 +34,7 @@ import net.sf.gridarta.gameobject.face.FaceObjects; import net.sf.gridarta.gui.SystemIcons; import net.sf.gridarta.gui.map.MapGrid; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; import org.jetbrains.annotations.NotNull; @@ -79,6 +80,7 @@ /** * Creates a new instance. + * @param mapViewSettings the map view settings instance to use * @param mainControl MainControl, used for getting icons and similar * @param filterControl the filter to use * @param editTypes the edit types instance @@ -86,8 +88,8 @@ * @param mapGrid Grid to render * @param faceObjects the FaceObjects instance to use */ - public MapRenderer(final CMainControl mainControl, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, @NotNull final FaceObjects faceObjects) { - super(mainControl, mapModel, mapGrid, IGUIConstants.TILE_ISO_XLEN, 2 * IGUIConstants.TILE_ISO_YLEN, faceObjects); + public MapRenderer(@NotNull final MapViewSettings mapViewSettings, final CMainControl mainControl, @NotNull final FilterControl<GameObject, MapArchObject, Archetype, CMapViewBasic> filterControl, @NotNull final EditTypes editTypes, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, @NotNull final FaceObjects faceObjects) { + super(mapViewSettings, mainControl, mapModel, mapGrid, IGUIConstants.TILE_ISO_XLEN, 2 * IGUIConstants.TILE_ISO_YLEN, faceObjects); this.filterControl = filterControl; this.editTypes = editTypes; } Deleted: trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/MapViewSettings.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -1,109 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package daieditor.gui.map; - -import daieditor.gui.map.event.MapViewSettingsEvent; -import daieditor.gui.map.event.MapViewSettingsListener; -import javax.swing.event.EventListenerList; -import net.sf.gridarta.gameobject.match.ViewGameObjectMatcherManager; - -/** - * Container for settings that affect the rendering of maps. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class MapViewSettings { - - /** The visibility of the grid. */ - private boolean gridVisible; - - /** Whether double faces should be drawn double height. */ - private boolean doubleFaces; - - /** The transparency settings. */ - // TODO: use this field (it looks unused but usage is planned) - private ViewGameObjectMatcherManager transparencyManager; - - /** The visibility settings. */ - // TODO: use this field (it looks unused but usage is planned) - private ViewGameObjectMatcherManager visibilityManager; - - /** The MapViewSettingsListeners to inform of changes. */ - private final EventListenerList listenerList = new EventListenerList(); - - /** - * Register a MapViewSettingsListener. - * @param listener MapViewSettingsListener to register - */ - public void addMapViewSettingsListener(final MapViewSettingsListener listener) { - listenerList.add(MapViewSettingsListener.class, listener); - } - - /** - * Unregister a MapViewSettingsListener. - * @param listener MapViewSettingsListener to unregister - */ - public void removeMapViewSettingsListener(final MapViewSettingsListener listener) { - listenerList.remove(MapViewSettingsListener.class, listener); - } - - /** Inform all registered listeners that the settings have changed. */ - protected void fireSettingsChangedEvent() { - final MapViewSettingsEvent e = new MapViewSettingsEvent(this); - for (final MapViewSettingsListener listener : listenerList.getListeners(MapViewSettingsListener.class)) { - listener.mapViewSettingsChanged(e); - } - } - - /** - * Get the visibility of the grid. - * @return visibility of the grid (<code>true</code> for visible, - * <code>false</code> for invisible) - */ - public boolean isGridVisible() { - return gridVisible; - } - - /** - * Set the visibility of the grid. - * @param gridVisible new visibility of the grid (<code>true</code> for - * making the grid visible, <code>false</code> for inivisible) - */ - public void setGridVisible(final boolean gridVisible) { - this.gridVisible = gridVisible; - } - - /** - * Get whether double faces are drawn double height. - * @return <code>true</code> if double faces are drawn double height, - * otherwise <code>false</code> - */ - public boolean isDoubleFaces() { - return doubleFaces; - } - - /** - * Sets whether double faces should be drawn double height. - * @param doubleFaces whether double faces should be drawn double height - */ - public void setDoubleFaces(final boolean doubleFaces) { - this.doubleFaces = doubleFaces; - } - -} // class MapViewSettings Modified: trunk/daimonin/src/daieditor/gui/map/PickmapRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/PickmapRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/PickmapRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -29,6 +29,7 @@ import net.sf.gridarta.CommonConstants; import net.sf.gridarta.gameobject.face.FaceObjects; import net.sf.gridarta.gui.map.MapGrid; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.map.MapModel; import net.sf.gridarta.map.MapSquare; import org.jetbrains.annotations.NotNull; @@ -44,13 +45,14 @@ /** * Create a new instance. + * @param mapViewSettings the map view settings instance to use * @param mainControl MainControl, used for getting icons and similar * @param mapModel the map model to render * @param mapGrid Grid to render * @param faceObjects the FaceObjects instance to use */ - public PickmapRenderer(final CMainControl mainControl, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, @NotNull final FaceObjects faceObjects) { - super(mainControl, mapModel, mapGrid, 0, IGUIConstants.TILE_ISO_YLEN, faceObjects); + public PickmapRenderer(@NotNull final MapViewSettings mapViewSettings, final CMainControl mainControl, final MapModel<GameObject, MapArchObject, Archetype> mapModel, final MapGrid mapGrid, @NotNull final FaceObjects faceObjects) { + super(mapViewSettings, mainControl, mapModel, mapGrid, 0, IGUIConstants.TILE_ISO_YLEN, faceObjects); setBackground(CommonConstants.BG_COLOR); } Modified: trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/SimpleLevelRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -197,15 +197,6 @@ } /** {@inheritDoc} */ - public boolean isGridVisible() { - return false; - } - - /** {@inheritDoc} */ - public void setGridVisible(final boolean gridVisible) { - } - - /** {@inheritDoc} */ @Override public void setErroneousArchObjects(final Map<GameObject, ValidationError<GameObject, MapArchObject, Archetype>> erroneousArchObjects) { } Deleted: trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsEvent.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -1,50 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package daieditor.gui.map.event; - -import daieditor.gui.map.MapViewSettings; -import java.util.EventObject; - -/** - * Event Object encapsulating events on MapViewSettings. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class MapViewSettingsEvent extends EventObject { - - /** The serial version UID. */ - private static final long serialVersionUID = 1; - - /** - * Constructs a MapViewSettingsEvent. - * @param source The object (MapViewSettings) on which the Event initially - * occurred. - * @throws IllegalArgumentException if source is null. - */ - public MapViewSettingsEvent(final MapViewSettings source) { - super(source); - } - - /** {@inheritDoc} */ - @Override - public MapViewSettings getSource() { - return (MapViewSettings) super.getSource(); - } - -} // class MapViewSettings Deleted: trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/daimonin/src/daieditor/gui/map/event/MapViewSettingsListener.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -1,39 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package daieditor.gui.map.event; - -import java.util.EventListener; - -/** - * Interface for event listeners that are interested in changes on {@link - * daieditor.gui.map.MapViewSettings}. Usually you would implement this class in - * renderers for Maps. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public interface MapViewSettingsListener extends EventListener { - - /** - * This event handler is called when {@link daieditor.gui.map.MapViewSettings} - * have changed. - * @param e MapViewSettingsEvent - */ - void mapViewSettingsChanged(MapViewSettingsEvent e); - -} // interface MapViewSettingsListener Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -90,6 +90,7 @@ import net.sf.gridarta.gui.map.MapView; import net.sf.gridarta.gui.map.MapViewBasic; import net.sf.gridarta.gui.map.MapViewFactory; +import net.sf.gridarta.gui.map.MapViewSettings; import net.sf.gridarta.gui.map.RendererFactory; import net.sf.gridarta.gui.map.tools.DeletionTool; import net.sf.gridarta.gui.map.tools.ToolPalette; @@ -415,7 +416,8 @@ InsertionMode.init(floorMatcher, wallMatcher, belowFloorMatcher); final GameObjectMatcher exitMatcher = gameObjectMatchers.getMatcherFatal("system_exit", "exit"); final ScriptArchUtils scriptArchUtils = newScriptArchUtils(); - final MapActions mapActions = init1(scriptArchUtils, mapArchObjectParserFactory, mapArchObjectFactory, globalSettings, mapManager, mapViewManager, archetypeTypeSet, selectedSquareView, exitMatcher); + final MapViewSettings mapViewSettings = new MapViewSettings(); + final MapActions mapActions = init1(mapViewSettings, scriptArchUtils, mapArchObjectParserFactory, mapArchObjectFactory, globalSettings, mapManager, mapViewManager, archetypeTypeSet, selectedSquareView, exitMatcher); Map<String, TreasureTreeNode> specialTreasureLists; try { final Document specialTreasureListsDocument = xmlHelper.getDocumentBuilder().parse(IOUtils.getResourceURLAsString(globalSettings.getConfigurationDirectory(), "TreasureLists.xml")); @@ -458,7 +460,7 @@ final GameObjectParser<G, A, R> gameObjectParser = gameObjectParserFactory.newGameObjectParser(); archetypeSet.init(gameObjectParser); final AbstractArchetypeParser<G, A, R> archetypeParser = newArchetypeParser(gameObjectParser, archetypeChooserControl, animationObjects, archetypeSet, gameObjectFactory); - final MapViewFactory<G, A, R, V> mapViewFactory = newMapViewFactory(faceObjects, selectedSquareView, this, mainView, editTypes, mapImageCache, toolPalette, filterControl); + final MapViewFactory<G, A, R, V> mapViewFactory = newMapViewFactory(mapViewSettings, faceObjects, selectedSquareView, this, mainView, editTypes, mapImageCache, toolPalette, filterControl); mapControlFactory.init(mapViewFactory, gameObjectParser, rendererFactory, mapActions, archetypeChooserModel, mapImageCache, autojoinLists, exitMatcher); copyBuffer.init(mapArchObjectFactory.newMapArchObject(false), mainView); final ScriptedEventFactory<G> scriptedEventFactory = newScriptedEventFactory(scriptArchUtils); @@ -516,7 +518,7 @@ protected abstract ArchetypeFactory<G, A, R> newArchetypeFactory(); @NotNull - protected abstract MapViewFactory<G, A, R, V> newMapViewFactory(@NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, @NotNull final AbstractMainControl<G, A, R, V> mainControl, @NotNull final MainView<G, A, R, V> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<G, A, R, V> mapImageCache, @NotNull final ToolPalette<G, A, R, V> toolPalette, @NotNull final FilterControl<G, A, R, V> filterControl); + protected abstract MapViewFactory<G, A, R, V> newMapViewFactory(@NotNull final MapViewSettings mapViewSettings, @NotNull final FaceObjects faceObjects, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, @NotNull final AbstractMainControl<G, A, R, V> mainControl, @NotNull final MainView<G, A, R, V> mainView, @NotNull final EditTypes editTypes, @NotNull final MapImageCache<G, A, R, V> mapImageCache, @NotNull final ToolPalette<G, A, R, V> toolPalette, @NotNull final FilterControl<G, A, R, V> filterControl); @NotNull protected abstract MapReaderFactory<G, A> newMapReaderFactory(@NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull final GameObjectParserFactory<G, A, R> gameObjectParserFactory); @@ -547,7 +549,7 @@ protected abstract CFTreasureListTree<G, A, R> createTreasureListTree(@NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet<G, A, R> archetypeSet, @NotNull Map<String, TreasureTreeNode> specialTreasureLists); @NotNull - protected abstract MapActions init1(@NotNull final ScriptArchUtils scriptArchUtils, @NotNull final MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final GlobalSettings globalSettings, @NotNull final MapManager<G, A, R, V> mapManager, @NotNull final MapViewManager<G, A, R, V> mapViewManager, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, @NotNull final GameObjectMatcher exitMatcher); + protected abstract MapActions init1(@NotNull final MapViewSettings mapViewSettings, @NotNull final ScriptArchUtils scriptArchUtils, @NotNull final MapArchObjectParserFactory<A> mapArchObjectParserFactory, @NotNull final MapArchObjectFactory<A> mapArchObjectFactory, @NotNull final GlobalSettings globalSettings, @NotNull final MapManager<G, A, R, V> mapManager, @NotNull final MapViewManager<G, A, R, V> mapViewManager, @NotNull final ArchetypeTypeSet<G, A, R> archetypeTypeSet, @NotNull final SelectedSquareView<G, A, R, V> selectedSquareView, @NotNull final GameObjectMatcher exitMatcher); protected abstract void init4(@NotNull final GameObjectParser<G, A, R> gameObjectParser, @NotNull final AbstractArchetypeParser<G, A, R> archetypeParser, @NotNull final EditTypes editTypes, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, final MainView<G, A, R, V> mainView, @NotNull final GlobalSettings globalSettings, @NotNull final ArchetypeSet<G, A, R> archetypeSet); Modified: trunk/src/app/net/sf/gridarta/gui/map/AbstractLevelRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/AbstractLevelRenderer.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/src/app/net/sf/gridarta/gui/map/AbstractLevelRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -40,6 +40,12 @@ */ private static final long serialVersionUID = 1; + /** + * Creates a new instance. + */ + protected AbstractLevelRenderer() { + } + /** {@inheritDoc} */ public void printFullImage(final File file) throws IOException { ImageIO.write(getFullImage(), "png", file); Modified: trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java 2008-10-22 19:30:28 UTC (rev 5582) +++ trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java 2008-10-23 05:41:15 UTC (rev 5583) @@ -154,6 +154,12 @@ private final MapPropertiesDialogFactory<G, A, R, V> mapPropertiesDialogFactory; /** + * The {@link MapViewSettings} instance to use. + */ + @NotNull + private final MapViewSettings mapViewSettings; + + /** ... [truncated message content] |
From: <aki...@us...> - 2008-10-24 15:45:18
|
Revision: 5584 http://gridarta.svn.sourceforge.net/gridarta/?rev=5584&view=rev Author: akirschbaum Date: 2008-10-24 15:45:14 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Manage 'Draw double faces' state in MapViewSettings. Modified Paths: -------------- trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-10-24 15:45:14 UTC (rev 5584) @@ -154,9 +154,6 @@ /** Bit field of edit types to show transparent. */ private int alphaType; - /** Whether to display double arches like stacked walls in stacked version. */ - private boolean drawDouble; - /** Preferences default for auto validation. */ private static final boolean PREFS_VALIDATOR_AUTO_DEFAULT = false; @@ -283,7 +280,6 @@ /** {@inheritDoc} */ protected void createActions() { ACTION_FACTORY.createActions(true, this, "cleanCompletelyBlockedSquares", "collectSpells"); - ACTION_FACTORY.createToggles(true, this, "drawDouble"); } /** {@inheritDoc} */ @@ -442,25 +438,6 @@ mapModel.endTransaction(); } - /** - * Whether to use double display like the client with walls. - * @return <code>true</code> if double display should be used, otherwise - * <code>false</code> - */ - public boolean isDrawDouble() { - return drawDouble; - } - - /** - * Set whether to use double display like the client with walls. - * @param drawDouble <code>true</code> if double display should be used, - * otherwise <code>false</code> - */ - public void setDrawDouble(final boolean drawDouble) { - this.drawDouble = drawDouble; - mapManager.refreshCurrentMap(); - } - /** Collect Spells. */ @ActionMethod public void collectSpells() { Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/daimonin/src/daieditor/action.properties 2008-10-24 15:45:14 UTC (rev 5584) @@ -33,7 +33,7 @@ resources.menu=collectArches collectSpells - reloadFaces - viewTreasurelists tools.menu=newScript editScript - controlServer controlClient - validateMap cleanCompletelyBlockedSquares - zoom gc analyze.menu= -view.menu=resetView - gridVisible drawDouble - prevWindow nextWindow +view.menu=resetView - gridVisible doubleFaces - prevWindow nextWindow plugins.menu=- editPlugins - savePlugins importPlugin window.menu=closeAll help.menu=onlineHelp tod about update Modified: trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java =================================================================== --- trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/daimonin/src/daieditor/gui/map/DefaultLevelRenderer.java 2008-10-24 15:45:14 UTC (rev 5584) @@ -82,9 +82,6 @@ @NotNull private final FaceObjects faceObjects; - /** Whether to check for double arches. */ - private transient boolean drawDoubleFaces; - private final Image selImg = SystemIcons.getMapSelIcon().getImage(); private final Image selImgNorth = SystemIcons.getMapSelIconNorth().getImage(); @@ -159,7 +156,6 @@ this.mapViewSettings = mapViewSettings; borderOffset = new Point(borderOffsetX, borderOffsetY); this.mainControl = mainControl; - drawDoubleFaces = mainControl.isDrawDouble(); this.mapModel = mapModel; mapSize = this.mapModel.getMapSize(); this.mapGrid = mapGrid; @@ -243,7 +239,6 @@ final Point storeOffset = new Point(borderOffset); setBorderOffset(0, 0); - drawDoubleFaces = mainControl.isDrawDouble(); clearBackground(bufGrfx); final Point pos = new Point(); for (pos.y = 0; pos.y < mapHeight; pos.y++) { @@ -306,7 +301,6 @@ * @param grfx the graphics context to paint to */ private void paintComponent2(final Graphics2D grfx) { - drawDoubleFaces = mainControl.isDrawDouble(); //ImageIcon selIcon = mainControl.mapSelIcon; clearBackground(grfx); @@ -395,7 +389,7 @@ xoff = (img.getIconWidth() - IGUIConstants.TILE_ISO_XLEN) / 2; } img.paintIcon(this, grfx, xstart - xoff, ystart - yoff); - if (drawDoubleFaces) { + if (mapViewSettings.isDoubleFaces()) { final FaceObject fo = faceObjects.get(node.getFaceObjName()); if (fo != null && fo.isDouble()) { img.paintIcon(this, grfx, xstart - xoff, ystart - yoff - IGUIConstants.TILE_ISO_YLEN + 1); Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/daimonin/src/daieditor/messages.properties 2008-10-24 15:45:14 UTC (rev 5584) @@ -143,10 +143,10 @@ viewShow.shortdescription=Select some filters to be drawn exclusively viewShow.mnemonic=S -drawDouble.text=Draw double faces -drawDouble.mnemonic=F -drawDouble.shortdescription=Check this to draw double faces (e.g. stacked walls) the same way the client does -drawDouble.accel=ctrl shift pressed G +doubleFaces.text=Draw double faces +doubleFaces.mnemonic=F +doubleFaces.shortdescription=Check this to draw double faces (e.g. stacked walls) the same way the client does +doubleFaces.accel=ctrl shift pressed G ######### Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-10-24 15:45:14 UTC (rev 5584) @@ -124,9 +124,9 @@ viewShow.shortdescription= viewShow.mnemonic=Z -drawDouble.text=Zeichne doppelte Grafiken -drawDouble.mnemonic=F -drawDouble.shortdescription=Zeichne Grafiken, die doppelt gezeichnet werden, tats\xE4chlich doppelt (z.B. W\xE4nde) +doubleFaces.text=Zeichne doppelte Grafiken +doubleFaces.mnemonic=F +doubleFaces.shortdescription=Zeichne Grafiken, die doppelt gezeichnet werden, tats\xE4chlich doppelt (z.B. W\xE4nde) ######### Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-10-24 15:45:14 UTC (rev 5584) @@ -126,9 +126,9 @@ #viewShow.shortdescription= #viewShow.mnemonic= -#drawDouble.text= -#drawDouble.mnemonic= -#drawDouble.shortdescription= +#doubleFaces.text= +#doubleFaces.mnemonic= +#doubleFaces.shortdescription= ######### Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-10-24 15:45:14 UTC (rev 5584) @@ -126,9 +126,9 @@ viewShow.shortdescription=V\xE4lj kategorier att visa exklusivt viewShow.mnemonic=V -drawDouble.text=Visa dubbla bilder -drawDouble.mnemonic=D -drawDouble.shortdescription=Markera f\xF6r att rita ut dubbla bilder (t.ex. v\xE4ggar) p\xE5 samma s\xE4tt som klienten +doubleFaces.text=Visa dubbla bilder +doubleFaces.mnemonic=D +doubleFaces.shortdescription=Markera f\xF6r att rita ut dubbla bilder (t.ex. v\xE4ggar) p\xE5 samma s\xE4tt som klienten ######### Modified: trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java 2008-10-23 05:41:15 UTC (rev 5583) +++ trunk/src/app/net/sf/gridarta/gui/map/DefaultMapActions.java 2008-10-24 15:45:14 UTC (rev 5584) @@ -74,6 +74,9 @@ /** Action for "grid visible". */ private final ToggleAction aGridVisible; + /** Action for "draw double faces". */ + private final ToggleAction aDoubleFaces; + /** Action for "tile show". */ private final ToggleAction aTileShow; @@ -191,6 +194,7 @@ this.mapPropertiesDialogFactory = mapPropertiesDialogFactory; this.mapViewSettings = mapViewSettings; aGridVisible = (ToggleAction) actionFactory.createToggle(true, "gridVisible", this); + aDoubleFaces = (ToggleAction) actionFactory.createToggle(true, "doubleFaces", this); shrinkMapSizeDialogManager = new ShrinkMapSizeDialogManager<G, A, R, V>(mapViewManager); aTileShow = (ToggleAction) actionFactory.createToggle(true, "tileShow", this); aMapCreateView = actionFactory.createAction(true, "mapCreateView", this); @@ -259,6 +263,26 @@ } /** + * Action method for "double faces". + * @return <code>true</code> if double faces are shwon, or + * <code>false</code> if not + */ + public boolean isDoubleFaces() { + return isDoubleFacesEnabled() && mapViewSettings.isDoubleFaces(); + } + + /** + * Sets whether double faces on the current map should be shown. + * @param doubleFaces new value + * @see #isDoubleFaces() + */ + public void setDoubleFaces(final boolean doubleFaces) { + if (isDoubleFacesEnabled()) { + mapViewSettings.setDoubleFaces(doubleFaces); + } + } + + /** * Action method for "tile show". * @return <code>true</code> if adjacent tiles are shown, or * <code>false</code> if adjacent tiles are not shown @@ -603,6 +627,14 @@ } /** + * Determine whether "draw double faces" is enabled. + * @return whether "draw double faces" is disabled + */ + private boolean isDoubleFacesEnabled() { + return true; + } + + /** * Determine whether "tile show" is enabled. * @return the current map, or <code>null</code> if "tile show" is disabled */ @@ -706,6 +738,8 @@ private void updateActions() { aGridVisible.setEnabled(isGridVisibleEnabled()); aGridVisible.setSelected(mapViewSettings.isGridVisible()); + aDoubleFaces.setEnabled(isDoubleFacesEnabled()); + aDoubleFaces.setSelected(mapViewSettings.isDoubleFaces()); aTileShow.setEnabled(getTileShowEnabled() != null); aTileShow.setSelected(false); aMapCreateView.setEnabled(getCreateViewEnabled() != null); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-24 16:03:58
|
Revision: 5587 http://gridarta.svn.sourceforge.net/gridarta/?rev=5587&view=rev Author: akirschbaum Date: 2008-10-24 16:03:54 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Move GlobalSettingsImpl.autoPopupDocu and related code to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java trunk/daimonin/src/daieditor/GlobalSettingsImpl.java trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java Modified: trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java =================================================================== --- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-10-24 15:56:39 UTC (rev 5586) +++ trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-10-24 16:03:54 UTC (rev 5587) @@ -20,8 +20,6 @@ package cfeditor; import java.io.File; -import java.util.prefs.Preferences; -import net.sf.gridarta.MainControl; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -32,37 +30,19 @@ */ public class GlobalSettingsImpl extends net.sf.gridarta.GlobalSettingsImpl { - private static final String DOCU_VERSION_KEY = "docuVersion"; - /** The Logger for printing log messages. */ private static final Logger log = Logger.getLogger(GlobalSettingsImpl.class); - /** Preferences. */ - private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - /** Name of used Image Set (null = none). */ @Nullable private String imageSet; - /** Time for an automated docu popup. */ - private boolean autoPopupDocu = false; - @Nullable public String getImageSet() { return imageSet; } /** {@inheritDoc} */ - public boolean isAutoPopupDocu() { - return autoPopupDocu; - } - - /** {@inheritDoc} */ - public void setAutoPopupDocu(final boolean autoPopupDocu) { - this.autoPopupDocu = autoPopupDocu; - } - - /** {@inheritDoc} */ @NotNull public File getPickmapDir() { return new File(getMapDir(), IGUIConstants.PICKMAP_DIR); @@ -96,13 +76,7 @@ setLoadFromArchive(prefs.getBoolean(LOAD_ARCH_COLL, true)); - // docu version - if (prefs.getInt(DOCU_VERSION_KEY, 0) < IGUIConstants.DOCU_VERSION) { - // remember to open docu - autoPopupDocu = true; - // update docu version right now, because we want the help popup only one time - prefs.putInt(DOCU_VERSION_KEY, IGUIConstants.DOCU_VERSION); - } + checkDocuVersion(IGUIConstants.DOCU_VERSION); } /** (Re-)initializes the directories. */ Modified: trunk/daimonin/src/daieditor/GlobalSettingsImpl.java =================================================================== --- trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-10-24 15:56:39 UTC (rev 5586) +++ trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-10-24 16:03:54 UTC (rev 5587) @@ -20,8 +20,6 @@ package daieditor; import java.io.File; -import java.util.prefs.Preferences; -import net.sf.gridarta.MainControl; import org.jetbrains.annotations.NotNull; /** @@ -30,16 +28,8 @@ */ public class GlobalSettingsImpl extends net.sf.gridarta.GlobalSettingsImpl { - private static final String DOCU_VERSION_KEY = "docuVersion"; - - /** Preferences. */ - private static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - private String mediaDir; - /** Time for an automated docu popup. */ - private boolean autoPopupDocu = false; - /** {@inheritDoc} */ @NotNull public String getMediaDefaultFolder() { @@ -47,16 +37,6 @@ } /** {@inheritDoc} */ - public boolean isAutoPopupDocu() { - return autoPopupDocu; - } - - /** {@inheritDoc} */ - public void setAutoPopupDocu(final boolean autoPopupDocu) { - this.autoPopupDocu = autoPopupDocu; - } - - /** {@inheritDoc} */ @NotNull public File getPickmapDir() { return new File(getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR); @@ -80,13 +60,7 @@ setLoadFromArchive(prefs.getBoolean(LOAD_ARCH_COLL, true)); - // docu version - if (prefs.getInt(DOCU_VERSION_KEY, 0) < IGUIConstants.DOCU_VERSION) { - // remember to open docu - autoPopupDocu = true; - // update docu version right now, because we want the help popup only one time - prefs.putInt(DOCU_VERSION_KEY, IGUIConstants.DOCU_VERSION); - } + checkDocuVersion(IGUIConstants.DOCU_VERSION); } /** (Re-)initializes the directories. */ Modified: trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java =================================================================== --- trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java 2008-10-24 15:56:39 UTC (rev 5586) +++ trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java 2008-10-24 16:03:54 UTC (rev 5587) @@ -20,6 +20,7 @@ package net.sf.gridarta; import java.io.File; +import java.util.prefs.Preferences; import org.jetbrains.annotations.NotNull; /** @@ -28,6 +29,11 @@ */ public abstract class GlobalSettingsImpl implements GlobalSettings { + private static final String DOCU_VERSION_KEY = "docuVersion"; + + /** Preferences. */ + protected static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); + private String archDefaultFolder; private String mapDefaultFolder; @@ -51,6 +57,9 @@ */ private boolean hasChangedDir = false; + /** Time for an automated docu popup. */ + private boolean autoPopupDocu = false; + /** {@inheritDoc} */ public String getArchDefaultFolder() { return archDefaultFolder; @@ -125,4 +134,24 @@ this.hasChangedDir = hasChangedDir; } + /** {@inheritDoc} */ + public boolean isAutoPopupDocu() { + return autoPopupDocu; + } + + /** {@inheritDoc} */ + public void setAutoPopupDocu(final boolean autoPopupDocu) { + this.autoPopupDocu = autoPopupDocu; + } + + protected void checkDocuVersion(final int docuVersion) { + // docu version + if (prefs.getInt(DOCU_VERSION_KEY, 0) < docuVersion) { + // remember to open docu + autoPopupDocu = true; + // update docu version right now, because we want the help popup only one time + prefs.putInt(DOCU_VERSION_KEY, docuVersion); + } + } + } // class GlobalSettingsImpl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-24 16:08:25
|
Revision: 5588 http://gridarta.svn.sourceforge.net/gridarta/?rev=5588&view=rev Author: akirschbaum Date: 2008-10-24 16:08:16 +0000 (Fri, 24 Oct 2008) Log Message: ----------- Move parts of GlobalSettingsImpl.initDirs() to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java trunk/daimonin/src/daieditor/GlobalSettingsImpl.java trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java Modified: trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java =================================================================== --- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-10-24 16:03:54 UTC (rev 5587) +++ trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-10-24 16:08:16 UTC (rev 5588) @@ -95,10 +95,7 @@ } setMapDir(new File(getCurrentDir().getAbsolutePath())); } - // if mapdir has no absolute path, set it now - if (getCurrentDir().exists() && getMapDir().getParent() == null && !getMapDir().isAbsolute() && !hasChangedDir()) { - setMapDir(new File(getCurrentDir().getAbsolutePath(), getMapDir().getPath())); - } + finishInitDirs(); } } // class GlobalSettingsImpl Modified: trunk/daimonin/src/daieditor/GlobalSettingsImpl.java =================================================================== --- trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-10-24 16:03:54 UTC (rev 5587) +++ trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-10-24 16:08:16 UTC (rev 5588) @@ -70,9 +70,7 @@ setScriptDefaultFolder(prefs.get(ResourceFileManager.SCRIPT_DIR_KEY, ResourceFileManager.DEFAULT_SCRIPT_DIR)); mediaDir = prefs.get(ResourceFileManager.MEDIA_DIR_KEY, ResourceFileManager.DEFAULT_MEDIA_DIR); setMapDir(new File(getMapDefaultFolder())); - if (getCurrentDir().exists() && getMapDir().getParent() == null && !getMapDir().isAbsolute() && !hasChangedDir()) { - setMapDir(new File(getCurrentDir().getAbsolutePath(), getMapDir().getPath())); - } + finishInitDirs(); } } // class GlobalSettingsImpl Modified: trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java =================================================================== --- trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java 2008-10-24 16:03:54 UTC (rev 5587) +++ trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java 2008-10-24 16:08:16 UTC (rev 5588) @@ -154,4 +154,11 @@ } } + protected void finishInitDirs() { + // if mapdir has no absolute path, set it now + if (currentDir.exists() && mapDir.getParent() == null && !mapDir.isAbsolute() && !hasChangedDir()) { + mapDir = new File(currentDir.getAbsolutePath(), mapDir.getPath()); + } + } + } // class GlobalSettingsImpl This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-26 12:59:00
|
Revision: 5593 http://gridarta.svn.sourceforge.net/gridarta/?rev=5593&view=rev Author: akirschbaum Date: 2008-10-26 12:58:55 +0000 (Sun, 26 Oct 2008) Log Message: ----------- Remove unused code. Modified Paths: -------------- trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/gameobject/Collector.java Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-10-26 12:54:40 UTC (rev 5592) +++ trunk/daimonin/src/daieditor/messages.properties 2008-10-26 12:58:55 UTC (rev 5593) @@ -65,7 +65,6 @@ oldLibsFound.title=Delete old libraries? archCollectAnimations=Collecting Animations... -archCollectDone=Collect Arches: done #archCollectWarningMultipartTailInPanel.title=Collect warning #archCollectWarningMultipartTailInPanel.message=Collect Warning: Found Multipart tail in Panel! Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-10-26 12:54:40 UTC (rev 5592) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-10-26 12:58:55 UTC (rev 5593) @@ -65,7 +65,6 @@ #oldLibsFound.title= #archCollectAnimations= -#archCollectDone= #archCollectWarningMultipartTailInPanel.title= #archCollectWarningMultipartTailInPanel.message= Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-10-26 12:54:40 UTC (rev 5592) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-10-26 12:58:55 UTC (rev 5593) @@ -67,7 +67,6 @@ #oldLibsFound.title= #archCollectAnimations= -#archCollectDone= #archCollectWarningMultipartTailInPanel.title= #archCollectWarningMultipartTailInPanel.message= Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-10-26 12:54:40 UTC (rev 5592) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-10-26 12:58:55 UTC (rev 5593) @@ -65,7 +65,6 @@ oldLibsFound.title=Ta bort gamla bibliotek? archCollectAnimations=Sammanst\xE4ller animationer... -archCollectDone=Sammanst\xE4ll arketyper: klart! #archCollectWarningMultipartTailInPanel.title=Varning under sammanst\xE4llning #archCollectWarningMultipartTailInPanel.message=Varning under sammanst\xE4llning: hittade svans till multidelsobjekt i panelen! Modified: trunk/src/app/net/sf/gridarta/gameobject/Collector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2008-10-26 12:54:40 UTC (rev 5592) +++ trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2008-10-26 12:58:55 UTC (rev 5593) @@ -132,7 +132,6 @@ } finally { thread = null; } - //mainControl.setStatusText(ACTION_FACTORY.getString("archCollectDone")); } } // class Collector This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-28 19:42:25
|
Revision: 5599 http://gridarta.svn.sourceforge.net/gridarta/?rev=5599&view=rev Author: akirschbaum Date: 2008-10-28 19:42:18 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Rename identifiers. Modified Paths: -------------- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/GlobalSettingsImpl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java trunk/src/app/net/sf/gridarta/AbstractMainControl.java trunk/src/app/net/sf/gridarta/FileControl.java trunk/src/app/net/sf/gridarta/GlobalSettings.java trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java trunk/src/app/net/sf/gridarta/gameobject/Collectable.java trunk/src/app/net/sf/gridarta/gameobject/Collector.java trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/scripts/DefaultScriptArchEditor.java trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java trunk/src/app/net/sf/gridarta/gui/MainActions.java trunk/src/app/net/sf/gridarta/io/PathManager.java trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java Modified: trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java =================================================================== --- trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/crossfire/src/cfeditor/GlobalSettingsImpl.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -81,19 +81,19 @@ /** (Re-)initializes the directories. */ public void initDirs() { - setMapDefaultFolder(prefs.get(ResourceFileManager.MAP_DIR_KEY, ResourceFileManager.DEFAULT_MAP_DIR)); - setArchDefaultFolder(prefs.get(ResourceFileManager.ARCH_DIR_KEY, ResourceFileManager.DEFAULT_ARCH_DIR)); - setScriptDefaultFolder(prefs.get(ResourceFileManager.SCRIPT_DIR_KEY, ResourceFileManager.DEFAULT_SCRIPT_DIR)); + setMapsDirectory(prefs.get(ResourceFileManager.MAP_DIR_KEY, ResourceFileManager.DEFAULT_MAP_DIR)); + setArchDirectory(prefs.get(ResourceFileManager.ARCH_DIR_KEY, ResourceFileManager.DEFAULT_ARCH_DIR)); + setScriptDirectory(prefs.get(ResourceFileManager.SCRIPT_DIR_KEY, ResourceFileManager.DEFAULT_SCRIPT_DIR)); // set map dir - if (getMapDefaultFolder().length() > 0) { - setMapDir(new File(getMapDefaultFolder())); + if (getMapsDirectory().length() > 0) { + setMapDir(new File(getMapsDirectory())); } else { // if map dir not set, default to current dir - if (!getCurrentDir().exists()) { + if (!getCurrentDirectory().exists()) { log.error("in readGlobalSettings(): current dir doesn't exist!"); } - setMapDir(new File(getCurrentDir().getAbsolutePath())); + setMapDir(new File(getCurrentDirectory().getAbsolutePath())); } finishInitDirs(); } Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -74,8 +74,8 @@ } /** {@inheritDoc} Collects the Archetypes. */ - public void collect(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException { - final File dfile = new File(dir, IGUIConstants.ARCH_FILE); + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { + final File dfile = new File(collectedDirectory, IGUIConstants.ARCH_FILE); // now open the output-stream final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dfile), IOUtils.MAP_ENCODING)); try { Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -167,7 +167,7 @@ } else { FaceObjectProviders.setNormal(new ArchFaceProvider()); archetypeSet.setLoadedFromArchive(false); // don't load from the collected files - fname = globalSettings.getArchDefaultFolder(); + fname = globalSettings.getArchDirectory(); final File dir = new File(fname); loadArchetypesFromFiles(archetypeParser, dir, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files } Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -78,20 +78,20 @@ } /** {@inheritDoc} */ - public void collect(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException { + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); - collectAnims(progress, dir); - collectAnimTree(progress, dir); + collectAnims(progress, collectedDirectory); + collectAnimTree(progress, collectedDirectory); } /** * Collects the animation data into the file "animations". * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. + * @param collectedDirectory the destination directory to collect data to * @throws IOException in case of I/O problems during collection */ - private void collectAnims(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, "animations")), IOUtils.MAP_ENCODING)); + private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); try { int counter = 0; // counter for progress bar for (final AnimationObject anim : this) { @@ -113,11 +113,11 @@ /** * Collects the animation data into the file "animations". * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. + * @param collectedDirectory the destination directory to collect data to * @throws IOException in case of I/O problems during collection */ - private void collectAnimTree(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, IGUIConstants.ANIMTREE_FILE)), IOUtils.MAP_ENCODING)); + private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, IGUIConstants.ANIMTREE_FILE)), IOUtils.MAP_ENCODING)); try { int counter = 0; // counter for progress bar for (final AnimationObject anim : this) { Modified: trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/crossfire/src/cfeditor/gui/prefs/ResPrefs.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -118,9 +118,9 @@ /** {@inheritDoc} */ public void revert() { - archField.setText(globalSettings.getArchDefaultFolder()); - mapField.setText(globalSettings.getMapDefaultFolder()); - scriptField.setText(globalSettings.getScriptDefaultFolder()); + archField.setText(globalSettings.getArchDirectory()); + mapField.setText(globalSettings.getMapsDirectory()); + scriptField.setText(globalSettings.getScriptDirectory()); loadArches.setSelected(globalSettings.isArchLoadedFromCollection()); imageSetBox.setSelectedIndex(linearSearch(imageSets, getCurrentImageSet())); } @@ -139,9 +139,9 @@ final String selectedimageSet = (String) imageSetBox.getSelectedItem(); final String imageSet = selectedimageSet == null ? "disabled" : selectedimageSet; return !( - archField.getText().equals(globalSettings.getArchDefaultFolder()) - && mapField.getText().equals(globalSettings.getMapDefaultFolder()) - && scriptField.getText().equals(globalSettings.getScriptDefaultFolder()) + archField.getText().equals(globalSettings.getArchDirectory()) + && mapField.getText().equals(globalSettings.getMapsDirectory()) + && scriptField.getText().equals(globalSettings.getScriptDirectory()) && loadArches.isSelected() == prefs.getBoolean(GlobalSettings.LOAD_ARCH_COLL, globalSettings.isArchLoadedFromCollection()) && imageSet.equals(getCurrentImageSet()) ); @@ -170,9 +170,9 @@ private Component createResourcePanel() { final Box resourcePanel = Box.createVerticalBox(); resourcePanel.setBorder(createTitledBorder("optionsResPaths")); - archField = createFileField(resourcePanel, "optionsResArch", globalSettings.getArchDefaultFolder(), JFileChooser.DIRECTORIES_ONLY); - mapField = createFileField(resourcePanel, "optionsResMaps", globalSettings.getMapDefaultFolder(), JFileChooser.DIRECTORIES_ONLY); - scriptField = createFileField(resourcePanel, "optionsResScripts", globalSettings.getScriptDefaultFolder(), JFileChooser.DIRECTORIES_ONLY); + archField = createFileField(resourcePanel, "optionsResArch", globalSettings.getArchDirectory(), JFileChooser.DIRECTORIES_ONLY); + mapField = createFileField(resourcePanel, "optionsResMaps", globalSettings.getMapsDirectory(), JFileChooser.DIRECTORIES_ONLY); + scriptField = createFileField(resourcePanel, "optionsResScripts", globalSettings.getScriptDirectory(), JFileChooser.DIRECTORIES_ONLY); return resourcePanel; } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -295,7 +295,7 @@ protected CFTreasureListTree<GameObject, MapArchObject, Archetype> createTreasureListTree(@NotNull final GlobalSettings globalSettings, @NotNull final net.sf.gridarta.gameobject.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final Map<String, TreasureTreeNode> specialTreasureLists) { return new CFTreasureListTree<GameObject, MapArchObject, Archetype>(getMainView(), archetypeSet, specialTreasureLists, new TreasureLocation(globalSettings.getCollectedDirectory(), IGUIConstants.TREASURES_FILE), - new TreasureLocation(globalSettings.getMapDefaultFolder(), null) + new TreasureLocation(globalSettings.getMapsDirectory(), null) ); } Modified: trunk/daimonin/src/daieditor/GlobalSettingsImpl.java =================================================================== --- trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/daimonin/src/daieditor/GlobalSettingsImpl.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -39,19 +39,19 @@ /** {@inheritDoc} */ @NotNull public File getPickmapDir() { - return new File(getArchDefaultFolder(), IGUIConstants.PICKMAP_DIR); + return new File(getArchDirectory(), IGUIConstants.PICKMAP_DIR); } /** {@inheritDoc} */ @NotNull public String getConfigurationDirectory() { - return getArchDefaultFolder() + "/dev/editor/conf"; + return getArchDirectory() + "/dev/editor/conf"; } /** {@inheritDoc} */ @NotNull public String getCollectedDirectory() { - return getArchDefaultFolder(); + return getArchDirectory(); } /** {@inheritDoc} */ @@ -65,11 +65,11 @@ /** (Re-)initializes the directories. */ public void initDirs() { - setMapDefaultFolder(prefs.get(ResourceFileManager.MAP_DIR_KEY, ResourceFileManager.DEFAULT_MAP_DIR)); - setArchDefaultFolder(prefs.get(ResourceFileManager.ARCH_DIR_KEY, ResourceFileManager.DEFAULT_ARCH_DIR)); - setScriptDefaultFolder(prefs.get(ResourceFileManager.SCRIPT_DIR_KEY, ResourceFileManager.DEFAULT_SCRIPT_DIR)); + setMapsDirectory(prefs.get(ResourceFileManager.MAP_DIR_KEY, ResourceFileManager.DEFAULT_MAP_DIR)); + setArchDirectory(prefs.get(ResourceFileManager.ARCH_DIR_KEY, ResourceFileManager.DEFAULT_ARCH_DIR)); + setScriptDirectory(prefs.get(ResourceFileManager.SCRIPT_DIR_KEY, ResourceFileManager.DEFAULT_SCRIPT_DIR)); mediaDir = prefs.get(ResourceFileManager.MEDIA_DIR_KEY, ResourceFileManager.DEFAULT_MEDIA_DIR); - setMapDir(new File(getMapDefaultFolder())); + setMapDir(new File(getMapsDirectory())); finishInitDirs(); } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -98,8 +98,8 @@ } /** {@inheritDoc} Collects the Archetypes. */ - public void collect(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException { - final File dfile = new File(dir, IGUIConstants.ARCH_FILE); + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { + final File dfile = new File(collectedDirectory, IGUIConstants.ARCH_FILE); // now open the output-stream final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dfile), IOUtils.MAP_ENCODING)); try { Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -184,7 +184,7 @@ FaceObjectProviders.setNormal(new ArchFaceProvider()); archetypeSet.setLoadedFromArchive(false); // don't load from the collected files animFiles = new ArrayList<File>(); - fname = globalSettings.getArchDefaultFolder(); + fname = globalSettings.getArchDirectory(); final File dir = new File(fname); addPNGFace(dir, new File(dir, "dev/editor/bug.101.png").getAbsolutePath(), "bug.101.png", parent); loadArchetypesFromFiles(archetypeParser, dir, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files @@ -193,7 +193,7 @@ archetypeSet.reportErrors(parent); loadArchesFromArtifacts(archetypeParser, collectedDirectory + "/" + IGUIConstants.ARTIFACTS_FILE, "Artifacts", "artifacts", invObjects); - loadArchesFromArtifacts(archetypeParser, globalSettings.getMapDefaultFolder(), "Artifacts", "maps", invObjects); + loadArchesFromArtifacts(archetypeParser, globalSettings.getMapsDirectory(), "Artifacts", "maps", invObjects); gameObjectParser.collectTempList(parent, archetypeSet, editTypes, invObjects, fname, true); archetypeSet.connectFaces(); // attach faces to arches Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -76,20 +76,20 @@ * "animations". The tree information for the editor is written to * "animtree". */ - public void collect(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException { + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); - collectAnims(progress, dir); - collectAnimTree(progress, dir); + collectAnims(progress, collectedDirectory); + collectAnimTree(progress, collectedDirectory); } /** * Collects the animation data into the file "animations". * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. + * @param collectedDirectory Destination directory to collect data to. * @throws IOException in case of I/O problems during collection */ - private void collectAnims(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, "animations")), IOUtils.MAP_ENCODING)); + private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); try { int counter = 0; // counter for progress bar for (final AnimationObject anim : this) { @@ -111,11 +111,11 @@ /** * Collects the animation data into the file "animations". * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. + * @param collectedDirectory Destination directory to collect data to. * @throws IOException in case of I/O problems during collection */ - private void collectAnimTree(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, IGUIConstants.ANIMTREE_FILE)), IOUtils.MAP_ENCODING)); + private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, IGUIConstants.ANIMTREE_FILE)), IOUtils.MAP_ENCODING)); try { int counter = 0; // counter for progress bar for (final AnimationObject anim : this) { Modified: trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java =================================================================== --- trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/daimonin/src/daieditor/gui/prefs/ResPrefs.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -109,9 +109,9 @@ /** {@inheritDoc} */ public void revert() { - archField.setText(globalSettings.getArchDefaultFolder()); - mapField.setText(globalSettings.getMapDefaultFolder()); - scriptField.setText(globalSettings.getScriptDefaultFolder()); + archField.setText(globalSettings.getArchDirectory()); + mapField.setText(globalSettings.getMapsDirectory()); + scriptField.setText(globalSettings.getScriptDirectory()); mediaField.setText(globalSettings.getMediaDefaultFolder()); loadArches.setSelected(globalSettings.isArchLoadedFromCollection()); } @@ -127,9 +127,9 @@ /** {@inheritDoc} */ public boolean isChanged() { return !( - archField.getText().equals(globalSettings.getArchDefaultFolder()) - && mapField.getText().equals(globalSettings.getMapDefaultFolder()) - && scriptField.getText().equals(globalSettings.getScriptDefaultFolder()) + archField.getText().equals(globalSettings.getArchDirectory()) + && mapField.getText().equals(globalSettings.getMapsDirectory()) + && scriptField.getText().equals(globalSettings.getScriptDirectory()) && mediaField.getText().equals(globalSettings.getMediaDefaultFolder()) && loadArches.isSelected() == prefs.getBoolean(GlobalSettings.LOAD_ARCH_COLL, globalSettings.isArchLoadedFromCollection()) ); @@ -158,9 +158,9 @@ private Component createResourcePanel() { final Box resourcePanel = Box.createVerticalBox(); resourcePanel.setBorder(createTitledBorder("optionsResPaths")); - archField = createFileField(resourcePanel, "optionsResArch", globalSettings.getArchDefaultFolder(), JFileChooser.DIRECTORIES_ONLY); - mapField = createFileField(resourcePanel, "optionsResMaps", globalSettings.getMapDefaultFolder(), JFileChooser.DIRECTORIES_ONLY); - scriptField = createFileField(resourcePanel, "optionsResScripts", globalSettings.getScriptDefaultFolder(), JFileChooser.DIRECTORIES_ONLY); + archField = createFileField(resourcePanel, "optionsResArch", globalSettings.getArchDirectory(), JFileChooser.DIRECTORIES_ONLY); + mapField = createFileField(resourcePanel, "optionsResMaps", globalSettings.getMapsDirectory(), JFileChooser.DIRECTORIES_ONLY); + scriptField = createFileField(resourcePanel, "optionsResScripts", globalSettings.getScriptDirectory(), JFileChooser.DIRECTORIES_ONLY); mediaField = createFileField(resourcePanel, "optionsResMedia", globalSettings.getMediaDefaultFolder(), JFileChooser.DIRECTORIES_ONLY); return resourcePanel; } Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -383,7 +383,7 @@ new UndoControl<G, A, R, V>(mapManager); final UpdaterManager updaterManager = new UpdaterManager(key, this, mapManager, mainView, gridartaJarFilename); updaterManager.startup(); - ScriptEditControlInstance.init(scriptFileFilter, scriptExtension, mainView, new File(globalSettings.getMapDefaultFolder()), Preferences.userNodeForPackage(MainControl.class)); + ScriptEditControlInstance.init(scriptFileFilter, scriptExtension, mainView, new File(globalSettings.getMapsDirectory()), Preferences.userNodeForPackage(MainControl.class)); final XmlHelper xmlHelper; try { xmlHelper = new XmlHelper(mainView); @@ -614,12 +614,12 @@ /** {@inheritDoc} */ public void createImage(@NotNull final MapView<G, A, R, V> mapView) { - if (globalSettings.getImageDir() == null) { - globalSettings.setImageDir(globalSettings.getMapDir().getAbsolutePath()); + if (globalSettings.getImageDirectory() == null) { + globalSettings.setImageDirectory(globalSettings.getMapDir().getAbsolutePath()); } - final File file = new File(globalSettings.getImageDir(), mapView.getMapControl().getMapFileName() + ".png"); - final JFileChooser fileChooser = new JFileChooser(globalSettings.getImageDir()); + final File file = new File(globalSettings.getImageDirectory(), mapView.getMapControl().getMapFileName() + ".png"); + final JFileChooser fileChooser = new JFileChooser(globalSettings.getImageDirectory()); fileChooser.setDialogTitle("Save Image As"); fileChooser.setFileSelectionMode(JFileChooser.FILES_ONLY); fileChooser.setMultiSelectionEnabled(false); @@ -634,7 +634,7 @@ if (!imageFile.getName().endsWith(".png")) { imageFile = new File(imageFile.getParentFile(), imageFile.getName() + ".png"); } - globalSettings.setImageDir(imageFile.getParentFile().getAbsolutePath()); + globalSettings.setImageDirectory(imageFile.getParentFile().getAbsolutePath()); if (!imageFile.exists() || ACTION_FACTORY.showConfirmDialog(mainView, JOptionPane.YES_NO_OPTION, JOptionPane.WARNING_MESSAGE, "overwriteOtherFile", imageFile) == JOptionPane.YES_OPTION) { try { mapView.getMapViewBasic().getRenderer().printFullImage(imageFile); Modified: trunk/src/app/net/sf/gridarta/FileControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/FileControl.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/FileControl.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -182,8 +182,8 @@ // default folder is the map-folder at first time, then the active folder if (!globalSettings.hasChangedDir() && globalSettings.getMapDir().exists()) { fileChooser.setCurrentDirectory(globalSettings.getMapDir()); - } else if (globalSettings.getCurrentDir().exists()) { - fileChooser.setCurrentDirectory(globalSettings.getCurrentDir()); + } else if (globalSettings.getCurrentDirectory().exists()) { + fileChooser.setCurrentDirectory(globalSettings.getCurrentDirectory()); } // if file already exists, select it @@ -204,7 +204,7 @@ if (!file.exists() || ACTION_FACTORY.showConfirmDialog(parent, JOptionPane.WARNING_MESSAGE, JOptionPane.OK_CANCEL_OPTION, "overwriteOtherFile", file.getName()) == JOptionPane.OK_OPTION) { mapControl.saveAs(file); - globalSettings.setCurrentDir(fileChooser.getCurrentDirectory()); + globalSettings.setCurrentDirectory(fileChooser.getCurrentDirectory()); } return true; } @@ -221,7 +221,7 @@ if (isScriptFile) { ScriptEditControlInstance.getInstance().openScriptFile(file.getAbsolutePath()); } else { - globalSettings.setCurrentDir(dir); + globalSettings.setCurrentDirectory(dir); mapManager.openMapFileWithView(file, null); } } else if (!file.exists()) { Modified: trunk/src/app/net/sf/gridarta/GlobalSettings.java =================================================================== --- trunk/src/app/net/sf/gridarta/GlobalSettings.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/GlobalSettings.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -29,16 +29,16 @@ String USE_IMAGESET = "useImageSet"; /** - * Get the default folder of arches. - * @return default folder of arches. + * Returns the archetype directory. + * @return the archetype directory */ - String getArchDefaultFolder(); + String getArchDirectory(); /** * Get the default folder of maps. * @return default folder of maps. */ - String getMapDefaultFolder(); + String getMapsDirectory(); /** * Get the map directory. @@ -51,11 +51,11 @@ * Get the default folder of scripts. * @return default folder of scripts. */ - String getScriptDefaultFolder(); + String getScriptDirectory(); - void setImageDir(String imageDir); + void setImageDirectory(String imageDir); - String getImageDir(); + String getImageDirectory(); boolean isArchLoadedFromCollection(); @@ -73,10 +73,10 @@ /** {@inheritDoc} */ void setAutoPopupDocu(boolean autoPopupDocu); - File getCurrentDir(); + File getCurrentDirectory(); /** {@inheritDoc} */ - void setCurrentDir(File currentDir); + void setCurrentDirectory(File currentDir); /** * Returns the pickmap directory. Modified: trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java =================================================================== --- trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/GlobalSettingsImpl.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -34,19 +34,19 @@ /** Preferences. */ protected static final Preferences prefs = Preferences.userNodeForPackage(MainControl.class); - private String archDefaultFolder; + private String archDirectory; - private String mapDefaultFolder; + private String mapsDirectory; @NotNull private File mapDir; - private String scriptDefaultFolder; + private String scriptDirectory; /** The current main directory. */ - private File currentDir = new File(System.getProperty("user.dir")); + private File currentDirectory = new File(System.getProperty("user.dir")); - private String imageDir; + private String imageDirectory; /** Do we load arches from the collected archives. */ private boolean loadFromArchive = true; @@ -61,21 +61,21 @@ private boolean autoPopupDocu = false; /** {@inheritDoc} */ - public String getArchDefaultFolder() { - return archDefaultFolder; + public String getArchDirectory() { + return archDirectory; } - protected void setArchDefaultFolder(final String archDefaultFolder) { - this.archDefaultFolder = archDefaultFolder; + protected void setArchDirectory(final String archDirectory) { + this.archDirectory = archDirectory; } /** {@inheritDoc} */ - public String getMapDefaultFolder() { - return mapDefaultFolder; + public String getMapsDirectory() { + return mapsDirectory; } - protected void setMapDefaultFolder(final String mapDefaultFolder) { - this.mapDefaultFolder = mapDefaultFolder; + protected void setMapsDirectory(final String mapsDirectory) { + this.mapsDirectory = mapsDirectory; } /** {@inheritDoc} */ @@ -89,30 +89,30 @@ } /** {@inheritDoc} */ - public String getScriptDefaultFolder() { - return scriptDefaultFolder; + public String getScriptDirectory() { + return scriptDirectory; } - protected void setScriptDefaultFolder(final String scriptDefaultFolder) { - this.scriptDefaultFolder = scriptDefaultFolder; + protected void setScriptDirectory(final String scriptDirectory) { + this.scriptDirectory = scriptDirectory; } /** {@inheritDoc} */ - public File getCurrentDir() { - return currentDir; + public File getCurrentDirectory() { + return currentDirectory; } /** {@inheritDoc} */ - public void setCurrentDir(final File currentDir) { - this.currentDir = currentDir; + public void setCurrentDirectory(final File currentDirectory) { + this.currentDirectory = currentDirectory; } - public String getImageDir() { - return imageDir; + public String getImageDirectory() { + return imageDirectory; } - public void setImageDir(final String imageDir) { - this.imageDir = imageDir; + public void setImageDirectory(final String imageDirectory) { + this.imageDirectory = imageDirectory; } /** {@inheritDoc} */ @@ -156,8 +156,8 @@ protected void finishInitDirs() { // if mapdir has no absolute path, set it now - if (currentDir.exists() && mapDir.getParent() == null && !mapDir.isAbsolute() && !hasChangedDir()) { - mapDir = new File(currentDir.getAbsolutePath(), mapDir.getPath()); + if (currentDirectory.exists() && mapDir.getParent() == null && !mapDir.isAbsolute() && !hasChangedDir()) { + mapDir = new File(currentDirectory.getAbsolutePath(), mapDir.getPath()); } } Modified: trunk/src/app/net/sf/gridarta/gameobject/Collectable.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Collectable.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/gameobject/Collectable.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -35,11 +35,11 @@ /** * Collect information. * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. - * @param baseDir the base directory from where the archetypes has been - * collected + * @param collectedDirectory the destination directory to collect data to + * @param archDirectory the base directory from where the archetypes have + * been collected * @throws IOException in case of I/O problems during collection */ - void collect(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException; + void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException; } // interface Collectable Modified: trunk/src/app/net/sf/gridarta/gameobject/Collector.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/gameobject/Collector.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -42,10 +42,10 @@ private final List<Collectable> collectables = new ArrayList<Collectable>(); /** The archetype directory to collect from. */ - private File archDir; + private File archDirectory; /** The destination directory to write files to. */ - private File destDir; + private File collectedDirectory; /** The Progress to use. */ private final Progress progress; @@ -73,18 +73,18 @@ /** * Sets the destination directory to write files to. - * @param destDir Destination directory to write files to. + * @param collectedDirectory the destination directory to write files to */ - public void setDestDir(final File destDir) { - this.destDir = destDir; + public void setCollectedDirectory(final File collectedDirectory) { + this.collectedDirectory = collectedDirectory; } /** * Sets the archetype directory to collect from to. - * @param archDir the archetype directory + * @param archDirectory the archetype directory */ - public void setArchDir(final File archDir) { - this.archDir = archDir; + public void setArchDirectory(final File archDirectory) { + this.archDirectory = archDirectory; } /** Starts collecting. */ @@ -121,7 +121,7 @@ try { for (final Collectable collectable : collectables) { try { - collectable.collect(progress, destDir, archDir); + collectable.collect(progress, collectedDirectory, archDirectory); } catch (final IOException e) { ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectErrorIOException", "arches, animations and animtree, images", e); } Modified: trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -126,20 +126,20 @@ * Java image encoder isn't as good as that of gimp in many cases (yet much * better as the old visualtek's). */ - public void collect(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException { - collectTreeFile(progress, dir, baseDir); - collectBmapsFile(progress, dir); - collectImageFile(progress, dir); + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { + collectTreeFile(progress, collectedDirectory, archDirectory); + collectBmapsFile(progress, collectedDirectory); + collectImageFile(progress, collectedDirectory); } /** * Creates the image file. * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. + * @param collectedDirectory the destination directory to collect data to * @throws IOException in case of I/O problems during collection */ - private void collectImageFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final File dfile = new File(dir, pngFile); + private void collectImageFile(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final File dfile = new File(collectedDirectory, pngFile); final FileOutputStream fout = new FileOutputStream(dfile); //It's safely closed because the stream is closed and that closes the channel. //noinspection ChannelOpenedButNotSafelyClosed @@ -186,14 +186,14 @@ /** * Creates the tree file. * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. - * @param baseDir the base directory from where the archetypes has been - * collected + * @param collectedDirectory the destination directory to collect data to + * @param archDirectory the base directory from where the archetypes have + * been collected * @throws IOException in case of I/O problems during collection */ - private void collectTreeFile(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException { - final int stripPath = baseDir.getAbsolutePath().length(); - final BufferedWriter treeFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(dir, faceTreeFile)), "us-ascii")); + private void collectTreeFile(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { + final int stripPath = archDirectory.getAbsolutePath().length(); + final BufferedWriter treeFile = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, faceTreeFile)), "us-ascii")); try { final int numOfFaceObjects = size(); progress.setLabel(ACTION_FACTORY.getString("archCollectTree"), numOfFaceObjects); @@ -201,7 +201,7 @@ for (final FaceObject faceObject : this) { final String face = faceObject.getFaceName(); final String path = ((ArchFaceProvider) FaceObjectProviders.normal).getFilename(face); - assert path.startsWith(baseDir.getAbsolutePath()); + assert path.startsWith(archDirectory.getAbsolutePath()); assert path.endsWith(".png"); final String name = path.substring(stripPath, path.length() - 4).replace('\\', '/'); treeFile.append(String.format(faceTreeOutputFormat, i, name)).append('\n'); @@ -218,11 +218,11 @@ /** * Creates the bmaps file. * @param progress Progress to report progress to. - * @param dir Destination directory to collect data to. + * @param collectedDirectory the destination directory to collect data to * @throws IOException in case of I/O problems during collection */ - protected void collectBmapsFile(@NotNull final Progress progress, @NotNull final File dir) throws IOException { - final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(dir, CommonConstants.BMAPS_FILE))), false); + protected void collectBmapsFile(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final PrintWriter textFile = new PrintWriter(new BufferedWriter(new FileWriter(new File(collectedDirectory, CommonConstants.BMAPS_FILE))), false); try { final int numOfFaceObjects = size(); progress.setLabel(ACTION_FACTORY.getString("archCollectBmaps"), numOfFaceObjects); Modified: trunk/src/app/net/sf/gridarta/gameobject/scripts/DefaultScriptArchEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/scripts/DefaultScriptArchEditor.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/gameobject/scripts/DefaultScriptArchEditor.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -180,7 +180,7 @@ if (fileChooser.showOpenDialog(newScriptFrame) == JFileChooser.APPROVE_OPTION) { // user has selected a file final File f = fileChooser.getSelectedFile(); - inputScriptPath.setText(ScriptUtils.localizeEventPath(mapManager.getLocalMapDir(), f, new File(globalSettings.getMapDefaultFolder()))); + inputScriptPath.setText(ScriptUtils.localizeEventPath(mapManager.getLocalMapDir(), f, new File(globalSettings.getMapsDirectory()))); } } }); @@ -259,7 +259,7 @@ String absScriptPath; if (scriptPath.startsWith("/")) { // script path is absolute - final File mapDir = new File(globalSettings.getMapDefaultFolder()); // global map directory + final File mapDir = new File(globalSettings.getMapsDirectory()); // global map directory if (!mapDir.exists()) { // if map dir doesn't exist, this is not going to work frame.setVisible(false); Modified: trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/gameobject/scripts/ScriptedEventEditor.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -83,7 +83,7 @@ final StringBuilder tmpPath = new StringBuilder(); if (scriptPath.startsWith("/")) { // filepath is absolue (to map base directory): - tmpPath.append(globalSettings.getMapDefaultFolder()); + tmpPath.append(globalSettings.getMapsDirectory()); tmpPath.append(scriptPath); } else { // file path is relative to map dir Modified: trunk/src/app/net/sf/gridarta/gui/MainActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/MainActions.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/gui/MainActions.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -665,8 +665,8 @@ collectables.add(animationObjects); collectables.add(faceObjects); collector.setCollectables(collectables); - collector.setDestDir(new File(globalSettings.getCollectedDirectory())); - collector.setArchDir(new File(globalSettings.getArchDefaultFolder())); + collector.setCollectedDirectory(new File(globalSettings.getCollectedDirectory())); + collector.setArchDirectory(new File(globalSettings.getArchDirectory())); collector.start(); aCollectArches.setEnabled(isCollectArchesEnabled()); } Modified: trunk/src/app/net/sf/gridarta/io/PathManager.java =================================================================== --- trunk/src/app/net/sf/gridarta/io/PathManager.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/app/net/sf/gridarta/io/PathManager.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -62,7 +62,7 @@ * @return fixed path */ public static String getArchPath(final String path) { - final String archDirName = globalSettings.getArchDefaultFolder(); + final String archDirName = globalSettings.getArchDirectory(); String archPath = path.replace('\\', '/'); if (archPath.startsWith(archDirName)) { archPath = archPath.substring(archDirName.length()); @@ -82,7 +82,7 @@ * @return fixed path */ public static String getMapPath(final String path) { - final String mapDirName = globalSettings.getMapDefaultFolder(); + final String mapDirName = globalSettings.getMapsDirectory(); String mapPath = path.replace('\\', '/'); if (mapPath.startsWith(mapDirName)) { mapPath = mapPath.substring(mapDirName.length()); Modified: trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java =================================================================== --- trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-10-28 19:26:36 UTC (rev 5598) +++ trunk/src/test/net/sf/gridarta/map/DefaultMapModelTest.java 2008-10-28 19:42:18 UTC (rev 5599) @@ -802,7 +802,7 @@ } /** {@inheritDoc} */ - public void collect(@NotNull final Progress progress, @NotNull final File dir, @NotNull final File baseDir) throws IOException { + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { throw new AssertionError(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-28 20:09:50
|
Revision: 5600 http://gridarta.svn.sourceforge.net/gridarta/?rev=5600&view=rev Author: akirschbaum Date: 2008-10-28 20:09:47 +0000 (Tue, 28 Oct 2008) Log Message: ----------- Load correct facetree file in "collected" mode. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java trunk/daimonin/ChangeLog trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-10-28 19:42:18 UTC (rev 5599) +++ trunk/crossfire/ChangeLog 2008-10-28 20:09:47 UTC (rev 5600) @@ -1,3 +1,7 @@ +2008-10-28 Andreas Kirschbaum + + * Load correct facetree file in "collected" mode. + 2008-10-26 Andreas Kirschbaum * Collect animtree file. Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-28 19:42:18 UTC (rev 5599) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-28 20:09:47 UTC (rev 5600) @@ -279,7 +279,7 @@ /** {@inheritDoc} */ @Override protected void init4(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final EditTypes editTypes, @NotNull final FaceObjects faceObjects, @NotNull final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final GlobalSettings globalSettings, @NotNull final net.sf.gridarta.gameobject.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { - new ArchetypeSetLoader(globalSettings, gameObjectParser, globalSettings.getCollectedDirectory(), globalSettings.getConfigurationDirectory(), archetypeSet, archetypeParser, editTypes, faceObjects, animationObjects, this).loadArchetypes(mainView); + new ArchetypeSetLoader(globalSettings, gameObjectParser, globalSettings.getCollectedDirectory(), archetypeSet, archetypeParser, editTypes, faceObjects, animationObjects, this).loadArchetypes(mainView); } /** {@inheritDoc} */ Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-28 19:42:18 UTC (rev 5599) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-28 20:09:47 UTC (rev 5600) @@ -85,12 +85,6 @@ private final String collectedDirectory; /** - * The configuration directory. - */ - @NotNull - private final String configurationDirectory; - - /** * The archetype set to update. */ @NotNull @@ -125,7 +119,6 @@ * @param globalSettings the global settings instance * @param gameObjectParser the game object parser instance * @param collectedDirectory the collected directory - * @param configurationDirectory the configuration directory * @param archetypeSet the archetype set to update * @param archetypeParser the archetype parser to use * @param editTypes the edit types instance @@ -133,12 +126,11 @@ * @param animationObjects the animation objects instance * @param throwableHandler the throwable handler to use */ - public ArchetypeSetLoader(@NotNull final GlobalSettings globalSettings, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final String collectedDirectory, @NotNull final String configurationDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final EditTypes editTypes, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final ThrowableHandler<Throwable> throwableHandler) { + public ArchetypeSetLoader(@NotNull final GlobalSettings globalSettings, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final String collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final EditTypes editTypes, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final ThrowableHandler<Throwable> throwableHandler) { super(collectedDirectory, animationObjects, throwableHandler, faceObjects); this.globalSettings = globalSettings; this.gameObjectParser = gameObjectParser; this.collectedDirectory = collectedDirectory; - this.configurationDirectory = configurationDirectory; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; this.editTypes = editTypes; @@ -208,7 +200,7 @@ } finally { stream.close(); } - faceObjects.loadFacesCollection(new File(collectedDirectory, IGUIConstants.PNG_FILE), new File(configurationDirectory, IGUIConstants.FACETREE_FILE)); + faceObjects.loadFacesCollection(new File(collectedDirectory, IGUIConstants.PNG_FILE), new File(collectedDirectory, IGUIConstants.FACETREE_FILE)); } catch (final IOException e) { // TODO log.error("Error:", e); Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-10-28 19:42:18 UTC (rev 5599) +++ trunk/daimonin/ChangeLog 2008-10-28 20:09:47 UTC (rev 5600) @@ -1,6 +1,6 @@ 2008-10-28 Andreas Kirschbaum - * Load correct animtree file in "collected" mode. + * Load correct animtree and facetree files in "collected" mode. 2008-10-23 Andreas Kirschbaum Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-10-28 19:42:18 UTC (rev 5599) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-10-28 20:09:47 UTC (rev 5600) @@ -321,7 +321,7 @@ @Override protected void init4(@NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final EditTypes editTypes, @NotNull final FaceObjects faceObjects, @NotNull final net.sf.gridarta.gameobject.anim.AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final MainView<GameObject, MapArchObject, Archetype, CMapViewBasic> mainView, @NotNull final GlobalSettings globalSettings, @NotNull final net.sf.gridarta.gameobject.ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { MultiPositionData.init(globalSettings.getConfigurationDirectory()); - new ArchetypeSetLoader(globalSettings, gameObjectParser, globalSettings.getCollectedDirectory(), globalSettings.getConfigurationDirectory(), archetypeSet, archetypeParser, editTypes, faceObjects, animationObjects, this).loadArchetypes(mainView); + new ArchetypeSetLoader(globalSettings, gameObjectParser, globalSettings.getCollectedDirectory(), archetypeSet, archetypeParser, editTypes, faceObjects, animationObjects, this).loadArchetypes(mainView); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-28 19:42:18 UTC (rev 5599) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-28 20:09:47 UTC (rev 5600) @@ -87,12 +87,6 @@ private final String collectedDirectory; /** - * The configuration directory. - */ - @NotNull - private final String configurationDirectory; - - /** * The archetype set to update. */ @NotNull @@ -140,7 +134,6 @@ * @param globalSettings the global settings instance * @param gameObjectParser the game object parser instance * @param collectedDirectory the collected directory - * @param configurationDirectory the configuration directory * @param archetypeSet the archetype set to update * @param archetypeParser the archetype parser to use * @param editTypes the edit types instance @@ -148,12 +141,11 @@ * @param animationObjects the animation objects instance * @param throwableHandler the throwable handler to use */ - public ArchetypeSetLoader(@NotNull final GlobalSettings globalSettings, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final String collectedDirectory, @NotNull final String configurationDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final EditTypes editTypes, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final ThrowableHandler<Throwable> throwableHandler) { + public ArchetypeSetLoader(@NotNull final GlobalSettings globalSettings, @NotNull final GameObjectParser<GameObject, MapArchObject, Archetype> gameObjectParser, @NotNull final String collectedDirectory, @NotNull final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet, @NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final EditTypes editTypes, @NotNull final FaceObjects faceObjects, @NotNull final AnimationObjects<? extends AnimationObject> animationObjects, @NotNull final ThrowableHandler<Throwable> throwableHandler) { super(collectedDirectory, animationObjects, throwableHandler, faceObjects); this.globalSettings = globalSettings; this.gameObjectParser = gameObjectParser; this.collectedDirectory = collectedDirectory; - this.configurationDirectory = configurationDirectory; this.archetypeSet = archetypeSet; this.archetypeParser = archetypeParser; this.editTypes = editTypes; @@ -231,7 +223,7 @@ } finally { stream.close(); } - faceObjects.loadFacesCollection(new File(collectedDirectory, IGUIConstants.PNG_FILE), new File(configurationDirectory, IGUIConstants.FACETREE_FILE)); + faceObjects.loadFacesCollection(new File(collectedDirectory, IGUIConstants.PNG_FILE), new File(collectedDirectory, IGUIConstants.FACETREE_FILE)); } catch (final IOException e) { // TODO log.error("Error:", e); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-29 15:49:11
|
Revision: 5601 http://gridarta.svn.sourceforge.net/gridarta/?rev=5601&view=rev Author: akirschbaum Date: 2008-10-29 15:48:52 +0000 (Wed, 29 Oct 2008) Log Message: ----------- Make animation collection process more robust (remove assumptions about source path names). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/utils/Pair.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-28 20:09:47 UTC (rev 5600) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-29 15:48:52 UTC (rev 5601) @@ -50,6 +50,7 @@ import net.sf.japi.util.ThrowableHandler; import org.apache.log4j.Logger; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Loader for archetype files. @@ -161,7 +162,7 @@ archetypeSet.setLoadedFromArchive(false); // don't load from the collected files fname = globalSettings.getArchDirectory(); final File dir = new File(fname); - loadArchetypesFromFiles(archetypeParser, dir, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files + loadArchetypesFromFiles(archetypeParser, dir, null, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files } archetypeSet.reportErrors(parent); @@ -214,6 +215,7 @@ * <code>arch/</code> directory tree. * @param archetypeParser the archetype parser to use * @param baseDir the base directory to strip from filenames + * @param path the base directory relative path of <code>f</code> * @param f file path where we currently are * @param folderLevel level of the folder * @param panelName the panel to add archetypes to @@ -223,7 +225,7 @@ * @param invObjects collects all inventory objects * @param parent the parent component for error messages */ - private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final File baseDir, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { + private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final File baseDir, @Nullable final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels @@ -233,8 +235,9 @@ Arrays.sort(entries); final String thisPanelName = folderLevel == 1 ? name : panelName; final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; + final String newPath = path == null ? "" : path + "/" + name; for (final String entry : entries) { - loadArchetypesFromFiles(archetypeParser, baseDir, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, false, invObjects, parent); + loadArchetypesFromFiles(archetypeParser, baseDir, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, false, invObjects, parent); } } else { log.warn("Cannot read directory: " + f); @@ -249,7 +252,7 @@ addPNGFace(baseDir, f.getAbsolutePath(), name, parent); } } else if (name.endsWith(".face")) { - parseDefFace(f.getAbsolutePath()); + parseDefFace(f.getAbsolutePath(), path); } } } @@ -257,13 +260,14 @@ /** * Parsing face files (*.face). I think such files are no longer used and so * is this code. + * @param path the base directory relative path of <code>filename</code> * @param filename filename */ - private void parseDefFace(final String filename) { + private void parseDefFace(@NotNull final String path, @NotNull final String filename) { try { final Reader in = new BufferedReader(new FileReader(filename)); try { - animationObjects.loadAnims(in, "animation ", true, filename); + animationObjects.loadAnims(in, "animation ", true, path); } finally { in.close(); } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-28 20:09:47 UTC (rev 5600) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-29 15:48:52 UTC (rev 5601) @@ -47,6 +47,7 @@ import net.sf.gridarta.gameobject.face.FaceObjects; import net.sf.gridarta.io.GameObjectParser; import net.sf.gridarta.utils.IOUtils; +import net.sf.gridarta.utils.Pair; import net.sf.japi.swing.ActionFactory; import net.sf.japi.util.ThrowableHandler; import org.apache.log4j.Logger; @@ -127,7 +128,7 @@ * from files. */ @Nullable - private List<File> animFiles; + private List<Pair<String, File>> animFiles; /** * Creates a new instance. @@ -175,11 +176,11 @@ } else { FaceObjectProviders.setNormal(new ArchFaceProvider()); archetypeSet.setLoadedFromArchive(false); // don't load from the collected files - animFiles = new ArrayList<File>(); + animFiles = new ArrayList<Pair<String, File>>(); fname = globalSettings.getArchDirectory(); final File dir = new File(fname); addPNGFace(dir, new File(dir, "dev/editor/bug.101.png").getAbsolutePath(), "bug.101.png", parent); - loadArchetypesFromFiles(archetypeParser, dir, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files + loadArchetypesFromFiles(archetypeParser, dir, null, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files loadAnimsFromFiles(); } archetypeSet.reportErrors(parent); @@ -237,6 +238,7 @@ * <code>arch/</code> directory tree. * @param archetypeParser the archetype parser to use * @param baseDir the base directory to strip from filenames + * @param path the base directory relative path for <code>f</code> * @param f file path where we currently are * @param folderLevel level of the folder * @param panelName the panel to add archetypes to @@ -246,7 +248,7 @@ * @param invObjects collects all inventory objects * @param parent the parent component for error messages */ - private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final File baseDir, final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { + private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final File baseDir, @Nullable final String path, final File f, final int folderLevel, @Nullable final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels @@ -256,8 +258,9 @@ Arrays.sort(entries); final String thisPanelName = folderLevel == 1 ? name : panelName; final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; + final String newPath = path == null ? "" : path + "/" + name; for (final String entry : entries) { - loadArchetypesFromFiles(archetypeParser, baseDir, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, noPanel || name.equalsIgnoreCase("intern"), invObjects, parent); + loadArchetypesFromFiles(archetypeParser, baseDir, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, noPanel || name.equalsIgnoreCase("intern"), invObjects, parent); } } else { log.warn("Cannot read directory: " + f); @@ -270,7 +273,7 @@ } else if (name.endsWith(".png")) { addPNGFace(baseDir, f.getAbsolutePath(), name, parent); } else if (name.endsWith(".anim")) { - animFiles.add(f); + animFiles.add(new Pair(path, f)); } } } @@ -399,14 +402,16 @@ /** * This method loads animations that are separately defined by looping * through all files that were previously collected by {@link - * #loadArchetypesFromFiles(AbstractArchetypeParser, File, File, int, - * String, String, boolean, List, Component)}. Do not invoke this method if - * <code>loadArchetypesFromFiles()</code> wasn't invoked. + * #loadArchetypesFromFiles(AbstractArchetypeParser, File, String, File, + * int, String, String, boolean, List, Component)}. Do not invoke this + * method if <code>loadArchetypesFromFiles()</code> wasn't invoked. */ private void loadAnimsFromFiles() { - for (final File animFile : animFiles) { + for (final Pair<String, File> pair : animFiles) { + final String animPath = pair.getFirst(); + final File animFile = pair.getSecond(); try { - animationObjects.loadAnims(animFile, "anim ", false); + animationObjects.loadAnims(animPath, animFile, "anim ", false); } catch (final DuplicateAnimationException e) { throwableHandler.handleThrowable(e); } catch (final IOException e) { Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-10-28 20:09:47 UTC (rev 5600) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-10-29 15:48:52 UTC (rev 5601) @@ -29,7 +29,6 @@ import java.util.HashMap; import java.util.Map; import net.sf.gridarta.data.AbstractNamedObjects; -import net.sf.gridarta.io.PathManager; import net.sf.gridarta.utils.IOUtils; import net.sf.japi.swing.ActionFactory; import org.jetbrains.annotations.NotNull; @@ -56,10 +55,9 @@ } /** {@inheritDoc} */ - public void loadAnims(final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws FileNotFoundException, IOException, AnimationParseException, DuplicateAnimationException { + public void loadAnims(@NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws FileNotFoundException, IOException, AnimationParseException, DuplicateAnimationException { final Reader in = new InputStreamReader(new FileInputStream(animFile), IOUtils.MAP_ENCODING); try { - final String path = (new File(PathManager.getArchPath(animFile.getPath()))).getParent().replace('\\', '/'); loadAnims(in, startKey, ignoreOtherText, path); } finally { in.close(); @@ -83,7 +81,7 @@ final E animationObject; if (path == null) { final String animPath = animMap.get(animName); - animationObject = newAnimationObject(animName, list, animPath == null ? "" : animPath); + animationObject = newAnimationObject(animName, list, animPath == null ? animName : animPath); } else { animationObject = newAnimationObject(animName, list, path + '/' + animName); } Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2008-10-28 20:09:47 UTC (rev 5600) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2008-10-29 15:48:52 UTC (rev 5601) @@ -51,6 +51,7 @@ /** * Loads animations from a file. + * @param path the animation path * @param animFile file to load animations from * @param startKey the key that begins an animation block; it must end with * a space character @@ -62,7 +63,7 @@ * errors * @throws DuplicateAnimationException in case an animation was not unique */ - void loadAnims(File animFile, @NotNull String startKey, boolean ignoreOtherText) throws FileNotFoundException, IOException, AnimationParseException, DuplicateAnimationException; + void loadAnims(@NotNull final String path, @NotNull File animFile, @NotNull String startKey, boolean ignoreOtherText) throws FileNotFoundException, IOException, AnimationParseException, DuplicateAnimationException; /** * Loads any number of animations from a reader. It is not neccessary to Added: trunk/src/app/net/sf/gridarta/utils/Pair.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/Pair.java (rev 0) +++ trunk/src/app/net/sf/gridarta/utils/Pair.java 2008-10-29 15:48:52 UTC (rev 5601) @@ -0,0 +1,65 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.utils; + +/** + * Stores a pair of values. + * @author Andreas Kirschbaum + */ +public class Pair<T, U> { + + /** + * The first value. + */ + private final T first; + + /** + * The second value. + */ + private final U second; + + /** + * Creates a new instance. + * @param first the first value + * @param second the second value + */ + public Pair(final T first, final U second) { + this.first = first; + this.second = second; + } + + /** + * Returns the first value. + * @return the first value + */ + public T getFirst() { + return first; + } + + /** + * Returns the second value. + * @return the second value + */ + public U getSecond() { + return second; + } + +} // class Pair + Property changes on: trunk/src/app/net/sf/gridarta/utils/Pair.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-29 16:00:19
|
Revision: 5602 http://gridarta.svn.sourceforge.net/gridarta/?rev=5602&view=rev Author: akirschbaum Date: 2008-10-29 16:00:06 +0000 (Wed, 29 Oct 2008) Log Message: ----------- Unify comments. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2008-10-29 15:48:52 UTC (rev 5601) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2008-10-29 16:00:06 UTC (rev 5602) @@ -77,7 +77,11 @@ } } - /** {@inheritDoc} */ + /** + * {@inheritDoc} Collects the Animations. The animation data is written to + * "animations". The tree information for the editor is written to + * "animtree". + */ public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); collectAnims(progress, collectedDirectory); Modified: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2008-10-29 15:48:52 UTC (rev 5601) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2008-10-29 16:00:06 UTC (rev 5602) @@ -85,7 +85,7 @@ /** * Collects the animation data into the file "animations". * @param progress Progress to report progress to. - * @param collectedDirectory Destination directory to collect data to. + * @param collectedDirectory the destination directory to collect data to * @throws IOException in case of I/O problems during collection */ private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { @@ -111,7 +111,7 @@ /** * Collects the animation data into the file "animations". * @param progress Progress to report progress to. - * @param collectedDirectory Destination directory to collect data to. + * @param collectedDirectory the destination directory to collect data to * @throws IOException in case of I/O problems during collection */ private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-29 16:45:44
|
Revision: 5604 http://gridarta.svn.sourceforge.net/gridarta/?rev=5604&view=rev Author: akirschbaum Date: 2008-10-29 16:45:33 +0000 (Wed, 29 Oct 2008) Log Message: ----------- Move AnimationObjects to common code base. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/messages.properties trunk/crossfire/src/cfeditor/messages_de.properties trunk/crossfire/src/cfeditor/messages_fr.properties trunk/crossfire/src/cfeditor/messages_sv.properties trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/action.properties trunk/daimonin/src/daieditor/messages.properties trunk/daimonin/src/daieditor/messages_de.properties trunk/daimonin/src/daieditor/messages_fr.properties trunk/daimonin/src/daieditor/messages_sv.properties trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties Removed Paths: ------------- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-29 16:45:33 UTC (rev 5604) @@ -26,7 +26,6 @@ import cfeditor.gameobject.DefaultArchetypeFactory; import cfeditor.gameobject.DefaultGameObjectFactory; import cfeditor.gameobject.GameObject; -import cfeditor.gameobject.anim.AnimationObjects; import cfeditor.gameobject.scripts.DefaultScriptArchUtils; import cfeditor.gameobject.scripts.DefaultScriptedEventFactory; import cfeditor.gui.map.CMapViewBasic; @@ -56,6 +55,7 @@ import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.ArchetypeFactory; import net.sf.gridarta.gameobject.GameObjectFactory; +import net.sf.gridarta.gameobject.anim.AbstractAnimationObjects; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.face.DefaultFaceObjects; import net.sf.gridarta.gameobject.face.FaceObjectProviders; @@ -134,7 +134,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl() { - super(new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AnimationObjects(), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), false, ConfigFileUtils.getHomeFile("thumbnails"), null, "CrossfireEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); + super(new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AbstractAnimationObjects<AnimationObject>(IGUIConstants.ANIMTREE_FILE), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), false, ConfigFileUtils.getHomeFile("thumbnails"), null, "CrossfireEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); } /** {@inheritDoc} */ Deleted: trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/crossfire/src/cfeditor/gameobject/anim/AnimationObjects.java 2008-10-29 16:45:33 UTC (rev 5604) @@ -1,133 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package cfeditor.gameobject.anim; - -import cfeditor.IGUIConstants; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import net.sf.gridarta.gameobject.anim.AbstractAnimationObjects; -import net.sf.gridarta.gameobject.anim.AnimationObject; -import net.sf.gridarta.utils.IOUtils; -import net.sf.japi.swing.ActionFactory; -import net.sf.japi.swing.misc.Progress; -import org.jetbrains.annotations.NotNull; - -/** - * The <code>AnimationObject</code>. AnimationObjects are iterated in Unicode - * (=ASCII) order. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public final class AnimationObjects extends AbstractAnimationObjects<AnimationObject> { - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("cfeditor"); - - /** {@inheritDoc} */ - public void loadAnimTree(final File animTreeFile) throws FileNotFoundException, IOException { - final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(animTreeFile), IOUtils.MAP_ENCODING)); - try { - loadAnimTree(in); - } finally { - in.close(); - } - } - - /** - * Reads Animation Tree from Stream. - * @param reader Input stream - * @throws IOException in case of I/O errors - */ - private void loadAnimTree(final BufferedReader reader) throws IOException { - for (String line; (line = reader.readLine()) != null;) { - final int index = line.lastIndexOf('/'); - final String name = line.substring(index + 1); - addAnimPath(name, line); - } - } - - /** - * {@inheritDoc} Collects the Animations. The animation data is written to - * "animations". The tree information for the editor is written to - * "animtree". - */ - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { - progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); - collectAnims(progress, collectedDirectory); - collectAnimTree(progress, collectedDirectory); - } - - /** - * Collects the animation data into the file "animations". - * @param progress Progress to report progress to. - * @param collectedDirectory the destination directory to collect data to - * @throws IOException in case of I/O problems during collection - */ - private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); - try { - int counter = 0; // counter for progress bar - for (final AnimationObject anim : this) { - animations - .append("anim ") - .append(anim.getAnimName()) - .append('\n') - .append(anim.getAnimList()) - .append("mina\n"); - if (counter++ % 128 == 0) { - progress.setValue(counter); - } - } - } finally { - animations.close(); - } - } - - /** - * Collects the animation data into the file "animations". - * @param progress Progress to report progress to. - * @param collectedDirectory the destination directory to collect data to - * @throws IOException in case of I/O problems during collection - */ - private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, IGUIConstants.ANIMTREE_FILE)), IOUtils.MAP_ENCODING)); - try { - int counter = 0; // counter for progress bar - for (final AnimationObject anim : this) { - animtree - .append(anim.getPath()) - .append('\n'); - if (counter++ % 128 == 0) { - progress.setValue(counter); - } - } - } finally { - animtree.close(); - } - } - -} // class AnimationObjects Modified: trunk/crossfire/src/cfeditor/messages.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/crossfire/src/cfeditor/messages.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -87,8 +87,6 @@ optionsImageSet=Image Set -archCollectAnimations=Collecting Animations... - archCollectWarningMissed.title=Collect warning archCollectWarningMissed.message=Collect Warning: {0} arches have been missed during collect! Modified: trunk/crossfire/src/cfeditor/messages_de.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_de.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/crossfire/src/cfeditor/messages_de.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -83,8 +83,6 @@ optionsImageSet=Image Set -archCollectAnimations=Sammle Animationen... - archCollectWarningMissed.title=Fehler beim Sammeln archCollectWarningMissed.message=Warnung: Beim Sammeln der Archetypen sind wurden {0} Archetypen nicht gefunden. Modified: trunk/crossfire/src/cfeditor/messages_fr.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_fr.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/crossfire/src/cfeditor/messages_fr.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -84,8 +84,6 @@ #optionsImageSet= -#archCollectAnimations= - #archCollectWarningMissed.title= #archCollectWarningMissed.message= Modified: trunk/crossfire/src/cfeditor/messages_sv.properties =================================================================== --- trunk/crossfire/src/cfeditor/messages_sv.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/crossfire/src/cfeditor/messages_sv.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -83,8 +83,6 @@ #optionsImageSet= -archCollectAnimations=Sammanst\xE4ller animationer... - archCollectWarningMissed.title=Varning under sammanst\xE4llning archCollectWarningMissed.message=Varning under sammanst\xE4llning: {0} arketyper saknades under sammanst\xE4llningen! Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-10-29 16:45:33 UTC (rev 5604) @@ -26,7 +26,6 @@ import daieditor.gameobject.DefaultArchetypeFactory; import daieditor.gameobject.DefaultGameObjectFactory; import daieditor.gameobject.GameObject; -import daieditor.gameobject.anim.AnimationObjects; import daieditor.gameobject.scripts.DefaultScriptArchUtils; import daieditor.gameobject.scripts.DefaultScriptedEventFactory; import daieditor.gui.map.CMapViewBasic; @@ -58,6 +57,7 @@ import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.ArchetypeFactory; import net.sf.gridarta.gameobject.GameObjectFactory; +import net.sf.gridarta.gameobject.anim.AbstractAnimationObjects; import net.sf.gridarta.gameobject.anim.AnimationObject; import net.sf.gridarta.gameobject.face.DefaultFaceObjects; import net.sf.gridarta.gameobject.face.FaceObjectProviders; @@ -174,7 +174,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl() { - super(new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AnimationObjects(), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); + super(new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AbstractAnimationObjects<AnimationObject>(IGUIConstants.ANIMTREE_FILE), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/action.properties =================================================================== --- trunk/daimonin/src/daieditor/action.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/daimonin/src/daieditor/action.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -72,5 +72,4 @@ ################ # Other Strings -nameOfAnimationObject=animation nameOfFaceObject=face Deleted: trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/daimonin/src/daieditor/gameobject/anim/AnimationObjects.java 2008-10-29 16:45:33 UTC (rev 5604) @@ -1,134 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package daieditor.gameobject.anim; - -import daieditor.IGUIConstants; -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import net.sf.gridarta.gameobject.anim.AbstractAnimationObjects; -import net.sf.gridarta.gameobject.anim.AnimationObject; -import net.sf.gridarta.utils.IOUtils; -import net.sf.japi.swing.ActionFactory; -import net.sf.japi.swing.misc.Progress; -import org.jetbrains.annotations.NotNull; - -/** - * The <code>AnimationObject</code>. AnimationObjects are iterated in Unicode - * (=ASCII) order. - * @author <a href="mailto:mic...@no...">Michael Toennies</a> - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -@SuppressWarnings({"HardcodedFileSeparator"}) -public final class AnimationObjects extends AbstractAnimationObjects<AnimationObject> { - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("daieditor"); - - /** {@inheritDoc} */ - public void loadAnimTree(final File animTreeFile) throws FileNotFoundException, IOException { - final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(animTreeFile), IOUtils.MAP_ENCODING)); - try { - loadAnimTree(in); - } finally { - in.close(); - } - } - - /** - * Reads Animation Tree from Stream. - * @param reader Input stream - * @throws IOException in case of I/O errors - */ - private void loadAnimTree(final BufferedReader reader) throws IOException { - for (String line; (line = reader.readLine()) != null;) { - final int index = line.lastIndexOf('/'); - final String name = line.substring(index + 1); - addAnimPath(name, line); - } - } - - /** - * {@inheritDoc} Collects the Animations. The animation data is written to - * "animations". The tree information for the editor is written to - * "animtree". - */ - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { - progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); - collectAnims(progress, collectedDirectory); - collectAnimTree(progress, collectedDirectory); - } - - /** - * Collects the animation data into the file "animations". - * @param progress Progress to report progress to. - * @param collectedDirectory the destination directory to collect data to - * @throws IOException in case of I/O problems during collection - */ - private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); - try { - int counter = 0; // counter for progress bar - for (final AnimationObject anim : this) { - animations - .append("anim ") - .append(anim.getAnimName()) - .append('\n') - .append(anim.getAnimList()) - .append("mina\n"); - if (counter++ % 128 == 0) { - progress.setValue(counter); - } - } - } finally { - animations.close(); - } - } - - /** - * Collects the animation data into the file "animations". - * @param progress Progress to report progress to. - * @param collectedDirectory the destination directory to collect data to - * @throws IOException in case of I/O problems during collection - */ - private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, IGUIConstants.ANIMTREE_FILE)), IOUtils.MAP_ENCODING)); - try { - int counter = 0; // counter for progress bar - for (final AnimationObject anim : this) { - animtree - .append(anim.getPath()) - .append('\n'); - if (counter++ % 128 == 0) { - progress.setValue(counter); - } - } - } finally { - animtree.close(); - } - } - -} // class AnimationObjects Modified: trunk/daimonin/src/daieditor/messages.properties =================================================================== --- trunk/daimonin/src/daieditor/messages.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/daimonin/src/daieditor/messages.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -64,8 +64,6 @@ oldLibsFound.message=Old libraries found.\nLocation: {0}\nThey aren''t used anymore.\nDelete them? oldLibsFound.title=Delete old libraries? -archCollectAnimations=Collecting Animations... - #archCollectWarningMultipartTailInPanel.title=Collect warning #archCollectWarningMultipartTailInPanel.message=Collect Warning: Found Multipart tail in Panel! archCollectWarningMultipartTooShort.title=Collect warning @@ -217,6 +215,5 @@ ################ # Other Strings -nameOfAnimationObject=animation nameOfFaceObject=face chooseNamedObject.title=Choose a {0} Modified: trunk/daimonin/src/daieditor/messages_de.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_de.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/daimonin/src/daieditor/messages_de.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -64,8 +64,6 @@ #oldLibsFound.message= #oldLibsFound.title= -archCollectAnimations=Sammle Animationen.... - #archCollectWarningMultipartTailInPanel.title= #archCollectWarningMultipartTailInPanel.message= #archCollectWarningMultipartTooShort.title= Modified: trunk/daimonin/src/daieditor/messages_fr.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_fr.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/daimonin/src/daieditor/messages_fr.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -66,8 +66,6 @@ #oldLibsFound.message= #oldLibsFound.title= -#archCollectAnimations= - #archCollectWarningMultipartTailInPanel.title= #archCollectWarningMultipartTailInPanel.message= #archCollectWarningMultipartTooShort.title= Modified: trunk/daimonin/src/daieditor/messages_sv.properties =================================================================== --- trunk/daimonin/src/daieditor/messages_sv.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/daimonin/src/daieditor/messages_sv.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -64,8 +64,6 @@ oldLibsFound.message=Hittade gamla bibliotek.\nS\xF6kv\xE4g: {0}\nDe anv\xE4nds inte l\xE4ngre. Skall jag ta bort dem? oldLibsFound.title=Ta bort gamla bibliotek? -archCollectAnimations=Sammanst\xE4ller animationer... - #archCollectWarningMultipartTailInPanel.title=Varning under sammanst\xE4llning #archCollectWarningMultipartTailInPanel.message=Varning under sammanst\xE4llning: hittade svans till multidelsobjekt i panelen! archCollectWarningMultipartTooShort.title=Varning under sammanst\xE4llning Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-10-29 16:45:33 UTC (rev 5604) @@ -20,17 +20,21 @@ package net.sf.gridarta.gameobject.anim; import java.io.BufferedReader; +import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStreamReader; +import java.io.OutputStreamWriter; import java.io.Reader; import java.util.HashMap; import java.util.Map; import net.sf.gridarta.data.AbstractNamedObjects; import net.sf.gridarta.utils.IOUtils; import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.misc.Progress; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -38,7 +42,7 @@ * Abstract base implementation of {@link AnimationObjects}. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ -public abstract class AbstractAnimationObjects<E extends AnimationObject> extends AbstractNamedObjects<E> implements AnimationObjects<E> { +public class AbstractAnimationObjects<E extends AnimationObject> extends AbstractNamedObjects<E> implements AnimationObjects<E> { /** Action Factory. */ private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); @@ -49,9 +53,19 @@ */ private final Map<String, String> animMap = new HashMap<String, String>(); - /** Create an AnimationObjects instance. */ - protected AbstractAnimationObjects() { + /** + * The collected animation tree file. + */ + @NotNull + private final String animTreeFile; + + /** + * Creates a new instance. + * @param animTreeFile the collected animation tree file + */ + public AbstractAnimationObjects(@NotNull final String animTreeFile) { super(ACTION_FACTORY.getString("nameOfAnimationObject")); + this.animTreeFile = animTreeFile; } /** {@inheritDoc} */ @@ -153,4 +167,88 @@ } } + /** {@inheritDoc} */ + public void loadAnimTree(final File animTreeFile) throws FileNotFoundException, IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(animTreeFile), IOUtils.MAP_ENCODING)); + try { + loadAnimTree(in); + } finally { + in.close(); + } + } + + /** + * Reads Animation Tree from Stream. + * @param reader Input stream + * @throws IOException in case of I/O errors + */ + private void loadAnimTree(final BufferedReader reader) throws IOException { + for (String line; (line = reader.readLine()) != null;) { + final int index = line.lastIndexOf('/'); + final String name = line.substring(index + 1); + addAnimPath(name, line); + } + } + + /** + * {@inheritDoc} Collects the Animations. The animation data is written to + * "animations". The tree information for the editor is written to + * "animtree". + */ + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { + progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); + collectAnims(progress, collectedDirectory); + collectAnimTree(progress, collectedDirectory); + } + + /** + * Collects the animation data into the file "animations". + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); + try { + int counter = 0; // counter for progress bar + for (final AnimationObject anim : this) { + animations + .append("anim ") + .append(anim.getAnimName()) + .append('\n') + .append(anim.getAnimList()) + .append("mina\n"); + if (counter++ % 128 == 0) { + progress.setValue(counter); + } + } + } finally { + animations.close(); + } + } + + /** + * Collects the animation data into the file "animations". + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, animTreeFile)), IOUtils.MAP_ENCODING)); + try { + int counter = 0; // counter for progress bar + for (final AnimationObject anim : this) { + animtree + .append(anim.getPath()) + .append('\n'); + if (counter++ % 128 == 0) { + progress.setValue(counter); + } + } + } finally { + animtree.close(); + } + } + + } // class AbstractAnimationObjects Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/src/app/net/sf/gridarta/messages.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -29,6 +29,7 @@ archCollectErrorIOException.title=Collect Error archCollectErrorIOException.message=Collect Error: An I/O Exception occurred on file {0}:\n{1} nameOfAnimationObject=Animation +archCollectAnimations=Collecting Animations... nameOfFaceObject=Face collectTemplistAutodelete.title=Loading mapfile {0} collectTemplistAutodelete.message=Found {1} game objects referencing\nthe following unknown archetypes:\n{2}\nDelete these game objects? Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -29,6 +29,7 @@ archCollectErrorIOException.title=Fehler beim Sammeln archCollectErrorIOException.message=Fehler beim Sammeln: In {0} ist ein Ein-/Ausgabefehler ist aufgetreten:\n{1} nameOfAnimationObject=Animation +archCollectAnimations=Sammle Animationen.... nameOfFaceObject=Bild collectTemplistAutodelete.title=Karte {0} laden collectTemplistAutodelete.message=Die Karte enth\xE4lt {1} Objekte, die die\nfolgenden unbekannten Archetypen verwenden:\n{2}\nSollen diese Objekte gel\xF6scht werden? Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -29,6 +29,7 @@ #archCollectErrorIOException.title= #archCollectErrorIOException.message= #nameOfAnimationObject= +#archCollectAnimations= #nameOfFaceObject= #collectTemplistAutodelete.title= #collectTemplistAutodelete.message= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-10-29 16:10:24 UTC (rev 5603) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2008-10-29 16:45:33 UTC (rev 5604) @@ -29,6 +29,7 @@ archCollectErrorIOException.title=Fel under sammanst\xE4llning archCollectErrorIOException.message=Fel under sammanst\xE4llning: ett I/O-fel intr\xE4ffade f\xF6r filen {0}:\n{1} nameOfAnimationObject=animation +archCollectAnimations=Sammanst\xE4ller animationer... nameOfFaceObject=bild collectTemplistAutodelete.title=Laddar kartfil {0} collectTemplistAutodelete.message=Hittade {1} ok\xE4nd arketyp.\nTar bort ogiltig arketyp:\n{2} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-29 16:50:39
|
Revision: 5605 http://gridarta.svn.sourceforge.net/gridarta/?rev=5605&view=rev Author: akirschbaum Date: 2008-10-29 16:50:34 +0000 (Wed, 29 Oct 2008) Log Message: ----------- Rename AbstractAnimationObjects to DefaultAnimationObjects because it is not anymore abstract. Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/daimonin/src/daieditor/CMainControl.java Added Paths: ----------- trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java Removed Paths: ------------- trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-29 16:45:33 UTC (rev 5604) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-10-29 16:50:34 UTC (rev 5605) @@ -55,8 +55,8 @@ import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.ArchetypeFactory; import net.sf.gridarta.gameobject.GameObjectFactory; -import net.sf.gridarta.gameobject.anim.AbstractAnimationObjects; import net.sf.gridarta.gameobject.anim.AnimationObject; +import net.sf.gridarta.gameobject.anim.DefaultAnimationObjects; import net.sf.gridarta.gameobject.face.DefaultFaceObjects; import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.gameobject.face.FaceObjects; @@ -134,7 +134,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl() { - super(new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new AbstractAnimationObjects<AnimationObject>(IGUIConstants.ANIMTREE_FILE), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), false, ConfigFileUtils.getHomeFile("thumbnails"), null, "CrossfireEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); + super(new DefaultRendererFactory(), "cfeditor", new GlobalSettingsImpl(), new DefaultAnimationObjects<AnimationObject>(IGUIConstants.ANIMTREE_FILE), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), false, ConfigFileUtils.getHomeFile("thumbnails"), null, "CrossfireEditor.jar", pythonFileFilter, ".py", "Python", Archetype.TYPE_SPELL, null, Archetype.TYPE_EVENT_CONNECTOR, false, 0, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_TRIGGER_ALTAR, Archetype.TYPE_DETECTOR, Archetype.TYPE_TRIGGER_MARKER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); } /** {@inheritDoc} */ Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-10-29 16:45:33 UTC (rev 5604) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-10-29 16:50:34 UTC (rev 5605) @@ -57,8 +57,8 @@ import net.sf.gridarta.gameobject.AbstractArchetypeParser; import net.sf.gridarta.gameobject.ArchetypeFactory; import net.sf.gridarta.gameobject.GameObjectFactory; -import net.sf.gridarta.gameobject.anim.AbstractAnimationObjects; import net.sf.gridarta.gameobject.anim.AnimationObject; +import net.sf.gridarta.gameobject.anim.DefaultAnimationObjects; import net.sf.gridarta.gameobject.face.DefaultFaceObjects; import net.sf.gridarta.gameobject.face.FaceObjectProviders; import net.sf.gridarta.gameobject.face.FaceObjects; @@ -174,7 +174,7 @@ * @throws RuntimeException If the controller cannot be initialized. */ public CMainControl() { - super(new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new AbstractAnimationObjects<AnimationObject>(IGUIConstants.ANIMTREE_FILE), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); + super(new DefaultRendererFactory(), "daieditor", new GlobalSettingsImpl(), new DefaultAnimationObjects<AnimationObject>(IGUIConstants.ANIMTREE_FILE), new DefaultFaceObjects(IGUIConstants.PNG_FILE, IGUIConstants.FACETREE_FILE, Pattern.compile("^(.*)"), "%s"), true, null, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), "DaimoninEditor.jar", luaFileFilter, ".lua", "Lua", 0, IGUIConstants.SPELL_FILE, 0, true, -1, new int[] { Archetype.TYPE_LOCKED_DOOR, Archetype.TYPE_SPECIAL_KEY, Archetype.TYPE_ALTAR_TRIGGER, Archetype.TYPE_MARKER, Archetype.TYPE_INVENTORY_CHECKER, Archetype.TYPE_SPAWN_POINT, Archetype.TYPE_CONTAINER, }, PREFS_VALIDATOR_AUTO_DEFAULT, IGUIConstants.SCRIPTS_DIR); } /** {@inheritDoc} */ Deleted: trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-10-29 16:45:33 UTC (rev 5604) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java 2008-10-29 16:50:34 UTC (rev 5605) @@ -1,254 +0,0 @@ -/* - * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. - * Copyright (C) 2000-2007 The Gridarta Developers. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -package net.sf.gridarta.gameobject.anim; - -import java.io.BufferedReader; -import java.io.BufferedWriter; -import java.io.File; -import java.io.FileInputStream; -import java.io.FileNotFoundException; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.OutputStreamWriter; -import java.io.Reader; -import java.util.HashMap; -import java.util.Map; -import net.sf.gridarta.data.AbstractNamedObjects; -import net.sf.gridarta.utils.IOUtils; -import net.sf.japi.swing.ActionFactory; -import net.sf.japi.swing.misc.Progress; -import org.jetbrains.annotations.NotNull; -import org.jetbrains.annotations.Nullable; - -/** - * Abstract base implementation of {@link AnimationObjects}. - * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - */ -public class AbstractAnimationObjects<E extends AnimationObject> extends AbstractNamedObjects<E> implements AnimationObjects<E> { - - /** Action Factory. */ - private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); - - /** - * This Map holds (anim object name, path to arc file) pairs. The object - * name is included in the path. - */ - private final Map<String, String> animMap = new HashMap<String, String>(); - - /** - * The collected animation tree file. - */ - @NotNull - private final String animTreeFile; - - /** - * Creates a new instance. - * @param animTreeFile the collected animation tree file - */ - public AbstractAnimationObjects(@NotNull final String animTreeFile) { - super(ACTION_FACTORY.getString("nameOfAnimationObject")); - this.animTreeFile = animTreeFile; - } - - /** {@inheritDoc} */ - public void loadAnims(@NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws FileNotFoundException, IOException, AnimationParseException, DuplicateAnimationException { - final Reader in = new InputStreamReader(new FileInputStream(animFile), IOUtils.MAP_ENCODING); - try { - loadAnims(in, startKey, ignoreOtherText, path); - } finally { - in.close(); - } - } - - /** {@inheritDoc} */ - public void addAnimationObject(final String animName, final String list) throws DuplicateAnimationException { - addAnimationObject(animName, list, null); - } - - /** - * Adds a new animation object. If <code>path == null</code> path will be - * read from {@link #animMap}. - * @param animName name of the animation object to add - * @param list String with animation list data - * @param path Path relative to the arch directory - * @throws DuplicateAnimationException in case the animation was not unique - */ - public void addAnimationObject(final String animName, final String list, @Nullable final String path) throws DuplicateAnimationException { - final E animationObject; - if (path == null) { - final String animPath = animMap.get(animName); - animationObject = newAnimationObject(animName, list, animPath == null ? animName : animPath); - } else { - animationObject = newAnimationObject(animName, list, path + '/' + animName); - } - if (containsKey(animName)) { - throw new DuplicateAnimationException(animationObject); - } - put(animationObject); - } - - /** - * Creates a new {@link AnimationObject} instance. - * @param animName the animation name - * @param animList the list of animations - * @param path the path name - * @return the anmation object instance - */ - @NotNull - protected E newAnimationObject(@NotNull final String animName, @NotNull final String animList, @Nullable final String path) { - return (E) new DefaultAnimationObject(animName, animList, path); - } - - /** {@inheritDoc} */ - public void addAnimPath(final String name, final String path) { - animMap.put(name, path); - } - - /** - * Returns Animation Path Tree. - * @return <var>animHashTable</var> - */ - public Map<String, String> getAnimPathTree() { - return animMap; - } - - /** {@inheritDoc} */ - @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"}) - public void loadAnims(final Reader reader, @NotNull final String startKey, final boolean ignoreOtherText, @Nullable final String path) throws IOException, AnimationParseException, DuplicateAnimationException { - final BufferedReader in = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); - boolean inAnim = false; - String animName = null; - final StringBuilder animText = new StringBuilder(); - String line2; - int lineNumber; - for (lineNumber = 1; (line2 = in.readLine()) != null; lineNumber++) { - final String line = line2.trim(); - if (line.startsWith("#") || line.length() == 0) { - /* ignore comment lines. */ - } else if (line.startsWith(startKey)) { - if (inAnim) { - throw new AnimationParseException("mina", line, lineNumber); - } - inAnim = true; - animName = line.substring(startKey.length()); - animText.setLength(0); - } else if ("mina".equals(line)) { - if (!inAnim) { - throw new AnimationParseException(startKey + "...", line, lineNumber); - } - inAnim = false; - addAnimationObject(animName, animText.toString(), path); - } else if (inAnim) { - animText.append(line).append('\n'); - } else if (!ignoreOtherText) { - throw new AnimationParseException(startKey + "...", line, lineNumber); - } - } - if (inAnim) { - throw new AnimationParseException("mina", null, lineNumber); - } - } - - /** {@inheritDoc} */ - public void loadAnimTree(final File animTreeFile) throws FileNotFoundException, IOException { - final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(animTreeFile), IOUtils.MAP_ENCODING)); - try { - loadAnimTree(in); - } finally { - in.close(); - } - } - - /** - * Reads Animation Tree from Stream. - * @param reader Input stream - * @throws IOException in case of I/O errors - */ - private void loadAnimTree(final BufferedReader reader) throws IOException { - for (String line; (line = reader.readLine()) != null;) { - final int index = line.lastIndexOf('/'); - final String name = line.substring(index + 1); - addAnimPath(name, line); - } - } - - /** - * {@inheritDoc} Collects the Animations. The animation data is written to - * "animations". The tree information for the editor is written to - * "animtree". - */ - public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { - progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); - collectAnims(progress, collectedDirectory); - collectAnimTree(progress, collectedDirectory); - } - - /** - * Collects the animation data into the file "animations". - * @param progress Progress to report progress to. - * @param collectedDirectory the destination directory to collect data to - * @throws IOException in case of I/O problems during collection - */ - private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); - try { - int counter = 0; // counter for progress bar - for (final AnimationObject anim : this) { - animations - .append("anim ") - .append(anim.getAnimName()) - .append('\n') - .append(anim.getAnimList()) - .append("mina\n"); - if (counter++ % 128 == 0) { - progress.setValue(counter); - } - } - } finally { - animations.close(); - } - } - - /** - * Collects the animation data into the file "animations". - * @param progress Progress to report progress to. - * @param collectedDirectory the destination directory to collect data to - * @throws IOException in case of I/O problems during collection - */ - private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { - final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, animTreeFile)), IOUtils.MAP_ENCODING)); - try { - int counter = 0; // counter for progress bar - for (final AnimationObject anim : this) { - animtree - .append(anim.getPath()) - .append('\n'); - if (counter++ % 128 == 0) { - progress.setValue(counter); - } - } - } finally { - animtree.close(); - } - } - - -} // class AbstractAnimationObjects Copied: trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java (from rev 5604, trunk/src/app/net/sf/gridarta/gameobject/anim/AbstractAnimationObjects.java) =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java (rev 0) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java 2008-10-29 16:50:34 UTC (rev 5605) @@ -0,0 +1,254 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2007 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.gameobject.anim; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.io.Reader; +import java.util.HashMap; +import java.util.Map; +import net.sf.gridarta.data.AbstractNamedObjects; +import net.sf.gridarta.utils.IOUtils; +import net.sf.japi.swing.ActionFactory; +import net.sf.japi.swing.misc.Progress; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Abstract base implementation of {@link AnimationObjects}. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class DefaultAnimationObjects<E extends AnimationObject> extends AbstractNamedObjects<E> implements AnimationObjects<E> { + + /** Action Factory. */ + private static final ActionFactory ACTION_FACTORY = ActionFactory.getFactory("net.sf.gridarta"); + + /** + * This Map holds (anim object name, path to arc file) pairs. The object + * name is included in the path. + */ + private final Map<String, String> animMap = new HashMap<String, String>(); + + /** + * The collected animation tree file. + */ + @NotNull + private final String animTreeFile; + + /** + * Creates a new instance. + * @param animTreeFile the collected animation tree file + */ + public DefaultAnimationObjects(@NotNull final String animTreeFile) { + super(ACTION_FACTORY.getString("nameOfAnimationObject")); + this.animTreeFile = animTreeFile; + } + + /** {@inheritDoc} */ + public void loadAnims(@NotNull final String path, @NotNull final File animFile, @NotNull final String startKey, final boolean ignoreOtherText) throws FileNotFoundException, IOException, AnimationParseException, DuplicateAnimationException { + final Reader in = new InputStreamReader(new FileInputStream(animFile), IOUtils.MAP_ENCODING); + try { + loadAnims(in, startKey, ignoreOtherText, path); + } finally { + in.close(); + } + } + + /** {@inheritDoc} */ + public void addAnimationObject(final String animName, final String list) throws DuplicateAnimationException { + addAnimationObject(animName, list, null); + } + + /** + * Adds a new animation object. If <code>path == null</code> path will be + * read from {@link #animMap}. + * @param animName name of the animation object to add + * @param list String with animation list data + * @param path Path relative to the arch directory + * @throws DuplicateAnimationException in case the animation was not unique + */ + public void addAnimationObject(final String animName, final String list, @Nullable final String path) throws DuplicateAnimationException { + final E animationObject; + if (path == null) { + final String animPath = animMap.get(animName); + animationObject = newAnimationObject(animName, list, animPath == null ? animName : animPath); + } else { + animationObject = newAnimationObject(animName, list, path + '/' + animName); + } + if (containsKey(animName)) { + throw new DuplicateAnimationException(animationObject); + } + put(animationObject); + } + + /** + * Creates a new {@link AnimationObject} instance. + * @param animName the animation name + * @param animList the list of animations + * @param path the path name + * @return the anmation object instance + */ + @NotNull + protected E newAnimationObject(@NotNull final String animName, @NotNull final String animList, @Nullable final String path) { + return (E) new DefaultAnimationObject(animName, animList, path); + } + + /** {@inheritDoc} */ + public void addAnimPath(final String name, final String path) { + animMap.put(name, path); + } + + /** + * Returns Animation Path Tree. + * @return <var>animHashTable</var> + */ + public Map<String, String> getAnimPathTree() { + return animMap; + } + + /** {@inheritDoc} */ + @SuppressWarnings({"IOResourceOpenedButNotSafelyClosed"}) + public void loadAnims(final Reader reader, @NotNull final String startKey, final boolean ignoreOtherText, @Nullable final String path) throws IOException, AnimationParseException, DuplicateAnimationException { + final BufferedReader in = reader instanceof BufferedReader ? (BufferedReader) reader : new BufferedReader(reader); + boolean inAnim = false; + String animName = null; + final StringBuilder animText = new StringBuilder(); + String line2; + int lineNumber; + for (lineNumber = 1; (line2 = in.readLine()) != null; lineNumber++) { + final String line = line2.trim(); + if (line.startsWith("#") || line.length() == 0) { + /* ignore comment lines. */ + } else if (line.startsWith(startKey)) { + if (inAnim) { + throw new AnimationParseException("mina", line, lineNumber); + } + inAnim = true; + animName = line.substring(startKey.length()); + animText.setLength(0); + } else if ("mina".equals(line)) { + if (!inAnim) { + throw new AnimationParseException(startKey + "...", line, lineNumber); + } + inAnim = false; + addAnimationObject(animName, animText.toString(), path); + } else if (inAnim) { + animText.append(line).append('\n'); + } else if (!ignoreOtherText) { + throw new AnimationParseException(startKey + "...", line, lineNumber); + } + } + if (inAnim) { + throw new AnimationParseException("mina", null, lineNumber); + } + } + + /** {@inheritDoc} */ + public void loadAnimTree(final File animTreeFile) throws FileNotFoundException, IOException { + final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(animTreeFile), IOUtils.MAP_ENCODING)); + try { + loadAnimTree(in); + } finally { + in.close(); + } + } + + /** + * Reads Animation Tree from Stream. + * @param reader Input stream + * @throws IOException in case of I/O errors + */ + private void loadAnimTree(final BufferedReader reader) throws IOException { + for (String line; (line = reader.readLine()) != null;) { + final int index = line.lastIndexOf('/'); + final String name = line.substring(index + 1); + addAnimPath(name, line); + } + } + + /** + * {@inheritDoc} Collects the Animations. The animation data is written to + * "animations". The tree information for the editor is written to + * "animtree". + */ + public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { + progress.setLabel(ACTION_FACTORY.getString("archCollectAnimations"), size()); + collectAnims(progress, collectedDirectory); + collectAnimTree(progress, collectedDirectory); + } + + /** + * Collects the animation data into the file "animations". + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectAnims(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animations = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, "animations")), IOUtils.MAP_ENCODING)); + try { + int counter = 0; // counter for progress bar + for (final AnimationObject anim : this) { + animations + .append("anim ") + .append(anim.getAnimName()) + .append('\n') + .append(anim.getAnimList()) + .append("mina\n"); + if (counter++ % 128 == 0) { + progress.setValue(counter); + } + } + } finally { + animations.close(); + } + } + + /** + * Collects the animation data into the file "animations". + * @param progress Progress to report progress to. + * @param collectedDirectory the destination directory to collect data to + * @throws IOException in case of I/O problems during collection + */ + private void collectAnimTree(@NotNull final Progress progress, @NotNull final File collectedDirectory) throws IOException { + final BufferedWriter animtree = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(collectedDirectory, animTreeFile)), IOUtils.MAP_ENCODING)); + try { + int counter = 0; // counter for progress bar + for (final AnimationObject anim : this) { + animtree + .append(anim.getPath()) + .append('\n'); + if (counter++ % 128 == 0) { + progress.setValue(counter); + } + } + } finally { + animtree.close(); + } + } + + +} // class DefaultAnimationObjects Property changes on: trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-29 17:03:24
|
Revision: 5606 http://gridarta.svn.sourceforge.net/gridarta/?rev=5606&view=rev Author: akirschbaum Date: 2008-10-29 17:03:18 +0000 (Wed, 29 Oct 2008) Log Message: ----------- Remove empty packages. Removed Paths: ------------- trunk/crossfire/src/cfeditor/gameobject/anim/ trunk/daimonin/src/daieditor/gameobject/anim/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-30 19:21:13
|
Revision: 5608 http://gridarta.svn.sourceforge.net/gridarta/?rev=5608&view=rev Author: akirschbaum Date: 2008-10-30 19:21:08 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Move DefaultFaceObjects.makeTmpFaceFile() to IOUtils.getFile(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java trunk/src/app/net/sf/gridarta/utils/IOUtils.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-29 18:29:43 UTC (rev 5607) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-30 19:21:08 UTC (rev 5608) @@ -201,7 +201,7 @@ } finally { stream.close(); } - faceObjects.loadFacesCollection(new File(collectedDirectory, IGUIConstants.PNG_FILE), new File(collectedDirectory, IGUIConstants.FACETREE_FILE)); + faceObjects.loadFacesCollection(collectedDirectory, IGUIConstants.PNG_FILE, new File(collectedDirectory, IGUIConstants.FACETREE_FILE)); } catch (final IOException e) { // TODO log.error("Error:", e); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-29 18:29:43 UTC (rev 5607) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-30 19:21:08 UTC (rev 5608) @@ -224,7 +224,7 @@ } finally { stream.close(); } - faceObjects.loadFacesCollection(new File(collectedDirectory, IGUIConstants.PNG_FILE), new File(collectedDirectory, IGUIConstants.FACETREE_FILE)); + faceObjects.loadFacesCollection(collectedDirectory, IGUIConstants.PNG_FILE, new File(collectedDirectory, IGUIConstants.FACETREE_FILE)); } catch (final IOException e) { // TODO log.error("Error:", e); Modified: trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java 2008-10-29 18:29:43 UTC (rev 5607) +++ trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java 2008-10-30 19:21:08 UTC (rev 5608) @@ -250,53 +250,9 @@ put(faceObject); } - /** - * Returns a file that is a regular file on the file system. Returns the - * passed file if it is a regular file. Otherwise copies the passed file - * into a temporary regular file and returns the copy. - * @param faceFile the input file - * @return the output file which is a regular file on the file system - * @todo remove this method when CrossfireEditor does not anymore embed crossfire.0 - */ - protected static File makeTmpFaceFile(final File faceFile) { - if (faceFile.exists()) { - return faceFile; - } - - final File tmpFaceFile; - try { - tmpFaceFile = File.createTempFile("gridarta", null); - tmpFaceFile.deleteOnExit(); - final BufferedInputStream inputStream = IOUtils.createStream(null, faceFile.getPath()); - try { - final FileOutputStream outputStream = new FileOutputStream(tmpFaceFile); - try { - final byte[] buf = new byte[65536]; - for (;;) { - final int len = inputStream.read(buf); - if (len == -1) { - break; - } - - outputStream.write(buf, 0, len); - } - } - finally { - outputStream.close(); - } - } - finally { - inputStream.close(); - } - } catch (final IOException ex) { - return faceFile; - } - return tmpFaceFile; - } - /** {@inheritDoc} */ - public void loadFacesCollection(final File faceFile, final File treeFile) throws IOException, FileNotFoundException, DuplicateFaceException { - final File tmpFaceFile = makeTmpFaceFile(faceFile); + public void loadFacesCollection(@NotNull final String faceDir, @NotNull final String faceFile, final File treeFile) throws IOException, FileNotFoundException, DuplicateFaceException { + final File tmpFaceFile = IOUtils.getFile(faceDir, faceFile); FaceObjectProviders.setNormal(new CollectedFaceProvider(tmpFaceFile)); final String actualFilename = tmpFaceFile.toString(); final InputStream inputStream = new FileInputStream(tmpFaceFile); Modified: trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java 2008-10-29 18:29:43 UTC (rev 5607) +++ trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java 2008-10-30 19:21:08 UTC (rev 5608) @@ -24,6 +24,7 @@ import java.io.IOException; import net.sf.gridarta.data.NamedObjects; import net.sf.gridarta.gameobject.Collectable; +import org.jetbrains.annotations.NotNull; /** * FaceObjects is a container for {@link FaceObject}s. @@ -33,13 +34,14 @@ /** * Loads all faces from a png collection file. + * @param faceDir directory to load faces from * @param faceFile file to load faces from * @param treeFile file to load tree information from * @throws IOException in case of I/O errors * @throws FileNotFoundException in case the file couldn't be opened * @throws DuplicateFaceException in case a face was not unique */ - void loadFacesCollection(File faceFile, File treeFile) throws IOException, FileNotFoundException, DuplicateFaceException; + void loadFacesCollection(@NotNull String faceDir, @NotNull String faceFile, File treeFile) throws IOException, FileNotFoundException, DuplicateFaceException; /** * Adds a new face object. Modified: trunk/src/app/net/sf/gridarta/utils/IOUtils.java =================================================================== --- trunk/src/app/net/sf/gridarta/utils/IOUtils.java 2008-10-29 18:29:43 UTC (rev 5607) +++ trunk/src/app/net/sf/gridarta/utils/IOUtils.java 2008-10-30 19:21:08 UTC (rev 5608) @@ -25,6 +25,7 @@ import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; +import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; @@ -299,4 +300,48 @@ return sb.substring(0, sb.length() - tag.length()); } + /** + * Returns a {@link File} instance for a resource that is a regular file on + * the file system. Returns the passed file if it is a regular file. + * Otherwise copies the passed file into a temporary regular file and + * returns the copy. + * @param dname directory name to read from + * @param fname file name of file to read + * @return the file + * @throws IOException if the file does not exist or cannot be copied to + * the file system + */ + @NotNull + public static File getFile(@Nullable final String dname, @NotNull final String fname) throws IOException { + final File file = new File(getResourceURLAsString(dname, fname)); + if (file.exists()) { + return file; + } + + final File tmpFile = File.createTempFile("gridarta", null); + tmpFile.deleteOnExit(); + final BufferedInputStream inputStream = createStream(dname, fname); + try { + final FileOutputStream outputStream = new FileOutputStream(tmpFile); + try { + final byte[] buf = new byte[65536]; + for (;;) { + final int len = inputStream.read(buf); + if (len == -1) { + break; + } + + outputStream.write(buf, 0, len); + } + } + finally { + outputStream.close(); + } + } + finally { + inputStream.close(); + } + return tmpFile; + } + } // class IOUtils This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-30 19:47:47
|
Revision: 5609 http://gridarta.svn.sourceforge.net/gridarta/?rev=5609&view=rev Author: akirschbaum Date: 2008-10-30 19:47:43 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Add face tree file to CrossfireEditor. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java Added Paths: ----------- trunk/crossfire/resource/conf/bmaps.paths Added: trunk/crossfire/resource/conf/bmaps.paths =================================================================== --- trunk/crossfire/resource/conf/bmaps.paths (rev 0) +++ trunk/crossfire/resource/conf/bmaps.paths 2008-10-30 19:47:43 UTC (rev 5609) @@ -0,0 +1,4879 @@ +# This file is generated by collect.pl, do not edit +\00000 ./arch/system/bug.111 +\00001 ./arch/monster/giant/DreadKnight/Bk.x11 +\00002 ./arch/monster/giant/DreadKnight/Bk.x12 +\00003 ./arch/monster/giant/DreadKnight/Bk.x13 +\00004 ./arch/monster/giant/DreadKnight/Bk.x14 +\00005 ./arch/monster/giant/DreadKnight/Bk.x15 +\00006 ./arch/monster/giant/DreadKnight/Bk.x71 +\00007 ./arch/monster/giant/DreadKnight/Bk.x72 +\00008 ./arch/monster/giant/DreadKnight/Bk.x73 +\00009 ./arch/monster/giant/DreadKnight/Bk.x74 +\00010 ./arch/monster/giant/DreadKnight/Bk.x75 +\00011 ./arch/weapon/artifact/ChaosSword/CSword.111 +\00012 ./arch/weapon/artifact/ChaosSword/CSword.112 +\00013 ./arch/weapon/artifact/ChaosSword/CSword.113 +\00014 ./arch/weapon/artifact/ChaosSword/CSword.114 +\00015 ./arch/weapon/artifact/ChaosSword/CSword.115 +\00016 ./arch/weapon/artifact/ChaosSword/CSword.116 +\00017 ./arch/weapon/artifact/ChaosSword/CSword.117 +\00018 ./arch/weapon/artifact/ChaosSword/CSword.118 +\00019 ./arch/weapon/artifact/ChaosSword/CSword.119 +\00020 ./arch/weapon/artifact/ChaosSword/CSword.11A +\00021 ./arch/weapon/artifact/ChaosSword/CSword.11B +\00022 ./arch/weapon/artifact/ChaosSword/CSword.11C +\00023 ./arch/monster/dragon/Cwyvern.x31 +\00024 ./arch/monster/dragon/Cwyvern.x32 +\00025 ./arch/monster/dragon/Cwyvern.x71 +\00026 ./arch/monster/dragon/Cwyvern.x72 +\00027 ./arch/armour/shield/DShield.111 +\00028 ./arch/armour/shield/DShield.112 +\00029 ./arch/armour/shield/DShield.113 +\00030 ./arch/monster/demon/GreatDemon/GreatDemon.x11 +\00031 ./arch/ground/nimground/Nimground3_purple.111 +\00032 ./arch/ground/nimground/Nimground3_purple.112 +\00033 ./arch/ground/nimground/Nimground3_purple.113 +\00034 ./arch/ground/nimground/Nimground3_purple.114 +\00035 ./arch/armour/mail/Pdragonmail.111 +\00036 ./arch/armour/mail/Pdragonmail.112 +\00037 ./arch/construct/town/a_bridge1.111 +\00038 ./arch/construct/town/a_bridge2.111 +\00039 ./arch/construct/town/a_civic.x11 +\00040 ./arch/construct/town/a_civic2.x11 +\00041 ./arch/monster/humanoid/Arabic/a_guard_h.111 +\00042 ./arch/monster/humanoid/Arabic/a_guard_l.111 +\00043 ./arch/monster/humanoid/Arabic/a_guard_m.111 +\00044 ./arch/armour/helmet/a_helmet.111 +\00045 ./arch/monster/humanoid/Arabic/a_priest.111 +\00046 ./arch/monster/humanoid/Arabic/a_townsman.111 +\00047 ./arch/monster/humanoid/Arabic/a_townsman2.111 +\00048 ./arch/monster/humanoid/Arabic/a_townsman3.111 +\00049 ./arch/monster/acid/acid_pool.111 +\00050 ./arch/monster/acid/acid_pool.112 +\00051 ./arch/monster/acid/acidsphere.111 +\00052 ./arch/monster/acid/acidsphere.112 +\00053 ./arch/monster/acid/acidsphere.113 +\00054 ./arch/monster/acid/acidsphere.114 +\00055 ./arch/misc/acidspit.111 +\00056 ./arch/misc/acidspit.121 +\00057 ./arch/misc/acidspit.131 +\00058 ./arch/misc/acidspit.141 +\00059 ./arch/misc/acidspit.151 +\00060 ./arch/misc/acidspit.161 +\00061 ./arch/misc/acidspit.171 +\00062 ./arch/misc/acidspit.181 +\00063 ./arch/floor/Afloor/afloor.131 +\00064 ./arch/floor/Afloor/afloor.171 +\00065 ./arch/floor/Afloor/afloor_blue.131 +\00066 ./arch/floor/Afloor/afloor_blue.171 +\00067 ./arch/floor/Afloor/afloor_magenta.131 +\00068 ./arch/floor/Afloor/afloor_magenta.171 +\00069 ./arch/floor/Afloor/ahole.131 +\00070 ./arch/floor/Afloor/ahole.171 +\00071 ./arch/floor/Afloor/ahole_blue.131 +\00072 ./arch/floor/Afloor/ahole_blue.171 +\00073 ./arch/floor/Afloor/ahole_magenta.131 +\00074 ./arch/floor/Afloor/ahole_magenta.171 +\00075 ./arch/player/class/Wizardry/alchemist.111 +\00076 ./arch/player/class/Wizardry/alchemist.112 +\00077 ./arch/player/class/Wizardry/alchemist.131 +\00078 ./arch/player/class/Wizardry/alchemist.132 +\00079 ./arch/player/class/Wizardry/alchemist.151 +\00080 ./arch/player/class/Wizardry/alchemist.152 +\00081 ./arch/player/class/Wizardry/alchemist.171 +\00082 ./arch/player/class/Wizardry/alchemist.172 +\00083 ./arch/connect/altar.111 +\00084 ./arch/connect/altar.112 +\00085 ./arch/gods/altars/altardevo.111 +\00086 ./arch/gods/altars/altargaea.111 +\00087 ./arch/gods/altars/altargnarg.111 +\00088 ./arch/gods/altars/altargoro.111 +\00089 ./arch/gods/altars/altarixalovh.111 +\00090 ./arch/gods/altars/altarlyth.111 +\00091 ./arch/gods/altars/altarmostr.111 +\00092 ./arch/gods/altars/altarnone.111 +\00093 ./arch/gods/altars/altarrugg.111 +\00094 ./arch/gods/altars/altarrugg.112 +\00095 ./arch/gods/altars/altarrugg.113 +\00096 ./arch/gods/altars/altarrugg.114 +\00097 ./arch/gods/altars/altarrugg.115 +\00098 ./arch/gods/altars/altarrugg.116 +\00099 ./arch/gods/altars/altarsori.111 +\00100 ./arch/gods/altars/altarsori.112 +\00101 ./arch/gods/altars/altarsori.113 +\00102 ./arch/gods/altars/altarsori.114 +\00103 ./arch/gods/altars/altarsori.115 +\00104 ./arch/gods/altars/altarsori.116 +\00105 ./arch/gods/altars/altarvalk.111 +\00106 ./arch/gods/altars/altarvalr.111 +\00107 ./arch/jewel/amber_coin.111 +\00108 ./arch/shop/ambolt.111 +\00109 ./arch/jewel/amethyst.111 +\00110 ./arch/jewel/amethyst.112 +\00111 ./arch/talisman/amulet.111 +\00112 ./arch/talisman/amulet_dark.111 +\00113 ./arch/talisman/amulet_darkmagenta.111 +\00114 ./arch/talisman/amulet_darkred.111 +\00115 ./arch/talisman/amulet_gray.111 +\00116 ./arch/talisman/amulet_lif.111 +\00117 ./arch/talisman/amulet_magenta.111 +\00118 ./arch/talisman/amulet_red.111 +\00119 ./arch/talisman/amulet_white.111 +\00120 ./arch/monster/angel/angel.111 +\00121 ./arch/monster/angel/angel.112 +\00122 ./arch/monster/angel/angel.131 +\00123 ./arch/monster/angel/angel.132 +\00124 ./arch/monster/angel/angel.151 +\00125 ./arch/monster/angel/angel.152 +\00126 ./arch/monster/angel/angel.171 +\00127 ./arch/monster/angel/angel.172 +\00128 ./arch/monster/angel/angel_sword.111 +\00129 ./arch/monster/angel/angel_sword.112 +\00130 ./arch/monster/angel/angel_sword.131 +\00131 ./arch/monster/angel/angel_sword.132 +\00132 ./arch/monster/angel/angel_sword.151 +\00133 ./arch/monster/angel/angel_sword.152 +\00134 ./arch/monster/angel/angel_sword.171 +\00135 ./arch/monster/angel/angel_sword.172 +\00136 ./arch/monster/angel/angelknight.x11 +\00137 ./arch/system/mood_floors/angry_floor.111 +\00138 ./arch/monster/insect/ant.111 +\00139 ./arch/monster/insect/ant.112 +\00140 ./arch/monster/insect/ant/ant_egg.111 +\00141 ./arch/monster/insect/ant_gen.111 +\00142 ./arch/monster/insect/ant/ant_larvae.111 +\00143 ./arch/monster/insect/ant/ant_larvae.112 +\00144 ./arch/monster/animal/ape.131 +\00145 ./arch/monster/animal/ape.132 +\00146 ./arch/monster/animal/ape.171 +\00147 ./arch/monster/animal/ape.172 +\00148 ./arch/food/apple.111 +\00149 ./arch/food/apple_eighth.111 +\00150 ./arch/food/apple_fourth.111 +\00151 ./arch/food/apple_half.111 +\00152 ./arch/monster/angel/archangel.x11 +\00153 ./arch/monster/angel/archangel.x12 +\00154 ./arch/monster/angel/archangel.x13 +\00155 ./arch/exit/archgold.111 +\00156 ./arch/exit/archgreen.111 +\00157 ./arch/monster/chaos/archon.111 +\00158 ./arch/monster/chaos/archon.222 +\00159 ./arch/monster/chaos/archon.333 +\00160 ./arch/monster/chaos/archon.444 +\00161 ./arch/exit/archtree.111 +\00162 ./arch/exit/archwood.111 +\00163 ./arch/flesh/human/arm.111 +\00164 ./arch/monster/humanoid/Human/armless_cook.111 +\00165 ./arch/monster/humanoid/Human/armless_cook.131 +\00166 ./arch/monster/humanoid/Human/armless_cook.151 +\00167 ./arch/monster/humanoid/Human/armless_cook.171 +\00168 ./arch/monster/troll/armourtroll2.111 +\00169 ./arch/monster/troll/armourtroll2.112 +\00170 ./arch/monster/troll/armourtroll3.111 +\00171 ./arch/monster/troll/armourtroll4.111 +\00172 ./arch/weapon/bow/arrow.101 +\00173 ./arch/weapon/bow/arrow.111 +\00174 ./arch/weapon/bow/arrow.121 +\00175 ./arch/weapon/bow/arrow.131 +\00176 ./arch/weapon/bow/arrow.141 +\00177 ./arch/weapon/bow/arrow.151 +\00178 ./arch/weapon/bow/arrow.161 +\00179 ./arch/weapon/bow/arrow.171 +\00180 ./arch/weapon/bow/arrow.181 +\00181 ./arch/spell/Bullet/asteroid.111 +\00182 ./arch/spell/Bullet/asteroid.112 +\00183 ./arch/spell/Bullet/asteroid.121 +\00184 ./arch/spell/Bullet/asteroid.131 +\00185 ./arch/spell/Bullet/asteroid.141 +\00186 ./arch/spell/Bullet/asteroid.151 +\00187 ./arch/spell/Bullet/asteroid.161 +\00188 ./arch/spell/Bullet/asteroid.171 +\00189 ./arch/spell/Bullet/asteroid.181 +\00190 ./arch/misc/Container/attache.111 +\00191 ./arch/spell/Golem/avatar.131 +\00192 ./arch/spell/Golem/avatar.132 +\00193 ./arch/spell/Golem/avatar.171 +\00194 ./arch/spell/Golem/avatar.172 +\00195 ./arch/wall/awall/awall_0.111 +\00196 ./arch/wall/awall/awall_1.111 +\00197 ./arch/wall/awall/awall_1_short.111 +\00198 ./arch/wall/awall/awall_2.111 +\00199 ./arch/wall/awall/awall_2_short.111 +\00200 ./arch/wall/awall/awall_3.111 +\00201 ./arch/wall/awall/awall_4.111 +\00202 ./arch/wall/awall/awall_4_short.111 +\00203 ./arch/wall/awall/awall_5.111 +\00204 ./arch/wall/awall/awall_55.111 +\00205 ./arch/wall/awall/awall_6.111 +\00206 ./arch/wall/awall/awall_7.111 +\00207 ./arch/wall/awall/awall_8.111 +\00208 ./arch/wall/awall/awall_8_short.111 +\00209 ./arch/wall/awall/awall_9.111 +\00210 ./arch/wall/awall/awall_A.111 +\00211 ./arch/wall/awall/awall_AA.111 +\00212 ./arch/wall/awall/awall_B.111 +\00213 ./arch/wall/awall/awall_C.111 +\00214 ./arch/wall/awall/awall_D.111 +\00215 ./arch/wall/awall/awall_E.111 +\00216 ./arch/wall/awall/awall_F.111 +\00217 ./arch/wall/awall/awall_w_0.111 +\00218 ./arch/wall/awall/awall_w_0.112 +\00219 ./arch/wall/awall/awall_w_0.113 +\00220 ./arch/wall/awall/awall_w_0.114 +\00221 ./arch/wall/awall/awall_w_0.115 +\00222 ./arch/wall/awall/awall_w_0.116 +\00223 ./arch/wall/awall/awall_w_0.117 +\00224 ./arch/wall/awall/awall_w_1.111 +\00225 ./arch/wall/awall/awall_w_1.112 +\00226 ./arch/wall/awall/awall_w_1.113 +\00227 ./arch/wall/awall/awall_w_1.114 +\00228 ./arch/wall/awall/awall_w_1.115 +\00229 ./arch/wall/awall/awall_w_1.116 +\00230 ./arch/wall/awall/awall_w_1.117 +\00231 ./arch/wall/awall/awall_w_1.118 +\00232 ./arch/wall/awall/awall_w_1.119 +\00233 ./arch/wall/awall/awall_w_1.11A +\00234 ./arch/wall/awall/awindow_0.111 +\00235 ./arch/wall/awall/awindow_1.111 +\00236 ./arch/weapon/axe/axe_1.111 +\00237 ./arch/weapon/axe/axe_2.111 +\00238 ./arch/weapon/axe/axe_3.111 +\00239 ./arch/weapon/axe/axe_3_golden.111 +\00240 ./arch/weapon/axe/axe_4.111 +\00241 ./arch/weapon/axe/axe_5.111 +\00242 ./arch/weapon/axe/b_axe1.111 +\00243 ./arch/weapon/sword/b_bsword_1.111 +\00244 ./arch/weapon/sword/b_bsword_2.111 +\00245 ./arch/weapon/sword/b_dagger.111 +\00246 ./arch/armour/helmet/b_fullhelmet.111 +\00247 ./arch/armour/gauntlets/b_gauntlet_s.111 +\00248 ./arch/armour/helmet/b_helmet.111 +\00249 ./arch/armour/helmet/b_hornhelmet.111 +\00250 ./arch/weapon/sword/b_lsword.111 +\00251 ./arch/armour/mail/b_plate_mail.111 +\00252 ./arch/armour/mail/b_scale_mail.111 +\00253 ./arch/weapon/sword/b_scimitar.111 +\00254 ./arch/armour/shield/b_shield.111 +\00255 ./arch/weapon/sword/b_sicklesword.111 +\00256 ./arch/misc/b_slicingknife.111 +\00257 ./arch/armour/shield/b_small_shie.111 +\00258 ./arch/weapon/sword/b_ssword_1.111 +\00259 ./arch/weapon/sword/b_ssword_2.111 +\00260 ./arch/weapon/sword/b_sword_1.111 +\00261 ./arch/weapon/sword/b_sword_2.111 +\00262 ./arch/monster/dragon/baby_drag.111 +\00263 ./arch/monster/dragon/baby_drag.112 +\00264 ./arch/monster/dragon/baby_drag.113 +\00265 ./arch/misc/Container/bag.111 +\00266 ./arch/food/bag_popcorn.111 +\00267 ./arch/misc/Bagpipe/bagpipe.111 +\00268 ./arch/misc/Bagpipe/bagpipe.112 +\00269 ./arch/misc/Bagpipe/bagpipe.113 +\00270 ./arch/misc/Bagpipe/bagpipe.114 +\00271 ./arch/misc/Bagpipe/bagpipe.115 +\00272 ./arch/misc/Bagpipe/bagpipe.116 +\00273 ./arch/misc/Bagpipe/bagpipe.117 +\00274 ./arch/misc/Bagpipe/bagpipe.118 +\00275 ./arch/misc/Bagpipe/bagpipe.119 +\00276 ./arch/misc/Bagpipe/bagpipe.11A +\00277 ./arch/spell/MovingBall/ball_lightning.111 +\00278 ./arch/spell/MovingBall/ball_lightning.222 +\00279 ./arch/spell/MovingBall/ball_lightning.333 +\00280 ./arch/spell/MovingBall/ball_lightning.444 +\00281 ./arch/spell/Potion/balm_gen.111 +\00282 ./arch/shop/bank.x11 +\00283 ./arch/shop/bank_west.x11 +\00284 ./arch/readable/bankcard.111 +\00285 ./arch/monster/undead/banshee.111 +\00286 ./arch/monster/undead/banshee.112 +\00287 ./arch/player/class/Warrior/barbarian.111 +\00288 ./arch/player/class/Warrior/barbarian.112 +\00289 ./arch/player/class/Warrior/barbarian.131 +\00290 ./arch/player/class/Warrior/barbarian.132 +\00291 ./arch/player/class/Warrior/barbarian.151 +\00292 ./arch/player/class/Warrior/barbarian.152 +\00293 ./arch/player/class/Warrior/barbarian.171 +\00294 ./arch/player/class/Warrior/barbarian.172 +\00295 ./arch/construct/town/barn.x11 +\00296 ./arch/construct/town/barn2.x11 +\00297 ./arch/construct/town/barn2_northwest.x11 +\00298 ./arch/construct/town/barn_west.x11 +\00299 ./arch/construct/barrack/barrack_l.x11 +\00300 ./arch/construct/barrack/barrack_l.x12 +\00301 ./arch/construct/barrack/barrack_s.111 +\00302 ./arch/construct/barrack/barrack_u.x11 +\00303 ./arch/construct/barrack/barrack_u.x12 +\00304 ./arch/indoor/barrel.111 +\00305 ./arch/monster/misc/Baslic/baslic.x31 +\00306 ./arch/monster/misc/Baslic/baslic.x32 +\00307 ./arch/monster/misc/Baslic/baslic.x71 +\00308 ./arch/monster/misc/Baslic/baslic.x72 +\00309 ./arch/monster/animal/bat.111 +\00310 ./arch/monster/animal/bat.112 +\00311 ./arch/monster/animal/bat.113 +\00312 ./arch/monster/animal/bat_gen.111 +\00313 ./arch/flesh/misc/bat_wing.111 +\00314 ./arch/weapon/axe/battle_axe.111 +\00315 ./arch/ground/beach.111 +\00316 ./arch/ground/smooth/beach_S.111 +\00317 ./arch/monster/animal/Bear/bear.x31 +\00318 ./arch/monster/animal/Bear/bear.x32 +\00319 ./arch/monster/animal/Bear/bear.x71 +\00320 ./arch/monster/animal/Bear/bear.x72 +\00321 ./arch/indoor/bed_1.111 +\00322 ./arch/indoor/bed_save.111 +\00323 ./arch/monster/insect/bee.111 +\00324 ./arch/monster/insect/bee.112 +\00325 ./arch/monster/insect/bee_gen.111 +\00326 ./arch/monster/insect/beehive.111 +\00327 ./arch/monster/insect/beehive.112 +\00328 ./arch/monster/humanoid/Arabic/beggar.111 +\00329 ./arch/monster/animal/Behemoth/behemoth.x31 +\00330 ./arch/monster/animal/Behemoth/behemoth.x32 +\00331 ./arch/monster/animal/Behemoth/behemoth.x33 +\00332 ./arch/monster/animal/Behemoth/behemoth.x71 +\00333 ./arch/monster/animal/Behemoth/behemoth.x72 +\00334 ./arch/monster/animal/Behemoth/behemoth.x73 +\00335 ./arch/flesh/misc/behold_eye.111 +\00336 ./arch/monster/beholder/behold_gen.111 +\00337 ./arch/monster/beholder/beholder.111 +\00338 ./arch/monster/beholder/beholder.112 +\00339 ./arch/monster/beholder/beholder.113 +\00340 ./arch/monster/beholder/beholder.114 +\00341 ./arch/monster/beholder/beholder_leader.111 +\00342 ./arch/floor/inlayed/beige-cyan-c-marble.111 +\00343 ./arch/floor/inlayed/beige-cyan-c-marble.112 +\00344 ./arch/floor/inlayed/beige-cyan-c-marble.113 +\00345 ./arch/floor/inlayed/beige-cyan-c-marble.114 +\00346 ./arch/floor/inlayed/beige-green-c-marble.111 +\00347 ./arch/floor/inlayed/beige-green-c-marble.112 +\00348 ./arch/floor/inlayed/beige-green-c-marble.113 +\00349 ./arch/floor/inlayed/beige-green-c-marble.114 +\00350 ./arch/floor/inlayed/beige-pink-c-marble.111 +\00351 ./arch/floor/inlayed/beige-pink-c-marble.112 +\00352 ./arch/floor/inlayed/beige-pink-c-marble.113 +\00353 ./arch/floor/inlayed/beige-pink-c-marble.114 +\00354 ./arch/floor/inlayed/beige-white-c-marble.111 +\00355 ./arch/floor/inlayed/beige-white-c-marble.112 +\00356 ./arch/floor/inlayed/beige-white-c-marble.113 +\00357 ./arch/floor/inlayed/beige-white-c-marble.114 +\00358 ./arch/floor/beigemarble.111 +\00359 ./arch/monster/giant/Belzebub/belzebub.x11 +\00360 ./arch/monster/giant/Belzebub/belzebub.x12 +\00361 ./arch/wall/bench/bench_0.111 +\00362 ./arch/wall/bench/bench_1.111 +\00363 ./arch/wall/bench/bench_2.111 +\00364 ./arch/wall/bench/bench_3.111 +\00365 ./arch/wall/bench/bench_4.111 +\00366 ./arch/wall/bench/bench_5.111 +\00367 ./arch/wall/bench/bench_6.111 +\00368 ./arch/wall/bench/bench_7.111 +\00369 ./arch/wall/bench/bench_8.111 +\00370 ./arch/wall/bench/bench_9.111 +\00371 ./arch/wall/bench/bench_A.111 +\00372 ./arch/wall/bench/bench_B.111 +\00373 ./arch/wall/bench/bench_C.111 +\00374 ./arch/wall/bench/bench_D.111 +\00375 ./arch/wall/bench/bench_E.111 +\00376 ./arch/wall/bench/bench_F.111 +\00377 ./arch/ground/Wood/bforest.111 +\00378 ./arch/weapon/club/big_club.111 +\00379 ./arch/monster/demon/Big_Demon/big_demon.x31 +\00380 ./arch/monster/demon/Big_Demon/big_demon.x71 +\00381 ./arch/flesh/generic/big_eye.111 +\00382 ./arch/monster/humanoid/Arabic/big_slave.111 +\00383 ./arch/monster/giant/Big_Wiz/big_wiz.x11 +\00384 ./arch/monster/giant/Big_Wiz/big_wiz.x12 +\00385 ./arch/monster/giant/Big_Wiz/big_wiz.x13 +\00386 ./arch/monster/giant/Big_Wiz/big_wiz.x14 +\00387 ./arch/monster/giant/Big_Wiz/big_wiz.x15 +\00388 ./arch/transport/biggalleon.x11 +\00389 ./arch/armour/helmet/bighorn_he.111 +\00390 ./arch/monster/animal/bird.111 +\00391 ./arch/monster/animal/bird.112 +\00392 ./arch/monster/animal/bird.131 +\00393 ./arch/monster/animal/bird.132 +\00394 ./arch/monster/animal/bird.151 +\00395 ./arch/monster/animal/bird.152 +\00396 ./arch/monster/animal/bird.171 +\00397 ./arch/monster/animal/bird.172 +\00398 ./arch/monster/animal/bird_gen.111 +\00399 ./arch/monster/humanoid/Dragon/black_dragon2.151 +\00400 ./arch/monster/humanoid/Dragon/black_dragon2.152 +\00401 ./arch/monster/humanoid/Dragon/black_dragon2.171 +\00402 ./arch/monster/humanoid/Dragon/black_dragon2.172 +\00403 ./arch/misc/blackfirebullet.111 +\00404 ./arch/misc/blackfirebullet.121 +\00405 ./arch/misc/blackfirebullet.131 +\00406 ./arch/misc/blackfirebullet.141 +\00407 ./arch/misc/blackfirebullet.151 +\00408 ./arch/misc/blackfirebullet.161 +\00409 ./arch/misc/blackfirebullet.171 +\00410 ./arch/misc/blackfirebullet.181 +\00411 ./arch/floor/blackmarble.111 +\00412 ./arch/ground/blackrock.111 +\00413 ./arch/ground/smooth/blackrock_S.111 +\00414 ./arch/food/blackroot.111 +\00415 ./arch/traps/blades.111 +\00416 ./arch/ground/Lake/blake_0.111 +\00417 ./arch/ground/Lake/blake_1.111 +\00418 ./arch/ground/Lake/blake_2.111 +\00419 ./arch/ground/Lake/blake_3.111 +\00420 ./arch/ground/Lake/blake_4.111 +\00421 ./arch/ground/Lake/blake_5.111 +\00422 ./arch/ground/Lake/blake_6.111 +\00423 ./arch/ground/Lake/blake_7.111 +\00424 ./arch/ground/Lake/blake_8.111 +\00425 ./arch/ground/Lake/blake_9.111 +\00426 ./arch/ground/Lake/blake_A.111 +\00427 ./arch/ground/Lake/blake_B.111 +\00428 ./arch/ground/Lake/blake_C.111 +\00429 ./arch/ground/Lake/blake_D.111 +\00430 ./arch/ground/Lake/blake_E.111 +\00431 ./arch/ground/Lake/blake_F.111 +\00432 ./arch/system/blank.111 +\00433 ./arch/monster/misc/blob.111 +\00434 ./arch/monster/misc/blob.112 +\00435 ./arch/monster/misc/blob.113 +\00436 ./arch/system/blocked.111 +\00437 ./arch/system/blocked_blue.111 +\00438 ./arch/system/blocked_cyan.111 +\00439 ./arch/system/blocked_darkblue.111 +\00440 ./arch/system/blocked_darkmagenta.111 +\00441 ./arch/system/blocked_gray.111 +\00442 ./arch/system/blocked_green.111 +\00443 ./arch/system/blocked_lightgray.111 +\00444 ./arch/system/blocked_lime.111 +\00445 ./arch/system/blocked_magenta.111 +\00446 ./arch/system/blocked_maroon.111 +\00447 ./arch/system/blocked_olive.111 +\00448 ./arch/system/blocked_red.111 +\00449 ./arch/system/blocked_teal.111 +\00450 ./arch/system/blocked_white.111 +\00451 ./arch/system/blocked_yellow.111 +\00452 ./arch/misc/blood.111 +\00453 ./arch/ground/blood_sea.111 +\00454 ./arch/ground/blood_sea.112 +\00455 ./arch/ground/blood_sea.113 +\00456 ./arch/ground/blood_sea.114 +\00457 ./arch/ground/smooth/blood_sea_S.111 +\00458 ./arch/ground/smooth/blood_sea_S.112 +\00459 ./arch/ground/smooth/blood_sea_S.113 +\00460 ./arch/ground/smooth/blood_sea_S.114 +\00461 ./arch/jewel/blue_crystal.111 +\00462 ./arch/monster/humanoid/Dragon/blue_dragon2.151 +\00463 ./arch/monster/humanoid/Dragon/blue_dragon2.152 +\00464 ./arch/monster/humanoid/Dragon/blue_dragon2.171 +\00465 ./arch/monster/humanoid/Dragon/blue_dragon2.172 +\00466 ./arch/armour/mail/bluedragonmail.111 +\00467 ./arch/floor/bluemarble.111 +\00468 ./arch/floor/bluemarblemedium.111 +\00469 ./arch/monster/acid/bluesphere.111 +\00470 ./arch/monster/acid/bluesphere.112 +\00471 ./arch/monster/acid/bluesphere.113 +\00472 ./arch/monster/acid/bluesphere.114 +\00473 ./arch/weapon/bow/bolt.101 +\00474 ./arch/weapon/bow/bolt.111 +\00475 ./arch/weapon/bow/bolt.121 +\00476 ./arch/weapon/bow/bolt.131 +\00477 ./arch/weapon/bow/bolt.141 +\00478 ./arch/weapon/bow/bolt.151 +\00479 ./arch/weapon/bow/bolt.161 +\00480 ./arch/weapon/bow/bolt.171 +\00481 ./arch/weapon/bow/bolt.181 +\00482 ./arch/misc/item/bolt_silk.111 +\00483 ./arch/spell/Bomb/bomb.111 +\00484 ./arch/spell/Bomb/bomb.112 +\00485 ./arch/spell/Bomb/bomb.113 +\00486 ./arch/spell/Bomb/bomb.114 +\00487 ./arch/monster/dragon/bone_drake/bone_drake.x11 +\00488 ./arch/monster/dragon/bone_drake/bone_drake.x12 +\00489 ./arch/monster/demon/bone_head.111 +\00490 ./arch/monster/demon/bone_head.112 +\00491 ./arch/monster/demon/bone_head.113 +\00492 ./arch/weapon/artifact/bonecrush.111 +\00493 ./arch/misc/bones1.111 +\00494 ./arch/misc/bones2.111 +\00495 ./arch/misc/bones3.111 +\00496 ./arch/misc/bones4.111 +\00497 ./arch/misc/bones5.111 +\00498 ./arch/readable/book_clasp.111 +\00499 ./arch/readable/book_read.111 +\00500 ./arch/readable/guide/book_red.111 +\00501 ./arch/misc/Container/bookshelf.111 +\00502 ./arch/misc/Container/bookshelf2.111 +\00503 ./arch/misc/Container/bookshelf_bottom.111 +\00504 ./arch/misc/Container/bookshelf_left.111 +\00505 ./arch/misc/Container/bookshelf_right.111 +\00506 ./arch/food/booze.111 +\00507 ./arch/food/boozebottle_empty.111 +\00508 ./arch/misc/boulder.111 +\00509 ./arch/misc/bouquet.111 +\00510 ./arch/weapon/bow/bow.111 +\00511 ./arch/monster/acid/bpudding.111 +\00512 ./arch/monster/acid/bpudding.112 +\00513 ./arch/monster/acid/bpudding_g.111 +\00514 ./arch/monster/acid/bpudding_g.112 +\00515 ./arch/monster/acid/bpudding_g.113 +\00516 ./arch/monster/acid/bpudding_g.114 +\00517 ./arch/monster/acid/bpudding_g.115 +\00518 ./arch/monster/acid/bpudding_g.116 +\00519 ./arch/monster/acid/bpudding_g.117 +\00520 ./arch/monster/acid/bpudding_g.118 +\00521 ./arch/monster/acid/bpudding_g.119 +\00522 ./arch/monster/acid/bpudding_s.111 +\00523 ./arch/monster/acid/bpudding_s.112 +\00524 ./arch/monster/acid/bpudding_s.113 +\00525 ./arch/monster/acid/bpudding_s.114 +\00526 ./arch/armour/bracers/bracers_ac.111 +\00527 ./arch/armour/bracers/bracersdex.111 +\00528 ./arch/flesh/generic/brain.111 +\00529 ./arch/river/branch_125.111 +\00530 ./arch/river/branch_125.211 +\00531 ./arch/river/branch_135.111 +\00532 ./arch/river/branch_137.111 +\00533 ./arch/river/branch_145.111 +\00534 ./arch/river/branch_145.211 +\00535 ./arch/river/branch_156.111 +\00536 ./arch/river/branch_156.211 +\00537 ./arch/river/branch_157.111 +\00538 ./arch/river/branch_158.111 +\00539 ./arch/river/branch_158.211 +\00540 ./arch/river/branch_237.111 +\00541 ./arch/river/branch_237.211 +\00542 ./arch/river/branch_347.111 +\00543 ./arch/river/branch_347.211 +\00544 ./arch/river/branch_357.111 +\00545 ./arch/river/branch_367.111 +\00546 ./arch/river/branch_367.211 +\00547 ./arch/river/branch_378.111 +\00548 ./arch/river/branch_378.211 +\00549 ./arch/misc/brazier.111 +\00550 ./arch/misc/brazier.112 +\00551 ./arch/misc/brazier.113 +\00552 ./arch/misc/brazier.114 +\00553 ./arch/weapon/axe/brdaxe_1.111 +\00554 ./arch/weapon/axe/brdaxe_1.112 +\00555 ./arch/weapon/axe/brdaxe_1.113 +\00556 ./arch/weapon/axe/brdaxe_1.114 +\00557 ./arch/monster/insect/ant/breeder_ant.x11 +\00558 ./arch/monster/insect/ant/breeder_ant.x12 +\00559 ./arch/ground/brefjell.111 +\00560 ./arch/river/bridge_15.111 +\00561 ./arch/river/bridge_37.111 +\00562 ./arch/wall/gwall/bridge_m0.111 +\00563 ./arch/wall/gwall/bridge_m1.111 +\00564 ./arch/jewel/bronzebar.111 +\00565 ./arch/monster/misc/broo.111 +\00566 ./arch/monster/misc/broo.112 +\00567 ./arch/monster/misc/broo.113 +\00568 ./arch/ground/Wood/brush.111 +\00569 ./arch/weapon/sword/bsword_1.111 +\00570 ./arch/weapon/sword/bsword_2.111 +\00571 ./arch/construct/town/building10_east.x11 +\00572 ./arch/construct/town/building1_east.111 +\00573 ./arch/construct/town/building2_east.x11 +\00574 ./arch/construct/town/building3_east.x11 +\00575 ./arch/construct/town/building4_east.x11 +\00576 ./arch/construct/town/building5_east.x11 +\00577 ./arch/construct/town/building6_east.x11 +\00578 ./arch/construct/town/building7_east.x11 +\00579 ./arch/construct/town/building8_east.x11 +\00580 ./arch/construct/town/building9_east.x11 +\00581 ./arch/wall/bulletwall/bul_wall_0.111 +\00582 ./arch/wall/bulletwall/bul_wall_1.111 +\00583 ./arch/wall/bulletwall/bul_wall_2.111 +\00584 ./arch/wall/bulletwall/bul_wall_3.111 +\00585 ./arch/wall/bulletwall/bul_wall_4.111 +\00586 ./arch/wall/bulletwall/bul_wall_5.111 +\00587 ./arch/wall/bulletwall/bul_wall_6.111 +\00588 ./arch/wall/bulletwall/bul_wall_7.111 +\00589 ./arch/wall/bulletwall/bul_wall_8.111 +\00590 ./arch/spell/Bullet/bullet.111 +\00591 ./arch/spell/Bullet/bullet.112 +\00592 ./arch/spell/Bullet/bullet.121 +\00593 ./arch/spell/Bullet/bullet.131 +\00594 ./arch/spell/Bullet/bullet.141 +\00595 ./arch/spell/Bullet/bullet.151 +\00596 ./arch/spell/Bullet/bullet.161 +\00597 ./arch/spell/Bullet/bullet.171 +\00598 ./arch/spell/Bullet/bullet.181 +\00599 ./arch/construct/bungalow.111 +\00600 ./arch/planes/fire/burning_barn.x11 +\00601 ./arch/planes/fire/burning_cathedral.x11 +\00602 ./arch/planes/fire/burning_church.x11 +\00603 ./arch/planes/fire/burning_collesium.x11 +\00604 ./arch/planes/fire/burning_courthouse.x11 +\00605 ./arch/planes/fire/burning_fort.x11 +\00606 ./arch/planes/fire/burning_fort_sym.111 +\00607 ./arch/planes/fire/burning_fountain.111 +\00608 ./arch/planes/fire/burning_fountain.112 +\00609 ./arch/planes/fire/burning_fountain.113 +\00610 ./arch/planes/fire/burning_guild.x11 +\00611 ./arch/planes/fire/burning_house_1.111 +\00612 ./arch/planes/fire/burning_house_larg.x11 +\00613 ./arch/planes/fire/burning_house_long.x11 +\00614 ./arch/planes/fire/burning_house_up.x11 +\00615 ./arch/planes/fire/burning_housesmall.111 +\00616 ./arch/planes/fire/burning_l_shop1.x11 +\00617 ./arch/planes/fire/burning_market1.111 +\00618 ./arch/planes/fire/burning_market2.111 +\00619 ./arch/planes/fire/burning_market3.111 +\00620 ./arch/planes/fire/burning_shrine.111 +\00621 ./arch/planes/fire/burning_smalltemple.111 +\00622 ./arch/planes/fire/burning_store_alch.x11 +\00623 ./arch/planes/fire/burning_store_armo.x11 +\00624 ./arch/planes/fire/burning_store_gene.x11 +\00625 ./arch/planes/fire/burning_store_magi.x11 +\00626 ./arch/planes/fire/burning_store_weap.x11 +\00627 ./arch/planes/fire/burning_stronghold.x11 +\00628 ./arch/planes/fire/burning_t_house2.x11 +\00629 ./arch/planes/fire/burning_temple1.x11 +\00630 ./arch/gods/items/burning_tail/burningtail.111 +\00631 ./arch/gods/items/burning_tail/burningtail.112 +\00632 ./arch/gods/items/burning_tail/burningtail.113 +\00633 ./arch/planes/fire/burningwall/burningwall_0.111 +\00634 ./arch/planes/fire/burningwall/burningwall_0.112 +\00635 ./arch/planes/fire/burningwall/burningwall_1.111 +\00636 ./arch/planes/fire/burningwall/burningwall_1.112 +\00637 ./arch/planes/fire/burningwall/burningwall_2.111 +\00638 ./arch/planes/fire/burningwall/burningwall_2.112 +\00639 ./arch/planes/fire/burningwall/burningwall_3.111 +\00640 ./arch/planes/fire/burningwall/burningwall_3.112 +\00641 ./arch/planes/fire/burningwall/burningwall_4.111 +\00642 ./arch/planes/fire/burningwall/burningwall_4.112 +\00643 ./arch/planes/fire/burningwall/burningwall_5.111 +\00644 ./arch/planes/fire/burningwall/burningwall_5.112 +\00645 ./arch/planes/fire/burningwall/burningwall_6.111 +\00646 ./arch/planes/fire/burningwall/burningwall_6.112 +\00647 ./arch/planes/fire/burningwall/burningwall_7.111 +\00648 ./arch/planes/fire/burningwall/burningwall_7.112 +\00649 ./arch/planes/fire/burningwall/burningwall_8.111 +\00650 ./arch/planes/fire/burningwall/burningwall_8.112 +\00651 ./arch/planes/fire/burningwall/burningwall_9.111 +\00652 ./arch/planes/fire/burningwall/burningwall_9.112 +\00653 ./arch/planes/fire/burningwall/burningwall_A.111 +\00654 ./arch/planes/fire/burningwall/burningwall_A.112 +\00655 ./arch/planes/fire/burningwall/burningwall_B.111 +\00656 ./arch/planes/fire/burningwall/burningwall_B.112 +\00657 ./arch/planes/fire/burningwall/burningwall_C.111 +\00658 ./arch/planes/fire/burningwall/burningwall_C.112 +\00659 ./arch/planes/fire/burningwall/burningwall_D.111 +\00660 ./arch/planes/fire/burningwall/burningwall_D.112 +\00661 ./arch/planes/fire/burningwall/burningwall_E.111 +\00662 ./arch/planes/fire/burningwall/burningwall_E.112 +\00663 ./arch/planes/fire/burningwall/burningwall_F.111 +\00664 ./arch/planes/fire/burningwall/burningwall_F.112 +\00665 ./arch/spell/Burnout/burnout.111 +\00666 ./arch/spell/Burnout/burnout.112 +\00667 ./arch/spell/Burnout/burnout.113 +\00668 ./arch/spell/Burnout/burnout.114 +\00669 ./arch/spell/Burnout/burnout.115 +\00670 ./arch/spell/Burnout/burnout.116 +\00671 ./arch/spell/Burnout/burnout.117 +\00672 ./arch/spell/Burnout/burnout.118 +\00673 ./arch/spell/Burnout/burnout.119 +\00674 ./arch/spell/Burnout/burnout.11A +\00675 ./arch/spell/Burnout/burnout.11B +\00676 ./arch/spell/Burnout/burnout.11C +\00677 ./arch/spell/Burnout/burnout.11D +\00678 ./arch/spell/Burnout/burnout.11E +\00679 ./arch/spell/Burnout/burnout.11F +\00680 ./arch/spell/Burnout/burnout.11G +\00681 ./arch/spell/Burnout/burnout.11H +\00682 ./arch/spell/Burnout/burnout.11J +\00683 ./arch/spell/Burnout/burnout.11K +\00684 ./arch/spell/Burnout/burnout.11L +\00685 ./arch/spell/Burnout/burnout.11M +\00686 ./arch/spell/Burnout/burnout.11N +\00687 ./arch/spell/Burnout/burnout.11O +\00688 ./arch/spell/Burnout/burnout.11P +\00689 ./arch/spell/Burnout/burnout.11Q +\00690 ./arch/spell/Burnout/burnout.11R +\00691 ./arch/weapon/sword/butterflysword_1.111 +\00692 ./arch/weapon/sword/butterflysword_2.111 +\00693 ./arch/connect/button_big.111 +\00694 ./arch/connect/button_big.112 +\00695 ./arch/connect/button_sma.111 +\00696 ./arch/connect/button_sma.112 +\00697 ./arch/wall/bwall/bwall_0.111 +\00698 ./arch/wall/bwall/bwall_1.111 +\00699 ./arch/wall/bwall/bwall_2.111 +\00700 ./arch/wall/bwall/bwall_3.111 +\00701 ./arch/wall/bwall/bwall_4.111 +\00702 ./arch/wall/bwall/bwall_5.111 +\00703 ./arch/wall/bwall/bwall_6.111 +\00704 ./arch/wall/bwall/bwall_7.111 +\00705 ./arch/wall/bwall/bwall_8.111 +\00706 ./arch/wall/bwall/bwall_9.111 +\00707 ./arch/wall/bwall/bwall_A.111 +\00708 ./arch/wall/bwall/bwall_B.111 +\00709 ./arch/wall/bwall/bwall_C.111 +\00710 ./arch/wall/bwall/bwall_D.111 +\00711 ./arch/wall/bwall/bwall_E.111 +\00712 ./arch/wall/bwall/bwall_F.111 +\00713 ./arch/wall/bwall/bwall_hole_5.111 +\00714 ./arch/wall/bwall/bwall_hole_A.111 +\00715 ./arch/wall/bwall/bwall_w_0.111 +\00716 ./arch/wall/bwall/bwall_w_0.112 +\00717 ./arch/wall/bwall/bwall_w_0.113 +\00718 ./arch/wall/bwall/bwall_w_0.114 +\00719 ./arch/wall/bwall/bwall_w_0.115 +\00720 ./arch/wall/bwall/bwall_w_0.116 +\00721 ./arch/wall/bwall/bwall_w_0.117 +\00722 ./arch/wall/bwall/bwall_w_1.111 +\00723 ./arch/wall/bwall/bwall_w_1.112 +\00724 ./arch/wall/bwall/bwall_w_1.113 +\00725 ./arch/wall/bwall/bwall_w_1.114 +\00726 ./arch/wall/bwall/bwall_w_1.115 +\00727 ./arch/wall/bwall/bwall_w_1.116 +\00728 ./arch/wall/bwall/bwall_w_1.117 +\00729 ./arch/monster/giant/byakie/byakie.x11 +\00730 ./arch/monster/giant/byakie/byakie.x12 +\00731 ./arch/monster/misc/c_knight.111 +\00732 ./arch/monster/misc/c_knight.112 +\00733 ./arch/monster/misc/c_priest.131 +\00734 ./arch/monster/misc/c_priest.132 +\00735 ./arch/monster/misc/c_priest.171 +\00736 ./arch/monster/misc/c_priest.172 +\00737 ./arch/food/cabbage.111 +\00738 ./arch/food/cake.111 +\00739 ./arch/system/mood_floors/calm_floor.111 +\00740 ./arch/misc/Camp/campfire.111 +\00741 ./arch/misc/Camp/campfire.112 +\00742 ./arch/misc/Camp/campfire.113 +\00743 ./arch/misc/Camp/campfire.114 +\00744 ./arch/misc/Camp/campfire_out.111 +\00745 ./arch/spell/Bolt/cancellation.111 +\00746 ./arch/spell/Bolt/cancellation.112 +\00747 ./arch/spell/Bolt/cancellation.113 +\00748 ./arch/misc/cannon_0.111 +\00749 ./arch/misc/cannon_1.111 +\00750 ./arch/misc/cannon_2.111 +\00751 ./arch/misc/cannon_3.111 +\00752 ./arch/misc/cannon_4.111 +\00753 ./arch/misc/cannon_5.111 +\00754 ./arch/misc/cannon_6.111 +\00755 ./arch/misc/cannon_7.111 +\00756 ./arch/misc/cannon_8.111 +\00757 ./arch/construct/keep/capitalhold_east.x11 +\00758 ./arch/construct/keep/capitalhold_west.x11 +\00759 ./arch/food/caramel.111 +\00760 ./arch/readable/card.111 +\00761 ./arch/readable/card_crown.111 +\00762 ./arch/readable/card_cup.111 +\00763 ./arch/readable/card_dragon.111 +\00764 ./arch/readable/card_ring.111 +\00765 ./arch/readable/card_skull.111 +\00766 ./arch/readable/card_sword.111 +\00767 ./arch/food/carrot.111 +\00768 ./arch/misc/Container/carton_box_1.111 +\00769 ./arch/misc/Container/carton_box_1_open.111 +\00770 ./arch/construct/castle/castle.111 +\00771 ./arch/construct/castle/castle_a.x11 +\00772 ./arch/construct/castle/castle_a.x12 +\00773 ./arch/construct/castle/castle_a_east.x11 +\00774 ./arch/construct/castle/castle_a_northwest.x11 +\00775 ./arch/construct/castle/castle_a_northwest.x12 +\00776 ./arch/construct/castle/castle_a_western.x11 +\00777 ./arch/construct/castle/castle_a_western.x12 +\00778 ./arch/construct/castle/castle_west.111 +\00779 ./arch/construct/temple/cathedral.x11 +\00780 ./arch/misc/Container/cauldron.111 +\00781 ./arch/misc/Container/cauldron_open.111 +\00782 ./arch/spell/Bullet/cause.111 +\00783 ./arch/spell/Bullet/cause.112 +\00784 ./arch/wall/cave/cave1.111 +\00785 ./arch/wall/cave/cave10.111 +\00786 ./arch/wall/cave/cave11.111 +\00787 ./arch/wall/cave/cave12.111 +\00788 ./arch/wall/cave/cave13.111 +\00789 ./arch/wall/cave/cave14.111 +\00790 ./arch/wall/cave/cave15.111 +\00791 ./arch/wall/cave/cave16.111 +\00792 ./arch/wall/cave/cave17.111 +\00793 ./arch/wall/cave/cave18.111 +\00794 ./arch/wall/cave/cave19.111 +\00795 ./arch/wall/cave/cave2.111 +\00796 ./arch/wall/cave/cave20.111 +\00797 ./arch/wall/cave/cave21.111 +\00798 ./arch/wall/cave/cave22.111 +\00799 ./arch/wall/cave/cave23.111 +\00800 ./arch/wall/cave/cave24.111 +\00801 ./arch/wall/cave/cave25.111 +\00802 ./arch/wall/cave/cave3.111 +\00803 ./arch/wall/cave/cave4.111 +\00804 ./arch/wall/cave/cave5.111 +\00805 ./arch/wall/cave/cave6.111 +\00806 ./arch/wall/cave/cave7.111 +\00807 ./arch/wall/cave/cave8.111 +\00808 ./arch/wall/cave/cave9.111 +\00809 ./arch/wall/cave/cave_0.111 +\00810 ./arch/wall/cave/cave_1.111 +\00811 ./arch/wall/cave/cave_10.111 +\00812 ./arch/wall/cave/cave_11.111 +\00813 ./arch/wall/cave/cave_12.111 +\00814 ./arch/wall/cave/cave_13.111 +\00815 ./arch/wall/cave/cave_14.111 +\00816 ./arch/wall/cave/cave_2.111 +\00817 ./arch/wall/cave/cave_3.111 +\00818 ./arch/wall/cave/cave_4.111 +\00819 ./arch/wall/cave/cave_5.111 +\00820 ./arch/wall/cave/cave_6.111 +\00821 ./arch/wall/cave/cave_7.111 +\00822 ./arch/wall/cave/cave_8.111 +\00823 ./arch/wall/cave/cave_9.111 +\00824 ./arch/monster/insect/centipede.111 +\00825 ./arch/monster/insect/centipede.112 +\00826 ./arch/monster/insect/centipede.113 +\00827 ./arch/monster/insect/centipede.114 +\00828 ./arch/monster/insect/centipede.121 +\00829 ./arch/monster/insect/centipede.122 +\00830 ./arch/monster/insect/centipede.123 +\00831 ./arch/monster/insect/centipede.124 +\00832 ./arch/monster/insect/centipede.131 +\00833 ./arch/monster/insect/centipede.132 +\00834 ./arch/monster/insect/centipede.133 +\00835 ./arch/monster/insect/centipede.134 +\00836 ./arch/monster/insect/centipede.141 +\00837 ./arch/monster/insect/centipede.142 +\00838 ./arch/monster/insect/centipede.143 +\00839 ./arch/monster/insect/centipede.144 +\00840 ./arch/monster/insect/centipede.151 +\00841 ./arch/monster/insect/centipede.152 +\00842 ./arch/monster/insect/centipede.153 +\00843 ./arch/monster/insect/centipede.154 +\00844 ./arch/monster/insect/centipede.161 +\00845 ./arch/monster/insect/centipede.162 +\00846 ./arch/monster/insect/centipede.163 +\00847 ./arch/monster/insect/centipede.164 +\00848 ./arch/monster/insect/centipede.171 +\00849 ./arch/monster/insect/centipede.172 +\00850 ./arch/monster/insect/centipede.173 +\00851 ./arch/monster/insect/centipede.174 +\00852 ./arch/monster/insect/centipede.181 +\00853 ./arch/monster/insect/centipede.182 +\00854 ./arch/monster/insect/centipede.183 +\00855 ./arch/monster/insect/centipede.184 +\00856 ./arch/monster/insect/centipede_r.111 +\00857 ./arch/monster/insect/centipede_r.112 +\00858 ./arch/monster/insect/centipede_r.113 +\00859 ./arch/ground/Winter/cforest1.111 +\00860 ./arch/ground/Winter/cforest2.111 +\00861 ./arch/ground/Winter/cforest3.111 +\00862 ./arch/ground/Winter/cforest4.111 +\00863 ./arch/ground/Winter/cforest5.111 +\00864 ./arch/ground/Winter/cforest6.111 +\00865 ./arch/monster/misc/Chess/ch_bish.111 +\00866 ./arch/monster/misc/Chess/ch_bish_w.111 +\00867 ./arch/food/ch_burger.111 +\00868 ./arch/monster/misc/Chess/ch_king.111 +\00869 ./arch/monster/misc/Chess/ch_king_w.111 +\00870 ./arch/monster/misc/Chess/ch_knight.111 +\00871 ./arch/monster/misc/Chess/ch_knight_w.111 +\00872 ./arch/monster/misc/Chess/ch_pawn.111 +\00873 ./arch/monster/misc/Chess/ch_pawn_w.111 +\00874 ./arch/monster/misc/Chess/ch_queen.111 +\00875 ./arch/monster/misc/Chess/ch_queen_w.111 +\00876 ./arch/monster/misc/Chess/ch_rook.111 +\00877 ./arch/monster/misc/Chess/ch_rook_w.111 +\00878 ./arch/armour/mail/chainmail.111 +\00879 ./arch/indoor/chair.111 +\00880 ./arch/indoor/chair_1.101 +\00881 ./arch/indoor/chair_1.111 +\00882 ./arch/indoor/chair_1.121 +\00883 ./arch/indoor/chair_1.131 +\00884 ./arch/indoor/chair_2.101 +\00885 ./arch/indoor/chair_2.111 +\00886 ./arch/indoor/chair_2.121 +\00887 ./arch/indoor/chair_2.131 +\00888 ./arch/indoor/chair_3.101 +\00889 ./arch/indoor/chair_3.111 +\00890 ./arch/indoor/chair_bc_2.101 +\00891 ./arch/indoor/chair_bc_2.111 +\00892 ./arch/indoor/chair_bc_2.121 +\00893 ./arch/indoor/chair_bc_2.131 +\00894 ./arch/indoor/chair_cw_1.101 +\00895 ./arch/indoor/chair_cw_1.111 +\00896 ./arch/indoor/chair_cw_1.121 +\00897 ./arch/indoor/chair_cw_1.131 +\00898 ./arch/indoor/chair_gv_1.101 +\00899 ./arch/indoor/chair_gv_1.111 +\00900 ./arch/indoor/chair_gv_1.121 +\00901 ./arch/indoor/chair_gv_1.131 +\00902 ./arch/indoor/chair_wv_1.101 +\00903 ./arch/indoor/chair_wv_1.111 +\00904 ./arch/indoor/chair_wv_1.121 +\00905 ./arch/indoor/chair_wv_1.131 +\00906 ./arch/misc/chalice.111 +\00907 ./arch/misc/chalice.112 +\00908 ./arch/misc/chalice.113 +\00909 ./arch/misc/chalice.114 +\00910 ./arch/misc/chalice_bro.111 +\00911 ./arch/misc/chalice_bro.112 +\00912 ./arch/misc/chalice_bro.113 +\00913 ./arch/misc/chalice_bro.114 +\00914 ./arch/misc/chalice_cop.111 +\00915 ./arch/misc/chalice_cop.112 +\00916 ./arch/misc/chalice_cop.113 +\00917 ./arch/misc/chalice_cop.114 +\00918 ./arch/misc/chalice_iro.111 +\00919 ./arch/misc/chalice_iro.112 +\00920 ./arch/misc/chalice_iro.113 +\00921 ./arch/misc/chalice_iro.114 +\00922 ./arch/misc/chalice_plat.111 +\00923 ./arch/misc/chalice_plat.112 +\00924 ./arch/misc/chalice_plat.113 +\00925 ./arch/misc/chalice_plat.114 +\00926 ./arch/misc/chalice_sil.111 +\00927 ./arch/misc/chalice_sil.112 +\00928 ./arch/misc/chalice_sil.113 +\00929 ./arch/misc/chalice_sil.114 +\00930 ./arch/misc/chalice_tin.111 +\00931 ./arch/misc/chalice_tin.112 +\00932 ./arch/misc/chalice_tin.113 +\00933 ./arch/misc/chalice_tin.114 +\00934 ./arch/misc/chandelier_1.x11 +\00935 ./arch/misc/chandelier_2.111 +\00936 ./arch/misc/chandelier_2.112 +\00937 ./arch/misc/chandelier_2.113 +\00938 ./arch/misc/chandelier_2.114 +\00939 ./arch/misc/chandelier_2_copper.111 +\00940 ./arch/misc/chandelier_2_copper.112 +\00941 ./arch/misc/chandelier_2_copper.113 +\00942 ./arch/misc/chandelier_2_copper.114 +\00943 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x31 +\00944 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x32 +\00945 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x33 +\00946 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x34 +\00947 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x71 +\00948 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x72 +\00949 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x73 +\00950 ./arch/monster/dragon/Chaos_Dra/chaos_dragon.x74 +\00951 ./arch/spell/MoodChange/charm_aura.111 +\00952 ./arch/spell/MoodChange/charm_aura.112 +\00953 ./arch/spell/MoodChange/charm_aura.113 +\00954 ./arch/system/mood_floors/charm_floor.111 +\00955 ./arch/monster/humanoid/Human/charwoman.131 +\00956 ./arch/monster/humanoid/Human/charwoman.132 +\00957 ./arch/monster/humanoid/Human/charwoman.171 +\00958 ./arch/monster/humanoid/Human/charwoman.172 +\00959 ./arch/system/mood_floors/check_floor.111 +\00960 ./arch/connect/check_inv.111 +\00961 ./arch/readable/checkbook.111 +\00962 ./arch/monster/angel/cherub.111 +\00963 ./arch/construct/house/chess_club.111 +\00964 ./arch/misc/Container/chest_1.111 +\00965 ./arch/misc/Container/chest_green_1.111 +\00966 ./arch/misc/Container/chest_jade_1.111 +\00967 ./arch/misc/Container/chest_valriel_1.111 +\00968 ./arch/misc/Container/chest_valriel_1.112 +\00969 ./arch/misc/Container/chest_valriel_1.113 +\00970 ./arch/misc/Container/chest_valriel_1.114 +\00971 ./arch/misc/Container/chest_white_1.111 +\00972 ./arch/monster/animal/farmyard/chicken.131 +\00973 ./arch/monster/animal/farmyard/chicken.132 +\00974 ./arch/monster/animal/farmyard/chicken.171 +\00975 ./arch/monster/animal/farmyard/chicken.172 +\00976 ./arch/monster/humanoid/Human/child.111 +\00977 ./arch/monster/humanoid/Human/child2.111 +\00978 ./arch/monster/dragon/Chinese_Dra/chinese_dr.x31 +\00979 ./arch/monster/dragon/Chinese_Dra/chinese_dr.x32 +\00980 ./arch/monster/dragon/Chinese_Dra/chinese_dr.x33 +\00981 ./arch/monster/dragon/Chinese_Dra/chinese_dr.x71 +\00982 ./arch/monster/dragon/Chinese_Dra/chinese_dr.x72 +\00983 ./arch/monster/dragon/Chinese_Dra/chinese_dr.x73 +\00984 ./arch/monster/dragon/Chinese_Dra/chinese_dr_spellcasting.x31 +\00985 ./arch/monster/dragon/Chinese_Dra/chinese_dr_spellcasting.x32 +\00986 ./arch/monster/dragon/Chinese_Dra/chinese_dr_spellcasting.x71 +\00987 ./arch/monster/dragon/Chinese_Dra/chinese_dr_spellcasting.x72 +\00988 ./arch/food/chocolate.111 +\00989 ./arch/exit/chole_1.111 +\00990 ./arch/exit/chole_2.111 +\00991 ./arch/construct/town/church.x11 +\00992 ./arch/construct/town/church_fant.x11 +\00993 ./arch/inorganic/cinna.111 +\00994 ./arch/construct/tower/city-tower.x11 +\00995 ./arch/construct/tower/city-tower_west.x11 +\00996 ./arch/construct/tower/city_tower_east.x11 +\00997 ./arch/construct/tower/city_tower_fant.x11 +\00998 ./arch/construct/tower/city_tower_northwest.x11 +\00999 ./arch/wall/cwall/cityport_0.111 +\01000 ./arch/wall/cwall/cityport_1.111 +\01001 ./arch/misc/claypipe.111 +\01002 ./arch/player/class/Religious/cleric.111 +\01003 ./arch/player/class/Religious/cleric.112 +\01004 ./arch/player/class/Religious/cleric.131 +\01005 ./arch/player/class/Religious/cleric.132 +\01006 ./arch/player/class/Religious/cleric.151 +\01007 ./arch/player/class/Religious/cleric.152 +\01008 ./arch/player/class/Religious/cleric.171 +\01009 ./arch/player/class/Religious/cleric.172 +\01010 ./arch/armour/cloak/cloak.111 +\01011 ./arch/armour/cloak/cloak_black.111 +\01012 ./arch/armour/cloak/cloak_lblue.111 +\01013 ./arch/armour/cloak/cloak_lgrey.111 +\01014 ./arch/armour/cloak/cloak_purple.111 +\01015 ./arch/armour/cloak/cloak_red.111 +\01016 ./arch/armour/cloak/cloak_trans.112 +\01017 ./arch/armour/cloak/cloak_white.111 +\01018 ./arch/indoor/clock.111 +\01019 ./arch/indoor/clock.112 +\01020 ./arch/indoor/clock_ag.111 +\01021 ./arch/indoor/clock_ag.112 +\01022 ./arch/indoor/clock_cw.111 +\01023 ./arch/indoor/clock_cw.112 +\01024 ./arch/indoor/clock_grand.111 +\01025 ./arch/indoor/clock_grand.112 +\01026 ./arch/misc/Container/close_attache.111 +\01027 ./arch/misc/Container/close_bag.111 +\01028 ./arch/misc/Container/close_dbox.111 +\01029 ./arch/misc/Container/close_desk.111 +\01030 ./arch/misc/Container/close_desk_cw.111 +\01031 ./arch/misc/Container/close_dresser.111 +\01032 ./arch/misc/Container/close_dresser2.111 +\01033 ./arch/misc/Container/close_dresser2_cw.111 +\01034 ./arch/misc/Container/close_dresser_cw.111 +\01035 ./arch/misc/Container/close_keys.111 +\01036 ./arch/misc/Container/close_pouc.111 +\01037 ./arch/misc/Container/close_present_box_1.111 +\01038 ./arch/misc/Container/close_present_box_2.111 +\01039 ./arch/misc/Container/close_present_box_3.111 +\01040 ./arch/misc/Container/close_present_box_4.111 +\01041 ./arch/misc/Container/close_present_box_5.111 +\01042 ./arch/misc/Container/close_present_box_6.111 +\01043 ./arch/misc/Container/close_quiv.111 +\01044 ./arch/misc/Container/close_rsack.111 +\01045 ./arch/misc/Container/close_sack.111 +\01046 ./arch/misc/Container/close_sarcophagus.111 +\01047 ./arch/misc/Container/close_schest.111 +\01048 ./arch/misc/Container/close_wizdesk.111 +\01049 ./arch/misc/Container/closechest.111 +\01050 ./arch/misc/Container/closemail.111 +\01051 ./arch/food/clover.111 +\01052 ./arch/monster/humanoid/Human/clown.111 +\01053 ./arch/weapon/club/club.111 +\01054 ./arch/ground/cmarsh.111 +\01055 ./arch/floor/cobblesto1.111 +\01056 ./arch/floor/cobblesto2.111 +\01057 ./arch/floor/cobblesto3.111 +\01058 ./arch/monster/animal/cobra.x11 +\01059 ./arch/monster/animal/cobra.x12 +\01060 ./arch/monster/animal/cobra.x13 +\01061 ./arch/food/coffee.111 +\01062 ./arch/food/coffee_empty.111 +\01063 ./arch/misc/coffin.111 +\01064 ./arch/monster/dragon/Hatchlings/cold_drag.131 +\01065 ./arch/monster/dragon/Hatchlings/cold_drag.132 +\01066 ./arch/monster/dragon/Hatchlings/cold_drag.171 +\01067 ./arch/monster/dragon/Hatchlings/cold_drag.172 +\01068 ./arch/planes/fire/coldmagma.111 +\01069 ./arch/planes/fire/coldmagma.112 +\01070 ./arch/talisman/collar.111 +\01071 ./arch/talisman/collar.112 +\01072 ./arch/talisman/collar.113 +\01073 ./arch/construct/town/collesium.x11 +\01074 ./arch/weapon/bow/compositebow.111 +\01075 ./arch/spell/Cone/confusion.111 +\01076 ./arch/spell/Cone/confusion.112 +\01077 ./arch/spell/Cone/confusion.113 +\01078 ./arch/spell/Cone/confusion.114 +\01079 ./arch/monster/humanoid/Class/conjurer.111 +\01080 ./arch/monster/humanoid/Class/conjurer.112 +\01081 ./arch/monster/humanoid/Class/conjurer.113 +\01082 ./arch/shop/conv.111 +\01083 ./arch/jewel/copperbar.111 +\01084 ./arch/flesh/human/corpse.111 +\01085 ./arch/flesh/human/corpse1.111 +\01086 ./arch/spell/Cone/counterspell.111 +\01087 ./arch/monster/humanoid/Human/courier.111 +\01088 ./arch/construct/town/courthouse.x11 +\01089 ./arch/misc/cplate.111 +\01090 ./arch/ground/Stone/crater.111 +\01091 ./arch/monster/misc/crawl/crawling_chaos.111 +\01092 ./arch/monster/misc/crawl/crawling_chaos.112 +\01093 ./arch/monster/misc/crawl/crawling_chaos.113 +\01094 ./arch/shop/crea_serp_c.111 +\01095 ./arch/system/creator.111 +\01096 ./arch/monster/humanoid/Human/crone.111 +\01097 ./arch/weapon/bow/crossbow.111 +\01098 ./arch/readable/crossroad.111 +\01099 ./arch/armour/helmet/crown.111 +\01100 ./arch/armour/helmet/crown2.111 +\01101 ./arch/armour/helmet/crown_dark.111 +\01102 ./arch/armour/helmet/crown_gray.111 +\01103 ./arch/armour/helmet/crown_r.111 +\01104 ./arch/armour/helmet/crown_white.111 +\01105 ./arch/misc/crystalball.111 +\01106 ./arch/weapon/club/cudgel.111 +\01107 ./arch/wall/cwall/cwall_0.111 +\01108 ./arch/wall/cwall/cwall_1.111 +\01109 ./arch/wall/cwall/cwall_2.111 +\01110 ./arch/wall/cwall/cwall_3.111 +\01111 ./arch/wall/cwall/cwall_4.111 +\01112 ./arch/wall/cwall/cwall_5.111 +\01113 ./arch/wall/cwall/cwall_6.111 +\01114 ./arch/wall/cwall/cwall_7.111 +\01115 ./arch/wall/cwall/cwall_8.111 +\01116 ./arch/wall/cwall/cwall_9.111 +\01117 ./arch/wall/cwall/cwall_A.111 +\01118 ./arch/wall/cwall/cwall_B.111 +\01119 ./arch/wall/cwall/cwall_C.111 +\01120 ./arch/wall/cwall/cwall_D.111 +\01121 ./arch/wall/cwall/cwall_E.111 +\01122 ./arch/wall/cwall/cwall_F.111 +\01123 ./arch/wall/cwall/cwall_beigemarble.111 +\01124 ./arch/wall/cwall/cwall_bluemarblemedium.111 +\01125 ./arch/wall/cwall/cwall_cyanmarble.111 +\01126 ./arch/wall/cwall/cwall_cyanmarbledark.111 +\01127 ./arch/wall/cwall/cwall_graymarble.111 +\01128 ./arch/wall/cwall/cwall_greenmarble.111 +\01129 ./arch/wall/cwall/cwall_greenmarblemedium.111 +\01130 ./arch/wall/cwall/cwall_magentamarble.111 +\01131 ./arch/wall/cwall/cwall_marble.111 +\01132 ./arch/wall/cwall/cwall_mural_1.111 +\01133 ./arch/wall/cwall/cwall_mural_1.112 +\01134 ./arch/wall/cwall/cwall_mural_1.113 +\01135 ./arch/wall/cwall/cwall_mural_1.114 +\01136 ./arch/wall/cwall/cwall_mural_end_1.111 +\01137 ./arch/wall/cwall/cwall_mural_end_1.112 +\01138 ./arch/wall/cwall/cwall_pinkmarble.111 +\01139 ./arch/wall/cwall/cwall_w_0.111 +\01140 ./arch/wall/cwall/cwall_w_0.112 +\01141 ./arch/wall/cwall/cwall_w_0.113 +\01142 ./arch/wall/cwall/cwall_w_0.114 +\01143 ./arch/wall/cwall/cwall_w_0.115 +\01144 ./arch/wall/cwall/cwall_w_0.116 +\01145 ./arch/wall/cwall/cwall_w_0.117 +\01146 ./arch/wall/cwall/cwall_w_0.118 +\01147 ./arch/wall/cwall/cwall_w_0.119 +\01148 ./arch/wall/cwall/cwall_w_0.11A +\01149 ./arch/wall/cwall/cwall_w_1.111 +\01150 ./arch/wall/cwall/cwall_w_1.112 +\01151 ./arch/wall/cwall/cwall_w_1.113 +\01152 ./arch/wall/cwall/cwall_w_1.114 +\01153 ./arch/wall/cwall/cwall_w_1.115 +\01154 ./arch/wall/cwall/cwall_w_1.116 +\01155 ./arch/wall/cwall/cwall_w_1.117 +\01156 ./arch/wall/cwall/cwall_w_1.118 +\01157 ./arch/wall/cwall/cwall_w_1.119 +\01158 ./arch/connect/cwallsec.111 +\01159 ./arch/connect/cwallsec.112 +\01160 ./arch/connect/cwallsec.113 +\01161 ./arch/connect/cwallsec.114 +\01162 ./arch/connect/cwallsec.115 +\01163 ./arch/connect/cwallsec.116 +\01164 ./arch/connect/cwallsec.117 +\01165 ./arch/connect/cwallsec.118 +\01166 ./arch/connect/cwallsec_mural_1.111 +\01167 ./arch/connect/cwallsec_mural_1.112 +\01168 ./arch/connect/cwallsec_mural_1.113 +\01169 ./arch/connect/cwallsec_mural_1.114 +\01170 ./arch/connect/cwallsec_mural_1.115 +\01171 ./arch/connect/cwallsec_mural_1.116 +\01172 ./arch/connect/cwallsec_mural_1.117 +\01173 ./arch/connect/cwallsec_mural_1.118 +\01174 ./arch/floor/inlayed/cyan-beige-c-marble.111 +\01175 ./arch/floor/inlayed/cyan-beige-c-marble.112 +\01176 ./arch/floor/inlayed/cyan-beige-c-marble.113 +\01177 ./arch/floor/inlayed/cyan-beige-c-marble.114 +\01178 ./arch/ground/Wood/cyanbrush.111 +\01179 ./arch/ground/cyangrass.111 +\01180 ./arch/ground/smooth/cyangrass_S.111 +\01181 ./arch/ground/cyangrasspond.111 +\01182 ./arch/floor/cyanmarble.111 +\01183 ./arch/monster/giant/cyclops/cyclops.x31 +\01184 ./arch/monster/giant/cyclops/cyclops.x32 +\01185 ./arch/monster/giant/cyclops/cyclops.x71 +\01186 ./arch/monster/giant/cyclops/cyclops.x72 +\01187 ./arch/misc/d_statue.111 +\01188 ./arch/weapon/sword/dagger.111 +\01189 ./arch/weapon/artifact/Fdagger/dagger_f.111 +\01190 ./arch/weapon/artifact/Fdagger/dagger_f.112 +\01191 ./arch/weapon/artifact/Fdagger/dagger_f.113 +\01192 ./arch/weapon/artifact/Fdagger/dagger_f.114 +\01193 ./arch/weapon/sword/dagger_r.111 +\01194 ./arch/monster/humanoid/Arabic/dancing_girl.111 +\01195 ./arch/monster/humanoid/Arabic/dancing_girl.112 +\01196 ./arch/monster/humanoid/Arabic/dancing_girl.113 +\01197 ./arch/monster/misc/dancingsword.111 +\01198 ./arch/monster/misc/dancingsword.112 +\01199 ./arch/monster/misc/dancingsword.113 +\01200 ./arch/system/dark1.111 +\01201 ./arch/system/dark2.111 +\01202 ./arch/system/dark3.111 +\01203 ./arch/monster/humanoid/Elf/dark_elf.111 +\01204 ./arch/monster/humanoid/Elf/dark_elf.112 +\01205 ./arch/monster/humanoid/Elf/dark_elf.131 +\01206 ./arch/monster/humanoid/Elf/dark_elf.132 +\01207 ./arch/monster/humanoid/Elf/dark_elf.171 +\01208 ./arch/monster/humanoid/Elf/dark_elf.172 +\01209 ./arch/monster/humanoid/Elf/dark_elf2.131 +\01210 ./arch/monster/humanoid/Elf/dark_elf2.132 +\01211 ./arch/monster/humanoid/Elf/dark_elf2.171 +\01212 ./arch/monster/humanoid/Elf/dark_elf2.172 +\01213 ./arch/construct/Palace/dark_palace.x11 +\01214 ./arch/weapon/artifact/Darkblade/darkblade.111 +\01215 ./arch/weapon/artifact/Darkblade/darkblade.112 +\01216 ./arch/weapon/artifact/Darkblade/darkblade.113 +\01217 ./arch/weapon/artifact/Darkblade/darkblade.114 +\01218 ./arch/weapon/artifact/Darkblade/darkblade.115 +\01219 ./arch/weapon/artifact/Darkblade/darkblade.116 +\01220 ./arch/weapon/artifact/Darkblade/darkblade.117 +\01221 ./arch/ground/Wood/darkforest.111 +\01222 ./arch/ground/smooth/darkforest_S.111 +\01223 ./arch/construct/hold/darkhold.x11 +\01224 ./arch/construct/hold/darkhold_s.111 +\01225 ./arch/monster/undead/dave.111 +\01226 ./arch/monster/undead/dave.112 +\01227 ./arch/monster/undead/dave.113 +\01228 ./arch/wall/gwall/dbridge1.111 +\01229 ./arch/wall/gwall/dbridge2.111 +\01230 ./arch/floor/dcross-red.111 +\01231 ./arch/floor/dcross-white.111 +\01232 ./arch/flesh/misc/dead_neko.111 +\01233 ./arch/weapon/artifact/deathbring.111 +\01234 ./arch/monster/undead/deathshead.111 +\01235 ./arch/monster/undead/deathshead.112 +\01236 ./arch/monster/undead/deathshead.113 +\01237 ./arch/monster/undead/deathshead.114 +\01238 ./arch/monster/misc/deathtree.111 +\01239 ./arch/monster/misc/deathtree.112 +\01240 ./arch/monster/misc/deathtree.113 +\01241 ./arch/monster/misc/deathtree.114 +\01242 ./arch/monster/misc/deathtree.115 +\01243 ./arch/ground/deep_sea.111 +\01244 ./arch/ground/deep_sea.112 +\01245 ./arch/ground/deep_sea.113 +\01246 ./arch/ground/deep_sea.114 +\01247 ./arch/ground/smooth/deep_sea_S.111 +\01248 ./arch/ground/smooth/deep_sea_S.112 +\01249 ./arch/ground/smooth/deep_sea_S.113 +\01250 ./arch/ground/smooth/deep_sea_S.114 +\01251 ./arch/ground/deep_swamp.111 +\01252 ./arch/ground/deep_swamp.112 +\01253 ./arch/ground/smooth/deep_swamp_S.111 +\01254 ./arch/ground/smooth/deep_swamp_S.112 +\01255 ./arch/ground/smooth/default_smoothed.001 +\01256 ./arch/ground/smooth/default_smoothed.010 +\01257 ./arch/ground/smooth/default_smoothed.011 +\01258 ./arch/ground/smooth/default_smoothed.100 +\01259 ./arch/ground/smooth/default_smoothed.101 +\01260 ./arch/ground/smooth/default_smoothed.110 +\01261 ./arch/ground/smooth/default_smoothed.111 +\01262 ./arch/weapon/artifact/defender.111 +\01263 ./arch/monster/undead/demilich.111 +\01264 ./arch/monster/undead/demilich.112 +\01265 ./arch/monster/undead/demilich.113 +\01266 ./arch/flesh/demon/demon_head.111 +\01267 ./arch/monster/demon/Demon_Lord/demon_lord.x11 +\01268 ./arch/monster/demon/Demon_Lord/demon_lord.x12 +\01269 ./arch/weapon/artifact/Demonbane/demonbane.111 +\01270 ./arch/weapon/artifact/Demonbane/demonbane.112 +\01271 ./arch/weapon/artifact/Demonbane/demonbane.113 +\01272 ./arch/weapon/artifact/Demonbane/demonbane.114 +\01273 ./arch/weapon/artifact/Demonbane/demonbane.115 +\01274 ./arch/weapon/artifact/Demonbane/demonbane.116 +\01275 ./arch/weapon/artifact/Demonbane/demonbane.117 +\01276 ./arch/weapon/artifact/Demonbane/demonbane.118 +\01277 ./arch/weapon/artifact/Demonbane/demonbane.119 +\01278 ./arch/misc/Container/depositbox.111 +\01279 ./arch/ground/desert.111 +\01280 ./arch/ground/smooth/desert_S.111 +\01281 ./arch/misc/Container/desk.111 +\01282 ./arch/misc/Container/desk_cw.111 +\01283 ./arch/spell/Misc/destruction.111 +\01284 ./arch/spell/Misc/destruction.112 +\01285 ./arch/spell/Misc/destruction.113 +\01286 ./arch/spell/Misc/destruction.114 +\01287 ./arch/spell/Detect/det_magic.111 +\01288 ./arch/spell/Detect/det_magic.112 +\01289 ./arch/spell/Detect/det_magic.113 +\01290 ./arch/monster/demon/devil.111 +\01291 ./arch/monster/demon/devil.112 +\01292 ./arch/monster/demon/devil_gen.111 +\01293 ./arch/weapon/axe/dhaxe_1.111 +\01294 ./arch/weapon/axe/dhaxe_2.111 +\01295 ./arch/misc/dice.111 +\01296 ./arch/misc/dice.112 +\01297 ./arch/misc/dice.113 +\01298 ./arch/readable/diploma.111 +\01299 ./arch/connect/Director/director.111 +\01300 ./arch/connect/Director/director.112 +\01301 ./arch/connect/Director/director.113 +\01302 ./arch/connect/Director/director.121 +\01303 ./arch/connect/Director/director.122 +\01304 ./arch/connect/Director/director.123 +\01305 ./arch/connect/Director/director.124 +\01306 ./arch/connect/Director/director.125 +\01307 ./arch/connect/Director/director.131 +\01308 ./arch/connect/Director/director.132 +\01309 ./arch/connect/Director/director.133 +\01310 ./arch/connect/Director/director.141 +\01311 ./arch/connect/Director/director.142 +\01312 ./arch/connect/Director/director.143 +\01313 ./arch/connect/Director/director.144 +\01314 ./arch/connect/Director/director.145 +\01315 ./arch/connect/Director/director.151 +\01316 ./arch/connect/Director/director.152 +\01317 ./arch/connect/Director/director.153 +\01318 ./arch/connect/Director/director.161 +\01319 ./arch/connect/Director/director.162 +\01320 ./arch/connect/Director/director.163 +\01321 ./arch/connect/Director/director.164 +\01322 ./arch/connect/Director/director.165 +\01323 ./arch/connect/Director/director.171 +\01324 ./arch/connect/Director/director.172 +\01325 ./arch/connect/Director/director.173 +\01326 ./arch/connect/Director/director.181 +\01327 ./arch/connect/Director/director.182 +\01328 ./arch/connect/Director/director.183 +\01329 ./arch/connect/Director/director.184 +\01330 ./arch/connect/Director/director.185 +\01331 ./arch/inorganic/dirt.111 +\01332 ./arch/floor/dirtfloor.111 +\01333 ./arch/wall/dirtroad/dirtroad_0.111 +\01334 ./arch/wall/dirtroad/dirtroad_1.111 +\01335 ./arch/wall/dirtroad/dirtroad_2.111 +\01336 ./arch/wall/dirtroad/dirtroad_3.111 +\01337 ./arch/wall/dirtroad/dirtroad_4.111 +\01338 ./arch/wall/dirtroad/dirtroad_5.111 +\01339 ./arch/wall/dirtroad/dirtroad_6.111 +\01340 ./arch/wall/dirtroad/dirtroad_7.111 +\01341 ./arch/wall/dirtroad/dirtroad_8.111 +\01342 ./arch/wall/dirtroad/dirtroad_9.111 +\01343 ./arch/wall/dirtroad/dirtroad_A.111 +\01344 ./arch/wall/dirtroad/dirtroad_B.111 +\01345 ./arch/wall/dirtroad/dirtroad_C.111 +\01346 ./arch/wall/dirtroad/dirtroad_D.111 +\01347 ./arch/wall/dirtroad/dirtroad_E.111 +\01348 ./arch/wall/dirtroad/dirtroad_F.111 +\01349 ./arch/monster/giant/djinn/djinn.x31 +\01350 ./arch/monster/giant/djinn/djinn.x32 +\01351 ./arch/monster/giant/djinn/djinn.x71 +\01352 ./arch/monster/giant/djinn/djinn.x72 +\01353 ./arch/monster/giant/djinn/djinn_magenta.x11 +\01354 ./arch/monster/giant/djinn/djinn_magenta.x12 +\01355 ./arch/monster/giant/djinn/djinn_magenta.x21 +\01356 ./arch/monster/giant/djinn/djinn_magenta.x22 +\01357 ./arch/monster/giant/djinn/djinn_magenta_big.x11 +\01358 ./arch/monster/giant/djinn/djinn_magenta_big.x12 +\01359 ./arch/monster/giant/djinn/djinn_magenta_big.x21 +\01360 ./arch/monster/giant/djinn/djinn_magenta_big.x22 +\01361 ./arch/wall/slevel/dlevel_0.111 +\01362 ./arch/wall/slevel/dlevel_1.111 +\01363 ./arch/wall/slevel/dlevel_2.111 +\01364 ./arch/wall/slevel/dlevel_3.111 +\01365 ./arch/wall/slevel/dlevel_4.111 +\01366 ./arch/wall/slevel/dlevel_5.111 +\01367 ./arch/wall/slevel/dlevel_6.111 +\01368 ./arch/wall/slevel/dlevel_7.111 +\01369 ./arch/wall/slevel/dlevel_8.111 +\01370 ./arch/wall/slevel/dlevel_9.111 +\01371 ./arch/wall/slevel/dlevel_A.111 +\01372 ./arch/wall/slevel/dlevel_B.111 +\01373 ./arch/wall/slevel/dlevel_C.111 +\01374 ./arch/wall/slevel/dlevel_D.111 +\01375 ./arch/wall/slevel/dlevel_E.111 +\01376 ./arch/monster/animal/Dog/dog.131 +\01377 ./arch/monster/animal/Dog/dog.132 +\01378 ./arch/monster/animal/Dog/dog.133 +\01379 ./arch/monster/animal/Dog/dog.171 +\01380 ./arch/monster/animal/Dog/dog.172 +\01381 ./arch/monster/animal/Dog/dog.173 +\01382 ./arch/misc/doll.111 +\01383 ./arch/door/Door/door_0.111 +\01384 ./arch/door/Door/door_1.111 +\01385 ./arch/door/Door/door_2.111 +\01386 ./arch/door/Door/door_3.111 +\01387 ./arch/door/Door/door_4.111 +\01388 ./arch/door/Door/door_5.111 +\01389 ./arch/door/Door/door_6.111 +\01390 ./arch/door/Door/door_7.111 +\01391 ./arch/door/Door/door_8.111 +\01392 ./arch/door/Door/door_9.111 +\01393 ./arch/door/Door/door_... [truncated message content] |
From: <aki...@us...> - 2008-10-30 20:17:43
|
Revision: 5610 http://gridarta.svn.sourceforge.net/gridarta/?rev=5610&view=rev Author: akirschbaum Date: 2008-10-30 20:17:34 +0000 (Thu, 30 Oct 2008) Log Message: ----------- Add anim tree file to CrossfireEditor. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java Added Paths: ----------- trunk/crossfire/resource/conf/animtree Added: trunk/crossfire/resource/conf/animtree =================================================================== --- trunk/crossfire/resource/conf/animtree (rev 0) +++ trunk/crossfire/resource/conf/animtree 2008-10-30 20:17:34 UTC (rev 5610) @@ -0,0 +1,1009 @@ +/monster/angel/ArchAngel +/monster/angel/ArchAngel_2 +/monster/angel/ArchAngel_3 +/monster/angel/ArchAngel_4 +/monster/angel/ArchAngel_5 +/monster/angel/ArchAngel_6 +/monster/demon/Balrog +/monster/demon/Balrog_10 +/monster/demon/Balrog_11 +/monster/demon/Balrog_12 +/monster/demon/Balrog_13 +/monster/demon/Balrog_14 +/monster/demon/Balrog_15 +/monster/demon/Balrog_16 +/monster/demon/Balrog_2 +/monster/demon/Balrog_3 +/monster/demon/Balrog_4 +/monster/demon/Balrog_5 +/monster/demon/Balrog_6 +/monster/demon/Balrog_7 +/monster/demon/Balrog_8 +/monster/demon/Balrog_9 +/weapon/artifact/ChaosSword/CSword +/monster/dragon/Cwyvern +/monster/dragon/Cwyvern_2 +/monster/giant/DreadKnight/DK +/monster/giant/DreadKnight/DK2 +/monster/giant/DreadKnight/DK3 +/monster/giant/DreadKnight/DK4 +/monster/giant/DreadKnight/DK5 +/monster/giant/DreadKnight/DK6 +/armour/shield/DShield +/armour/shield/DShieldm +/armour/shield/DShieldms +/armour/shield/DShields +/monster/giant/DreadKnight/EDK +/monster/giant/DreadKnight/EDK2 +/monster/giant/DreadKnight/EDK3 +/monster/giant/DreadKnight/EDK4 +/monster/giant/DreadKnight/EDK5 +/monster/giant/DreadKnight/EDK6 +/gods/elemental/Ixalovh +/ground/nimground/Nimground3_purple +/armour/mail/Pdragon_mail +/monster/acid/acid_pool +/monster/acid/acid_sphere +/misc/acid_spit +/monster/elemental/air_elemental +/monster/elemental/air_witch +/player/class/Wizardry/alchemist_class +/shop/alchemy_diamond_converter +/shop/alchemy_pearl_converter +/shop/alchemy_ruby_converter +/connect/altar +/gods/altars/altar_ruggilli +/gods/altars/altar_sorig +/connect/altar_trigger +/jewel/amethyst +/monster/angel/angel +/monster/insect/ant +/monster/insect/ant/ant_larvae +/monster/animal/ape +/monster/chaos/archon +/monster/humanoid/Human/armless_cook +/monster/troll/armour_troll2 +/weapon/bow/arrow +/spell/Bullet/asteroid +/monster/dragon/baby_dragon +/misc/Bagpipe/bagpipe +/spell/MovingBall/ball_lightning +/spell/Cone/banishment +/monster/undead/banshee +/monster/humanoid/Human/barbarian +/player/class/Warrior/barbarian_class +/construct/barrack/barrack_long +/construct/barrack/barrack_long_2 +/construct/barrack/barrack_up +/construct/barrack/barrack_up_2 +/monster/misc/Baslic/baslic +/monster/misc/Baslic/baslic_2 +/monster/misc/Baslic/baslic_3 +/monster/misc/Baslic/baslic_4 +/monster/misc/Baslic/baslic_5 +/monster/misc/Baslic/baslic_6 +/monster/animal/bat +/monster/animal/Bear/bear +/monster/animal/Bear/bear_2 +/monster/insect/bee +/monster/insect/beehive +/monster/animal/Behemoth/behemoth +/monster/animal/Behemoth/behemoth_2 +/monster/animal/Behemoth/behemoth_3 +/monster/animal/Behemoth/behemoth_4 +/monster/beholder/beholder +/monster/beholder/beholder_leader_arc +/monster/giant/Belzebub/belzebub +/monster/giant/Belzebub/belzebub_2 +/monster/giant/Belzebub/belzebub_3 +/monster/giant/Belzebub/belzebub_4 +/monster/giant/Belzebub/belzebub_5 +/monster/giant/Belzebub/belzebub_6 +/monster/dragon/Chaos_Dra/big_chaos_dragon +/monster/dragon/Chaos_Dra/big_chaos_dragon.2 +/monster/dragon/Chaos_Dra/big_chaos_dragon.3 +/monster/dragon/Chaos_Dra/big_chaos_dragon.4 +/monster/dragon/Chaos_Dra/big_chaos_dragon.5 +/monster/dragon/Chaos_Dra/big_chaos_dragon.6 +/monster/demon/Big_Demon/big_demon +/monster/dragon/Dragon/big_dragon +/monster/dragon/Dragon/big_dragon_2 +/monster/dragon/Dragon/big_dragon_3 +/monster/dragon/Dragon/big_dragon_4 +/monster/dragon/Dragon/big_dragon_5 +/monster/dragon/Dragon/big_dragon_6 +/monster/dragon/Dragon/big_dragon_ancient +/monster/dragon/Dragon/big_dragon_ancient2 +/monster/dragon/Dragon/big_dragon_ancient3 +/monster/dragon/Dragon/big_dragon_ancient4 +/monster/dragon/Dragon/big_dragon_ancient5 +/monster/dragon/Dragon/big_dragon_ancient6 +/monster/dragon/Dragon/big_dragon_spellcasting +/monster/dragon/WDragon/big_dragon_worthless +/monster/dragon/Electric/big_elec +/monster/dragon/Electric/big_elec_2 +/monster/dragon/Electric/big_elec_3 +/monster/dragon/Electric/big_elec_4 +/monster/dragon/Electric/big_elec_5 +/monster/dragon/Electric/big_elec_6 +/monster/dragon/Electric/big_elec_spellcasting +/monster/giant/Big_Wiz/big_wiz +/monster/giant/Big_Wiz/big_wiz2 +/monster/giant/Big_Wiz/big_wiz3 +/monster/giant/Big_Wiz/big_wiz4 +/monster/giant/Big_Wiz/big_wiz5 +/monster/giant/Big_Wiz/big_wiz6 +/monster/giant/Big_Wiz/big_wiz7 +/monster/giant/Big_Wiz/big_wiz8 +/monster/giant/Big_Wiz/big_wiz9 +/monster/dragon/WDragon/big_worthless_dragon_2 +/monster/dragon/WDragon/big_worthless_dragon_3 +/monster/dragon/WDragon/big_worthless_dragon_4 +/monster/dragon/WDragon/big_worthless_dragon_5 +/monster/dragon/WDragon/big_worthless_dragon_6 +/monster/animal/bird +/monster/humanoid/Dragon/black_dragon1 +/monster/humanoid/Dragon/black_dragon2 +/monster/acid/black_pudding +/monster/acid/black_pudding_grow +/monster/acid/black_pudding_split +/monster/misc/blob +/wall/bwall/block_door_closed +/wall/bwall/block_door_open +/ground/blood_sea +/monster/humanoid/Dragon/blue_dragon1 +/monster/humanoid/Dragon/blue_dragon2 +/weapon/bow/bolt +/spell/Bomb/bomb +/monster/dragon/bone_drake/bone_drake +/monster/dragon/bone_drake/bone_drake_2 +/monster/dragon/bone_drake/bone_drake_3 +/monster/dragon/bone_drake/bone_drake_4 +/monster/demon/bone_head +/misc/brazier +/weapon/axe/brdaxe1 +/monster/insect/ant/breeder_ant +/monster/insect/ant/breeder_ant_2 +/monster/misc/broo +/spell/Bullet/bullet +/spell/Bullet/bullet_mania +/planes/fire/burning_fountain +/gods/items/burning_tail/burningtail +/planes/fire/burningwall/burningwall_0 +/planes/fire/burningwall/burningwall_1_1 +/planes/fire/burningwall/burningwall_1_2 +/planes/fire/burningwall/burningwall_1_3 +/planes/fire/burningwall/burningwall_1_4 +/planes/fire/burningwall/burningwall_2_1_1 +/planes/fire/burningwall/burningwall_2_1_2 +/planes/fire/burningwall/burningwall_2_2_1 +/planes/fire/burningwall/burningwall_2_2_2 +/planes/fire/burningwall/burningwall_2_2_3 +/planes/fire/burningwall/burningwall_2_2_4 +/planes/fire/burningwall/burningwall_3_1 +/planes/fire/burningwall/burningwall_3_2 +/planes/fire/burningwall/burningwall_3_3 +/planes/fire/burningwall/burningwall_3_4 +/planes/fire/burningwall/burningwall_4 +/spell/Burnout/burnout +/connect/button_handle +/connect/button_lever +/connect/button_plate +/connect/button_small +/connect/button_trigger +/monster/giant/byakie/byakie +/monster/giant/byakie/byakie_2 +/monster/giant/byakie/byakie_3 +/monster/giant/byakie/byakie_4 +/monster/misc/c_knight +/monster/humanoid/Human/c_man +/monster/misc/c_minor_priest +/monster/misc/c_priest +/monster/humanoid/Human/c_sage +/monster/humanoid/Human/c_woman +/misc/Camp/campfire +/misc/Camp/campfire_talking +/spell/Bolt/cancellation +/construct/castle/castle_a +/construct/castle/castle_a_northwest +/construct/castle/castle_a_western +/construct/castle/castle_b +/construct/castle/castle_b_northwest +/construct/castle/castle_b_western +/construct/castle/castle_c +/construct/castle/castle_c_northwest +/construct/castle/castle_c_western +/construct/castle/castle_d +/construct/castle/castle_d_northwest +/construct/castle/castle_d_western +/spell/Bullet/cause_wounds +/monster/insect/centipede +/monster/insect/centipede_r +/misc/chalice +/misc/chalice_bro +/misc/chalice_cop +/misc/chalice_iro +/misc/chalice_plat +/misc/chalice_sil +/misc/chalice_tin +/misc/chandelier_2 +/misc/chandelier_2_copper +/ground/chaos +/ground/chaos_ball +/spell/MoodChange/charm_aura +/monster/humanoid/Human/charwoman +/misc/Container/chest_valriel_2 +/monster/animal/farmyard/chicken +/monster/dragon/Chinese_Dra/chinese_dragon +/monster/dragon/Chinese_Dra/chinese_dragon_2 +/monster/dragon/Chinese_Dra/chinese_dragon_3 +/monster/dragon/Chinese_Dra/chinese_dragon_4 +/monster/humanoid/Human/cleric +/player/class/Religious/cleric_class +/indoor/clock +/indoor/clock_ag +/indoor/clock_cw +/indoor/clock_grand +/misc/Container/close_chest_valriel_2 +/monster/animal/cobra +/monster/animal/cobra_2 +/monster/dragon/Hatchlings/cold_dragon +/planes/fire/coldmagma +/talisman/collar +/spell/Cone/color_spray +/spell/Cone/confusion +/monster/humanoid/Class/conjurer +/monster/humanoid/Class/conjurer2 +/monster/misc/crawl/crawling_chaos +/connect/cwall_closed_1 +/connect/cwall_open_1 +/connect/cwallmural1_closed_1 +/connect/cwallmural1_open_1 +/monster/giant/cyclops/cyclops +/monster/giant/cyclops/cyclops_2 +/monster/giant/cyclops/cyclops_3 +/monster/giant/cyclops/cyclops_4 +/monster/giant/cyclops/cyclops_5 +/monster/giant/cyclops/cyclops_6 +/weapon/artifact/Fdagger/dagger_f +/monster/humanoid/Arabic/dancing_girl +/monster/misc/dancingsword +/monster/humanoid/Elf/dark_elf +/monster/humanoid/Elf/dark_elf2 +/weapon/artifact/Darkblade/darkblade +/spell/Misc/darkness +/monster/undead/dave +/monster/undead/deathshead +/monster/misc/deathtree +/ground/deep_sea +/ground/deep_swamp +/monster/undead/demilich +/monster/demon/Demon_Lord/demon_lord +/monster/demon/Demon_Lord/demon_lord_1 +/monster/demon/Demon_Lord/demon_lord_10 +/monster/demon/Demon_Lord/demon_lord_11 +/monster/demon/Demon_Lord/demon_lord_12 +/monster/demon/Demon_Lord/demon_lord_13 +/monster/demon/Demon_Lord/demon_lord_15 +/monster/demon/Demon_Lord/demon_lord_16 +/monster/demon/Demon_Lord/demon_lord_17 +/monster/demon/Demon_Lord/demon_lord_18 +/monster/demon/Demon_Lord/demon_lord_19 +/monster/demon/Demon_Lord/demon_lord_2 +/monster/demon/Demon_Lord/demon_lord_20 +/monster/demon/Demon_Lord/demon_lord_21 +/monster/demon/Demon_Lord/demon_lord_22 +/monster/demon/Demon_Lord/demon_lord_23 +/monster/demon/Demon_Lord/demon_lord_24 +/monster/demon/Demon_Lord/demon_lord_25 +/monster/demon/Demon_Lord/demon_lord_26 +/monster/demon/Demon_Lord/demon_lord_27 +/monster/demon/Demon_Lord/demon_lord_28 +/monster/demon/Demon_Lord/demon_lord_29 +/monster/demon/Demon_Lord/demon_lord_3 +/monster/demon/Demon_Lord/demon_lord_30 +/monster/demon/Demon_Lord/demon_lord_31 +/monster/demon/Demon_Lord/demon_lord_32 +/monster/demon/Demon_Lord/demon_lord_4 +/monster/demon/Demon_Lord/demon_lord_5 +/monster/demon/Demon_Lord/demon_lord_6 +/monster/demon/Demon_Lord/demon_lord_7 +/monster/demon/Demon_Lord/demon_lord_8 +/monster/demon/Demon_Lord/demon_lord_9 +/weapon/artifact/Demonbane/demonbane +/spell/Misc/destruction +/spell/Detect/detect_magic +/spell/Detect/detect_monster +/connect/detector +/monster/demon/devil +/misc/dice +/light/dim_torch +/monster/animal/Wolf/dire_wolf +/monster/animal/Wolf/dire_wolf_sire +/connect/Director/director_1 +/connect/Director/director_2 +/connect/Director/director_3 +/connect/Director/director_4 +/connect/Director/director_5 +/connect/Director/director_6 +/connect/Director/director_7 +/connect/Director/director_8 +/connect/Director/director_turn +/disease/disgusting_puddle +/spell/MovingBall/divine_shock +/monster/giant/djinn/djinn +/monster/giant/djinn/djinn_2 +/monster/giant/djinn/djinn_magenta +/monster/giant/djinn/djinn_magenta_2 +/monster/giant/djinn/djinn_magenta_big +/monster/giant/djinn/djinn_magenta_big_10 +/monster/giant/djinn/djinn_magenta_big_12 +/monster/giant/djinn/djinn_magenta_big_13 +/monster/giant/djinn/djinn_magenta_big_14 +/monster/giant/djinn/djinn_magenta_big_15 +/monster/giant/djinn/djinn_magenta_big_16 +/monster/giant/djinn/djinn_magenta_big_17 +/monster/giant/djinn/djinn_magenta_big_18 +/monster/giant/djinn/djinn_magenta_big_19 +/monster/giant/djinn/djinn_magenta_big_2 +/monster/giant/djinn/djinn_magenta_big_3 +/monster/giant/djinn/djinn_magenta_big_4 +/monster/giant/djinn/djinn_magenta_big_5 +/monster/giant/djinn/djinn_magenta_big_6 +/monster/giant/djinn/djinn_magenta_big_7 +/monster/giant/djinn/djinn_magenta_big_8 +/monster/giant/djinn/djinn_magenta_big_9 +/monster/animal/Dog/dog +/monster/dragon/dragon +/monster/dragon/dragon_2 +/transport/dragon_exit +/transport/dragon_exit_2 +/transport/dragon_exit_3 +/transport/dragon_exit_4 +/transport/dragon_exit_5 +/transport/dragon_exit_6 +/monster/dragon/Dragonman/dragonman +/monster/dragon/Dragonman/dragonman_2 +/monster/dragon/drake/drake +/monster/beholder/dread +/monster/beholder/dread_2 +/monster/beholder/dread_3 +/monster/beholder/dread_4 +/inorganic/dust_effect +/monster/humanoid/Dwarf/dwarf +/player/race/dwarf_player +/monster/humanoid/Dwarf/dwarf_priest +/monster/humanoid/Dwarf/dwarf_wiz +/monster/elemental/earth_elemental +/monster/elemental/earth_witch +/wall/bwall/earthwall +/system/editcursor +/monster/dragon/Hatchlings/elec_dragon +/monster/humanoid/Elf/elf +/monster/humanoid/Elf/elf_1 +/monster/humanoid/Elf/elf_guard +/monster/humanoid/Elf/elf_lass +/monster/humanoid/Elf/elf_man +/player/race/elf_player +/jewel/emerald +/spell/Misc/enchantment +/monster/misc/Ent/ent +/monster/misc/Ent/ent_2 +/monster/misc/Ent/ent_3 +/monster/misc/Ent/ent_4 +/ground/Winter/evil_ice +/monster/demon/evil_master1 +/monster/demon/evil_master2 +/monster/demon/evil_master3 +/monster/demon/evil_master4 +/player/class/Wizardry/evoker_class +/exit/exit +/spell/Bomb/explosion +/spell/Bullet/Shell/explosion2 +/monster/dragon/faerie_dragon +/monster/humanoid/Human/farmer +/spell/Cone/fear +/player/race/fenx_player +/monster/demon/fiend +/monster/humanoid/Class/fighter +/monster/dragon/Hatchlings/fire_dragon +/monster/elemental/fire_elemental +/spell/fire_permanent +/spell/Bullet/fire_trail +/monster/elemental/fire_witch +/spell/Bullet/Fire/fireball +/spell/Bolt/firebolt +/monster/elemental/fireborn +/player/race/fireborn_player +/weapon/artifact/firebrand +/spell/Cone/firebreath +/spell/Bullet/Fire/firebullet +/misc/fireplace +/misc/firepot +/weapon/artifact/Firestar/firestar +/inorganic/fix_mercury +/planes/fire/flaming_tower +/planes/fire/flaming_tower_2 +/monster/insect/ant/fly_ant +/ground/fog +/ground/fog_wall +/exit/fogexit +/misc/Container/forge +/spell/Bolt/forked_lightning +/construct/fountain/fountain +/weapon/artifact/Fhammer/frost_hammer +/spell/Bolt/frostbolt +/monster/animal/fungus +/monster/animal/giant_worm/g_worm +/monster/animal/giant_worm/g_worm_2 +/monster/animal/giant_worm/g_worm_3 +/monster/animal/giant_worm/g_worm_4 +/monster/troll/Gaelotroll/gaelotroll +/monster/troll/Gaelotroll/gaelotroll_2 +/monster/troll/Gaelotroll/gaelotroll_3 +/monster/troll/Gaelotroll/gaelotroll_4 +/monster/troll/Gaelotroll/gaelotroll_5 +/monster/troll/Gaelotroll/gaelotroll_6 +/monster/humanoid/Gnome/gardengnome +/monster/misc/gargolye +/connect/Gates/gateTrg1 +/connect/Gates/gateTrg2 +/connect/Gates/gate_closed_1 +/connect/Gates/gate_closed_2 +/connect/Gates/gate_open_1 +/connect/Gates/gate_open_2 +/jewel/gem +/spell/Rune/generic_rune +/connect/Garden_gate/ggate_closed +/connect/Garden_gate/ggate_open +/monster/undead/ghast +/monster/undead/ghost +/monster/giant/giant +/monster/giant/giant_2 +/monster/animal/giant_bat +/monster/animal/Giant_rat/giantrat +/monster/animal/Giant_rat/giantrat_2 +/monster/animal/Giant_rat/giantrat_3 +/monster/animal/Giant_rat/giantrat_4 +/armour/girdle/girdle_con +/armour/girdle/girdle_dam +/armour/girdle/girdle_str +/armour/girdle/girdle_strcon +/gods/items/glovesofsun/glovesofsun +/ground/glue +/monster/goblin/gnoll +/monster/goblin/gnoll_chief_arc +/monster/goblin/gnoll_leader_arc +/monster/humanoid/Gnome/gnome +/monster/humanoid/Gnome/gnome2 +/player/race/gnome_player +/monster/goblin/goblin +/monster/goblin/goblin_chief_arc +/monster/goblin/goblin_leader_arc +/armour/gauntlets/god_finger +/spell/Smite/god_power +/floor/goldflagstone +/floor/goldfloor +/floor/goldfloor2 +/ground/goldgrass +/spell/Golem/golem +/monster/misc/Ngolem/golem_necro +/monster/misc/Ngolem/golem_necro_2 +/monster/misc/Ngolem/golem_necro_3 +/monster/misc/Ngolem/golem_necro_4 +/monster/misc/Ngolem/golem_necro_5 +/monster/misc/Ngolem/golem_necro_6 +/monster/animal/farmyard/goose +/monster/demon/gr_hellhound +/weapon/artifact/Gram/gram +/connect/Gates/grate_closed_1 +/connect/Gates/grate_closed_2 +/connect/Gates/grate_open_1 +/connect/Gates/grate_open_2 +/monster/humanoid/Dwarf/greater_dwarven_guard +/monster/humanoid/Dragon/green_dragon1 +/monster/humanoid/Dragon/green_dragon2 +/monster/acid/green_slime +/monster/undead/grimreaper +/monster/animal/gryphon/gryphon +/monster/animal/gryphon/gryphon2 +/monster/animal/gryphon/gryphon3 +/monster/animal/gryphon/gryphon4 +/monster/animal/gryphon/gryphon5 +/monster/animal/gryphon/gryphon6 +/monster/animal/gryphon/gryphon7 +/monster/animal/gryphon/gryphon8 +/monster/animal/gryphon/gryphon9 +/spell/Wand/gu_horn +/monster/goblin/Kobold/h_kobold +/monster/humanoid/Halfling/halfling +/monster/humanoid/Halfling/halfling2 +/monster/humanoid/Halfling/halfling3 +/monster/humanoid/Halfling/halfling_p +/player/race/halfling_player +/weapon/hammer/hammer_2 +/misc/hangingfirepot +/spell/Healing/healing +/wall/bwall/hedge +/monster/demon/hellhound +/armour/helmet/helmet_of_xrays +/weapon/artifact/HolyAvenger/holy_avenger +/spell/Bullet/holy_effect +/monster/humanoid/Arabic/holy_priest +/spell/Golem/holy_servant +/spell/Cone/holy_word +/spell/Smite/holy_wrath +/monster/humanoid/Human/human +/player/race/human_player +/spell/Cone/icestorm +/flesh/demon/icor +/armour/boots/idaten +/connect/Gates/igateTrg1 +/connect/Gates/igateTrg2 +/connect/Gates/igate_closed_1 +/connect/Gates/igate_closed_2 +/connect/Gates/igate_open_1 +/connect/Gates/igate_open_2 +/monster/demon/imp +/spell/Smite/insect_plague +/monster/giant/JessyB/jessyb +/monster/giant/JessyB/jessyb_10 +/monster/giant/JessyB/jessyb_11 +/monster/giant/JessyB/jessyb_12 +/monster/giant/JessyB/jessyb_13 +/monster/giant/JessyB/jessyb_14 +/monster/giant/JessyB/jessyb_15 +/monster/giant/JessyB/jessyb_16 +/monster/giant/JessyB/jessyb_2 +/monster/giant/JessyB/jessyb_3 +/monster/giant/JessyB/jessyb_4 +/monster/giant/JessyB/jessyb_5 +/monster/giant/JessyB/jessyb_6 +/monster/giant/JessyB/jessyb_7 +/monster/giant/JessyB/jessyb_8 +/monster/giant/JessyB/jessyb_9 +/construct/keep/keep +/construct/keep/keep_2 +/construct/keep/keep_3 +/construct/keep/keep_4 +/monster/insect/killer_bee +/monster/humanoid/Guard/knight +/monster/goblin/kobold +/weapon/artifact/Firestar/lamestar +/monster/misc/lamia/lamia +/monster/misc/lamia/lamia_2 +/ground/lava +/weapon/artifact/Lslasher/lava_s +/planes/fire/lava/lava_sea +/planes/fire/lava/lava_sea1 +/spell/Bullet/lbullet +/wall/lbulletwall/lbulletwall +/monster/animal/leech/leech +/monster/humanoid/Dwarf/lesser_dwarven_guard +/spell/SummonMonster/lg_speedball +/monster/undead/lich +/spell/Misc/light +/spell/Bolt/lightning +/wall/lightningwall/lightningwall_t +/monster/angel/liteangel +/monster/chaos/living_chaos +/monster/misc/lokanth/lokanth +/spell/Bullet/loose_magic +/monster/humanoid/lord_e +/misc/Container/luggage +/monster/giant/mabu +/monster/giant/mabu_2 +/monster/humanoid/madman +/monster/humanoid/Human/mage +/player/class/Warrior/mage_class +/weapon/artifact/magi_staff +/weapon/bow/magic_bow +/spell/MagicMissile/magic_missile +/exit/magic_portal/magic_portal +/planes/fire/magma +/ground/major_chaos +/monster/humanoid/Human/man +/monster/humanoid/Human/man2 +/spell/Bullet/manaball +/spell/Cone/manablast +/spell/Bolt/manabolt +/spell/Bullet/manabullet +/weapon/artifact/Masamune/masamune +/monster/animal/Dog/mastif +/connect/Doors/mdoor_closed_1 +/connect/Doors/mdoor_closed_2 +/connect/Doors/mdoor_open_1 +/connect/Doors/mdoor_open_2 +/monster/demon/medium_demon/medium_demon +/monster/demon/medium_demon/medium_demon_2 +/monster/demon/medium_demon/medium_demon_3 +/monster/demon/medium_demon/medium_demon_4 +/monster/humanoid/Arabic/merchant +/monster/angel/mesangel +/wall/mine/mine_secret_1_1 +/wall/mine/mine_secret_1_2 +/wall/mine/mine_secret_2_1 +/wall/mine/mine_secret_2_2 +/jewel/mithril +/armour/mail/mithril_ar_ele +/armour/mail/mithril_chainmail +/player/class/Religious/monk_class +/player/class/Warrior/Dwarf/mountain_dwarf_class +/monster/animal/mouse +/connect/mover_1 +/connect/mover_2 +/connect/mover_3 +/connect/mover_4 +/connect/mover_5 +/connect/mover_6 +/connect/mover_7 +/connect/mover_8 +/connect/mover_turn +/monster/misc/mudman +/spell/Golem/mystic_fist +/monster/undead/nazgul +/monster/humanoid/necromancer +/spell/MovingBall/negaball +/spell/Bolt/negabolt +/monster/animal/Neko/neko +/monster/undead/nightmare +/monster/humanoid/Human/ninja +/monster/humanoid/Class/ninja2 +/player/class/Thief/ninja_class +/monster/humanoid/Class/northman +/player/race/northman_player +/monster/humanoid/Human/nun +/connect/Doors/odoorm2_closed_1 +/connect/Doors/odoorm2_open_1 +/connect/Doors/odoorm2bg_closed_1 +/connect/Doors/odoorm2bg_open_1 +/connect/Doors/odoorm2rw_closed_1 +/connect/Doors/odoorm2rw_open_1 +/connect/Doors/odoorn2_closed_1 +/connect/Doors/odoorn2_open_1 +/monster/goblin/ogre +/monster/goblin/ogre_chief_arc +/monster/goblin/ogre_leader_arc +/ground/oil_sea +/ground/oil_sea_ultra_viscous +/monster/goblin/ologhi +/monster/goblin/orc +/monster/goblin/orc_chief_arc +/monster/goblin/orc_leader_arc +/player/class/Religious/paladin_class +/monster/animal/panther +/monster/elemental/Para/para_air +/monster/elemental/Para/para_earth +/monster/elemental/Para/para_fire +/monster/elemental/Para/para_ice +/monster/elemental/Para/para_lava +/monster/elemental/Para/para_lightning +/monster/elemental/Para/para_mud +/monster/elemental/Para/para_water +/spell/Cone/paralyze +/jewel/pearl +/connect/pedestal +/connect/pedestal_trigger +/exit/magic_portal/perm_magic_portal +/ground/permanent_lava +/monster/acid/pet_necro +/inorganic/phil_phosphorus +/inorganic/phil_salt +/inorganic/phil_sulphur +/monster/humanoid/Class/pirate +/monster/humanoid/Human/pirate_lass +/connect/Hole/pit_closed +/connect/Hole/pit_open +/connect/Hole/pit_white-pink-c-marble_111_closed +/connect/Hole/pit_white-pink-c-marble_111_open +/connect/Hole/pit_white-pink-c-marble_112_closed +/connect/Hole/pit_white-pink-c-marble_112_open +/connect/Hole/pit_white-pink-c-marble_113_closed +/connect/Hole/pit_white-pink-c-marble_113_open +/connect/Hole/pit_white-pink-c-marble_114_closed +/connect/Hole/pit_white-pink-c-marble_114_open +/connect/Hole/pit_white-red-c-marble_111_closed +/connect/Hole/pit_white-red-c-marble_111_open +/connect/Hole/pit_white-red-c-marble_112_closed +/connect/Hole/pit_white-red-c-marble_112_open +/connect/Hole/pit_white-red-c-marble_113_closed +/connect/Hole/pit_white-red-c-marble_113_open +/connect/Hole/pit_white-red-c-marble_114_closed +/connect/Hole/pit_white-red-c-marble_114_open +/monster/misc/pixie +/player/race/pl_half_orc +/system/player_changer +/spell/MovingBall/poison_fog +/spell/MovingBall/poison_fog_sign +/spell/Bullet/poisonbullet +/spell/Bullet/poisoncloud +/monster/animal/Bear/polarbear +/monster/animal/Bear/polarbear_2 +/spell/Misc/polymorph +/monster/humanoid/Human/postman/postman +/spell/power_crystal +/monster/humanoid/Human/priest +/player/class/Religious/priest_class +/monster/humanoid/Human/princess +/monster/humanoid/Human/prisoner +/spell/Change_Ability/protection +/disease/puddle_of_saliva +/monster/animal/Dog/pup +/monster/animal/giant_worm/purple_worm +/monster/animal/giant_worm/purple_worm_2 +/monster/animal/giant_worm/purple_worm_3 +/monster/animal/giant_worm/purple_worm_4 +/monster/humanoid/pyromaniac +/player/race/quetzalcoatl_player +/ground/quicksilver_sea +/monster/demon/raas +/monster/humanoid/Dragon/red_dragon1 +/monster/humanoid/Dragon/red_dragon2 +/wall/cwall-red/redweak_wall_3 +/wall/cwall-red/redweak_wall_4 +/disease/reeking_urine +/armour/shield/reflector +/talisman/ring +/talisman/ring_nodrain +/armour/mail/robe_midnight +/spell/Wand/rod_heavy +/spell/Wand/rod_light +/jewel/ruby +/spell/Rune/rune_antimagic +/spell/Rune/rune_ball_lightning +/spell/Rune/rune_blast +/spell/Rune/rune_burning_hands +/spell/Rune/rune_confusion +/spell/Rune/rune_create_bomb +/spell/Rune/rune_death +/spell/Rune/rune_dragonbreath +/spell/Rune/rune_drain_magic +/spell/Rune/rune_fire +/spell/Rune/rune_frost +/spell/Rune/rune_heal +/spell/Rune/rune_icestorm +/spell/Rune/rune_large_fireball +/spell/Rune/rune_large_icestorm +/spell/Rune/rune_medium_fireball +/spell/Rune/rune_paralysis +/spell/Rune/rune_poison_cloud +/spell/Rune/rune_regenerate_spellpoints +/spell/Rune/rune_restoration +/spell/Rune/rune_shock +/spell/Rune/rune_small_lightning +/spell/Rune/rune_summon_air_elemental +/spell/Rune/rune_summon_devil +/spell/Rune/rune_summon_earth_elemental +/spell/Rune/rune_summon_fire_elemental +/spell/Rune/rune_summon_water_elemental +/spell/Rune/rune_transferrence +/monster/acid/rustmonster +/construct/Snow/s_barrack_up +/construct/Snow/s_barrack_up_2 +/monster/elemental/Shadow/s_mastif +/monster/elemental/Shadow/s_wyvern +/monster/elemental/Shadow/s_wyvern_2 +/monster/humanoid/Human/sage +/monster/misc/sandy +/jewel/sapphire +/monster/animal/scorpion +/ground/sea +/ground/sea1 +/monster/misc/serpmen/serp_man +/monster/misc/serpmen/serp_priest +/monster/giant/serpent/serpent +/monster/giant/serpent/serpent_2 +/player/race/serpentman_player +/monster/elemental/Shadow/shadow +/monster/animal/shadowtiger/shadowpup +/monster/animal/shadowtiger/shadowtiger +/monster/animal/shadowtiger/shadowtiger_2 +/monster/animal/shadowtiger/shadowtiger_3 +/monster/animal/shadowtiger/shadowtiger_4 +/ground/shallow_sea +/monster/animal/farmyard/sheep +/spell/Bullet/Shell/shell +/gods/items/earth_shield/shield_gaea +/armour/gauntlets/shining_finger +/spell/Cone/shockwave +/weapon/misc/shovel_1 +/monster/humanoid/siegfried +/monster/undead/Skeletal_mage/skeletalmage +/monster/undead/skeleton +/monster/undead/skeleton_chief_arc +/monster/undead/skeleton_leader_arc +/monster/undead/skull +/weapon/artifact/skullcleaver +/monster/acid/slime +/monster/acid/slimecrawler/slimecrawler +/connect/Casino/slotmachine1 +/connect/Casino/slotmachine2 +/connect/Casino/slotmachine3 +/spell/Cone/slow +/monster/giant/slug/slug +/monster/giant/slug/slug_2 +/monster/troll/small_troll +/spell/MagicWall/smover/smover_1 +/spell/MagicWall/smover/smover_2 +/spell/MagicWall/smover/smover_3 +/spell/MagicWall/smover/smover_4 +/spell/MagicWall/smover/smover_5 +/spell/MagicWall/smover/smover_6 +/spell/MagicWall/smover/smover_7 +/spell/MagicWall/smover/smover_8 +/spell/MagicWall/smover/smover_turn +/monster/animal/snake +/spell/AnimateWeapon/snake_golem +/spell/Bullet/snowball +/spell/Bullet/snowstorm +/player/class/Wizardry/sorcerer_class +/spell/Cone/sparkshower +/weapon/misc/spear +/gods/items/spear_ixalovh +/spell/SummonMonster/speedball +/wall/speedbwall/speedballwall +/armour/boots/speedboots +/monster/misc/sphinx +/monster/misc/sphinx_2 +/monster/insect/spider +/monster/insect/spider_gen +/ground/spider_web +/connect/Gates/spike_closed +/connect/Gates/spike_hidden +/connect/Gates/spike_moving +/connect/Gates/spike_open +/connect/Gates/spikes_closed +/connect/Gates/spikes_hidden +/connect/Gates/spikes_moving +/connect/Gates/spikes_open +/connect/Spinner/spinner_-135 +/connect/Spinner/spinner_-45 +/connect/Spinner/spinner_-90 +/connect/Spinner/spinner_135 +/connect/Spinner/spinner_180 +/connect/Spinner/spinner_45 +/connect/Spinner/spinner_90 +/monster/insect/ant/spit_ant +/spell/Wand/staff +/monster/misc/stalker +/spell/Bolt/steambolt +/weapon/artifact/Sting/sting +/misc/Container/stove +/connect/stwall_closed_1 +/connect/stwall_open_1 +/spell/Bolt/sunspear +/monster/humanoid/Human/swashbuckler +/player/class/Warrior/swashbuckler_class +/weapon/sword/t_dagger +/gods/items/tear_gaea +/exit/teleporter +/ground/temp_fog +/monster/misc/tentacle/tentacle +/monster/misc/tentacle/tentacle2 +/misc/thewheel/thewheel_short_ccwise-back +/misc/thewheel/thewheel_tall_2_ccwise-back +/misc/thewheel/thewheel_tall_ccwise-back +/monster/humanoid/Human/thief +/monster/humanoid/Class/thief_1 +/player/class/Thief/thief_class +/weapon/bow/thundar_bolt +/monster/giant/Titan/titan +/monster/giant/Titan/titan_2 +/monster/giant/Titan/titan_3 +/monster/giant/Titan/titan_4 +/monster/giant/Titan/titan_5 +/monster/giant/Titan/titan_6 +/monster/giant/Titan/titan_7 +/monster/giant/Titan/titan_8 +/monster/giant/Titan/titan_9 +/light/torch_1 +/misc/torch_cyan +/misc/torch_indigo +/misc/torch_vermilion +/spell/TownPortal/town_portal_magic +/traps/trap +/traps/trap_blades +/disease/trap_diseased_needle +/traps/trap_needle +/traps/trap_rocks +/traps/trap_spike_pit +/traps/trap_spikes2 +/connect/Hole/trapdoor_1 +/connect/Hole/trapdoor_2 +/connect/Hole/trapdoor_3 +/connect/Hole/trapdoor_4 +/weapon/misc/trident +/connect/trigger +/player/race/troll_player +/spell/Cone/turn_undead +/flesh/misc/u_horn +/weapon/artifact/Usword/uk_sd +/monster/misc/Unicorn/unicorn +/monster/misc/Unicorn/unicorn_2 +/monster/goblin/Kobold/unusual_kobold +/weapon/artifact/UW_Sword/uw_sword +/monster/undead/vampire +/monster/humanoid/Human/viking +/misc/violin +/spell/Bullet/vitriol_pool +/spell/Bullet/vitriol_splash +/spell/Wand/wand +/monster/insect/ant/war_ant +/player/class/Warrior/warlock_class +/monster/humanoid/Human/warrior +/player/class/Warrior/warrior_class +/monster/elemental/water_elemental +/monster/elemental/water_witch +/spell/Cone/wave +/armour/mail/wdsm +/wall/awall/weak_wall_1 +/wall/awall/weak_wall_2 +/wall/cwall/weak_wall_3 +/wall/cwall/weak_wall_4 +/wall/bwall/weak_wall_5 +/wall/bwall/weak_wall_6 +/connect/westcwall_closed_1 +/connect/westcwall_open_1 +/wall/cwall-west/westweak_wall_3 +/wall/cwall-west/westweak_wall_4 +/monster/angel/whim +/exit/whirlwind_exit +/monster/undead/wight +/spell/Cone/windstorm +/armour/helmet/wiz_hat +/monster/humanoid/Human/wizard +/player/class/Wizardry/wizard_class +/construct/tower/wizard_tower +/construct/tower/wizard_tower2 +/monster/animal/Wolf/wolf +/monster/humanoid/Human/woman +/monster/humanoid/Human/woman2 +/monster/humanoid/Human/woman3 +/monster/insect/ant/work_ant +/monster/undead/wraith +/player/race/wraith_player +/spell/Cone/wrathful_eye +/wall/wwall/wwall_weak_1 +/wall/wwall/wwall_weak_2 +/monster/insect/xan +/monster/undead/zombie +/monster/angel/angel_sword +/spell/Golem/avatar +/monster/acid/bluesphere +/monster/dragon/Chinese_Dra/chinese_dragon_spellcasting +/monster/elemental/elem_dust +/monster/elemental/elem_fire_black +/player/race/fenx_player_class_warrior +/player/race/fenx_player_singing +/player/race/fenx_player_spellcasting +/player/race/fenx_player_sword +/spell/Golem/golem_red +/monster/dragon/Hatchlings/grey_dragon +/monster/angel/highangel +/monster/humanoid/Class/ninja +/monster/goblin/ogre_r +/player/race/pl_dragon_bl +/player/race/pl_dragon_blue +/player/race/pl_dragon_g +/player/race/pl_dragon_r +/monster/undead/skree/skree_1 +/monster/undead/skree/skree_2 +/monster/undead/skree/skree_3 +/monster/undead/skree/skree_4 +/monster/troll/smallt_green +/monster/humanoid/Elf/spock +/monster/troll/Troll/troll_1 +/monster/troll/Troll/troll_2 +/monster/troll/Troll/troll_3 +/monster/troll/Troll/troll_4 +/monster/humanoid/Class/Warrior/warrior +/monster/humanoid/Class/Warrior/warrior_blue +/monster/humanoid/Class/Warrior/warrior_green +/monster/humanoid/Class/Warrior/warrior_grey +/monster/humanoid/Class/Warrior/warrior_lblue +/monster/humanoid/Class/Warrior/warrior_red +/monster/chaos/witch_chaos +/player/class/Wizardry/wizard_blue +/player/class/Wizardry/wizard_green +/player/class/Wizardry/wizard_white +/player/class/Wizardry/wizard_yellow Property changes on: trunk/crossfire/resource/conf/animtree ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-30 19:47:43 UTC (rev 5609) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-10-30 20:17:34 UTC (rev 5610) @@ -192,6 +192,11 @@ archetypeSet.setLoadedFromArchive(true); // load from the collected files try { + animationObjects.loadAnimTree(collectedDirectory, IGUIConstants.ANIMTREE_FILE); + } catch (final IOException e) { + log.warn("Cannot load animation tree file:" + e.getMessage()); + } + try { loadAnimationsFromCollect(); // open the resource file final BufferedReader stream = IOUtils.createReader(collectedDirectory, IGUIConstants.ARCH_FILE); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-30 19:47:43 UTC (rev 5609) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-10-30 20:17:34 UTC (rev 5610) @@ -214,7 +214,7 @@ archetypeSet.setLoadedFromArchive(true); // load from the collected files try { - animationObjects.loadAnimTree(new File(collectedDirectory, IGUIConstants.ANIMTREE_FILE)); + animationObjects.loadAnimTree(collectedDirectory, IGUIConstants.ANIMTREE_FILE); loadAnimationsFromCollect(); // open the resource file final BufferedReader stream = IOUtils.createReader(collectedDirectory, IGUIConstants.ARCH_FILE); Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2008-10-30 19:47:43 UTC (rev 5609) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/AnimationObjects.java 2008-10-30 20:17:34 UTC (rev 5610) @@ -86,10 +86,11 @@ /** * Loads animations from a file. + * @param collectedDirectory the directory for <code>animTreeFile</code> * @param animTreeFile file to load animations tree from * @throws IOException in case of I/O errors * @throws FileNotFoundException in case the file couldn't be opened */ - void loadAnimTree(File animTreeFile) throws FileNotFoundException, IOException; + void loadAnimTree(@NotNull String collectedDirectory, @NotNull String animTreeFile) throws FileNotFoundException, IOException; } // interface AnimationObjects Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java 2008-10-30 19:47:43 UTC (rev 5609) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java 2008-10-30 20:17:34 UTC (rev 5610) @@ -168,8 +168,8 @@ } /** {@inheritDoc} */ - public void loadAnimTree(final File animTreeFile) throws FileNotFoundException, IOException { - final BufferedReader in = new BufferedReader(new InputStreamReader(new FileInputStream(animTreeFile), IOUtils.MAP_ENCODING)); + public void loadAnimTree(@NotNull final String collectedDirectory, @NotNull final String animTreeFile) throws FileNotFoundException, IOException { + final BufferedReader in = IOUtils.createReader(collectedDirectory, animTreeFile); try { loadAnimTree(in); } finally { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-31 17:50:15
|
Revision: 5613 http://gridarta.svn.sourceforge.net/gridarta/?rev=5613&view=rev Author: akirschbaum Date: 2008-10-31 17:50:11 +0000 (Fri, 31 Oct 2008) Log Message: ----------- Fix spells combobox in game object attributes dialog. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/src/app/net/sf/gridarta/AbstractMainControl.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-10-31 06:34:37 UTC (rev 5612) +++ trunk/crossfire/ChangeLog 2008-10-31 17:50:11 UTC (rev 5613) @@ -1,3 +1,7 @@ +2008-10-31 Andreas Kirschbaum + + * Fix spells combobox in game object attributes dialog. + 2008-10-28 Andreas Kirschbaum * Load correct facetree file in "collected" mode. Modified: trunk/src/app/net/sf/gridarta/AbstractMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-10-31 06:34:37 UTC (rev 5612) +++ trunk/src/app/net/sf/gridarta/AbstractMainControl.java 2008-10-31 17:50:11 UTC (rev 5613) @@ -392,14 +392,6 @@ throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } final GameObjectMatchers gameObjectMatchers = new GameObjectMatchers(xmlHelper.getDocumentBuilder(), xmlHelper.getXPath()); - if (spellType != 0) { - new ArchetypeSetSpellLoader<G, A, R>().load(archetypeSet, spellType, gameObjectSpells); - gameObjectSpells.sort(); - } - if (spellFile != null) { - XMLSpellLoader.load(globalSettings.getConfigurationDirectory(), spellFile, xmlHelper.getDocumentBuilder(), numberSpells); - numberSpells.sort(); - } try { final String filename = IOUtils.getResourceURLAsString(globalSettings.getConfigurationDirectory(), "GameObjectMatchers.xml"); gameObjectMatchers.readGameObjectMatchers(filename); @@ -468,6 +460,14 @@ scriptArchEditor.initEventTypeBoxes(scriptArchUtils); GameObject.initialize(archetypeSet, archetypeTypeSet, gameObjectMatchers, scriptArchEditor, animationObjects, SystemIcons.getNofaceTileIcon(), newScriptArchData(scriptedEventFactory, scriptArchUtils, scriptArchEditor)); init4(gameObjectParser, archetypeParser, editTypes, faceObjects, animationObjects, mainView, globalSettings, archetypeSet); + if (spellType != 0) { + new ArchetypeSetSpellLoader<G, A, R>().load(archetypeSet, spellType, gameObjectSpells); + gameObjectSpells.sort(); + } + if (spellFile != null) { + XMLSpellLoader.load(globalSettings.getConfigurationDirectory(), spellFile, xmlHelper.getDocumentBuilder(), numberSpells); + numberSpells.sort(); + } if (globalSettings.isAutoPopupDocu()) { // do an automated help popup because the docu version has increased This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-10-31 18:10:00
|
Revision: 5615 http://gridarta.svn.sourceforge.net/gridarta/?rev=5615&view=rev Author: akirschbaum Date: 2008-10-31 18:09:49 +0000 (Fri, 31 Oct 2008) Log Message: ----------- Do not crash when validating unsaved maps containing exits. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/map/validation/checks/ExitChecker.java Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2008-10-31 18:03:17 UTC (rev 5614) +++ trunk/crossfire/ChangeLog 2008-10-31 18:09:49 UTC (rev 5615) @@ -1,5 +1,7 @@ 2008-10-31 Andreas Kirschbaum + * Do not crash when validating unsaved maps containing exits. + * Fix spells combobox in game object attributes dialog. 2008-10-28 Andreas Kirschbaum Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2008-10-31 18:03:17 UTC (rev 5614) +++ trunk/daimonin/ChangeLog 2008-10-31 18:09:49 UTC (rev 5615) @@ -1,3 +1,7 @@ +2008-10-31 Andreas Kirschbaum + + * Do not crash when validating unsaved maps containing exits. + 2008-10-28 Andreas Kirschbaum * Load correct animtree and facetree files in "collected" mode. Modified: trunk/src/app/net/sf/gridarta/map/validation/checks/ExitChecker.java =================================================================== --- trunk/src/app/net/sf/gridarta/map/validation/checks/ExitChecker.java 2008-10-31 18:03:17 UTC (rev 5614) +++ trunk/src/app/net/sf/gridarta/map/validation/checks/ExitChecker.java 2008-10-31 18:09:49 UTC (rev 5615) @@ -70,7 +70,12 @@ newfile = new File(mapDirectory.getAbsolutePath(), path.substring(1)); } else { // we have a relative path: - newfile = new File(gameObject.getMapSquare().getMapModel().getMapControl().getMapFile().getParent(), path); + final File mapFile = gameObject.getMapSquare().getMapModel().getMapControl().getMapFile(); + if (mapFile == null) { + // unsaved map => do not check + return; + } + newfile = new File(mapFile.getParent(), path); } if (newfile.exists() && !newfile.isDirectory()) { return; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-11-01 04:33:42
|
Revision: 5618 http://gridarta.svn.sourceforge.net/gridarta/?rev=5618&view=rev Author: akirschbaum Date: 2008-11-01 04:33:39 +0000 (Sat, 01 Nov 2008) Log Message: ----------- Fix face tree and animation tree loading code. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObject.java trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-10-31 20:07:05 UTC (rev 5617) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeParser.java 2008-11-01 04:33:39 UTC (rev 5618) @@ -183,7 +183,7 @@ if (thisLine.equals("mina")) { final String animationName = "_" + archetype.getArchetypeName(); try { - animationObjects.addAnimPath(animationName, path + archetype.getArchetypeName()); + animationObjects.addAnimPath(animationName, path + animationName); animationObjects.addAnimationObject(animationName, animText.toString()); animText = null; } catch (final DuplicateAnimationException e) { Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2008-10-31 20:07:05 UTC (rev 5617) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeParser.java 2008-11-01 04:33:39 UTC (rev 5618) @@ -178,7 +178,7 @@ if (thisLine.equals("mina")) { final String animationName = "_" + archetype.getArchetypeName(); try { - animationObjects.addAnimPath(animationName, path + archetype.getArchetypeName()); + animationObjects.addAnimPath(animationName, path + animationName); animationObjects.addAnimationObject(animationName, animText.toString()); animText = null; } catch (final DuplicateAnimationException e) { Modified: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java 2008-10-31 20:07:05 UTC (rev 5617) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java 2008-11-01 04:33:39 UTC (rev 5618) @@ -118,7 +118,7 @@ ((ArchFaceProvider) FaceObjectProviders.normal).addInfo(facename, filename); final int stripPath = baseDir.getAbsolutePath().length(); try { - faceObjects.addFaceObject(facename, filename.substring(stripPath, filename.length() - 4).replace('\\', '/'), filename, 0, (int) new File(filename).length()); + faceObjects.addFaceObject(facename, filename.substring(stripPath, filename.length() - 4).replace('\\', '/'), 0, (int) new File(filename).length()); } catch (final DuplicateFaceException e) { ACTION_FACTORY.showMessageDialog(parent, "loadDuplicateFace", e.getDuplicate().getFaceName(), e.getDuplicate().getOriginalFilename(), e.getExisting().getOriginalFilename()); } Modified: trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java 2008-10-31 20:07:05 UTC (rev 5617) +++ trunk/src/app/net/sf/gridarta/gameobject/anim/DefaultAnimationObjects.java 2008-11-01 04:33:39 UTC (rev 5618) @@ -95,7 +95,7 @@ final E animationObject; if (path == null) { final String animPath = animMap.get(animName); - animationObject = newAnimationObject(animName, list, animPath == null ? "/" + animName : animPath + "/" + animName); + animationObject = newAnimationObject(animName, list, animPath == null ? "/" + animName : animPath); } else { animationObject = newAnimationObject(animName, list, path + '/' + animName); } Modified: trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObject.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObject.java 2008-10-31 20:07:05 UTC (rev 5617) +++ trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObject.java 2008-11-01 04:33:39 UTC (rev 5618) @@ -74,14 +74,13 @@ * @param faceName name of face, e.g. <samp>"bug.111"</samp> * @param originalFilename original filename without .png extension, e.g. * <samp>"/system/bug.111"</samp> - * @param path Path for this FaceObject. * @param offset offset in the file denoted by <var>actualFilename</var>, * e.g. <samp>148676</samp> * @param size size in the file denoted by <var>actualFilename</var>, e.g. * <samp>567</samp>, */ - public DefaultFaceObject(final String faceName, final String originalFilename, final String path, final int offset, final int size) { - super(path); + public DefaultFaceObject(final String faceName, final String originalFilename, final int offset, final int size) { + super(originalFilename); this.faceName = faceName; this.originalFilename = originalFilename; this.offset = offset; Modified: trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java 2008-10-31 20:07:05 UTC (rev 5617) +++ trunk/src/app/net/sf/gridarta/gameobject/face/DefaultFaceObjects.java 2008-11-01 04:33:39 UTC (rev 5618) @@ -239,8 +239,8 @@ } /** {@inheritDoc} */ - public void addFaceObject(final String faceName, final String originalFilename, final String actualFilename, final int offset, final int size) throws DuplicateFaceException { - final FaceObject faceObject = new DefaultFaceObject(faceName, originalFilename, actualFilename, offset, size); + public void addFaceObject(final String faceName, final String originalFilename, final int offset, final int size) throws DuplicateFaceException { + final FaceObject faceObject = new DefaultFaceObject(faceName, originalFilename, offset, size); final FaceObject otherFaceObject = get(faceName); if (otherFaceObject != null) { throw new DuplicateFaceException(faceObject, otherFaceObject); @@ -252,7 +252,6 @@ public void loadFacesCollection(@NotNull final String collectedDirectory, @NotNull final String faceFile, @NotNull final String treeFile) throws IOException, FileNotFoundException, DuplicateFaceException { final File tmpFaceFile = IOUtils.getFile(collectedDirectory, faceFile); FaceObjectProviders.setNormal(new CollectedFaceProvider(tmpFaceFile)); - final String actualFilename = tmpFaceFile.toString(); final InputStream inputStream = new FileInputStream(tmpFaceFile); final ByteArrayOutputStream bufOut = new ByteArrayOutputStream((int) tmpFaceFile.length()); try { @@ -325,7 +324,7 @@ if (!matcher.matches()) { log.warn("Syntax error in " + treeFile + ": " + originalFilename); } else { - addFaceObject(faceName, matcher.group(1), actualFilename, offset, size); + addFaceObject(faceName, matcher.group(1), offset, size); } } } Modified: trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java 2008-10-31 20:07:05 UTC (rev 5617) +++ trunk/src/app/net/sf/gridarta/gameobject/face/FaceObjects.java 2008-11-01 04:33:39 UTC (rev 5618) @@ -46,13 +46,12 @@ * Adds a new face object. * @param faceName name of face, e.g. <samp>"robe.101"</samp> * @param originalFilename original filename, e.g. <samp>"arch/objects/misc/robe.101.png"</samp> - * @param actualFilename actual filename, e.g. <samp>"arch/daimonin.0"</samp> * @param offset offset in the file denoted by <var>actualFilename</var>, * e.g. <samp>148676</samp> * @param size size in the file denoted by <var>actualFilename</var>, e.g. * <samp>567</samp>, * @throws DuplicateFaceException in case the face was not unique */ - void addFaceObject(String faceName, String originalFilename, String actualFilename, int offset, int size) throws DuplicateFaceException; + void addFaceObject(String faceName, String originalFilename, int offset, int size) throws DuplicateFaceException; } // interface FaceObjects This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-11-01 05:54:29
|
Revision: 5621 http://gridarta.svn.sourceforge.net/gridarta/?rev=5621&view=rev Author: akirschbaum Date: 2008-11-01 05:54:22 +0000 (Sat, 01 Nov 2008) Log Message: ----------- Remove dependency to archetype directory from collection code; fixes issues with implicitly generated animation names. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-11-01 05:33:11 UTC (rev 5620) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSetLoader.java 2008-11-01 05:54:22 UTC (rev 5621) @@ -162,7 +162,7 @@ archetypeSet.setLoadedFromArchive(false); // don't load from the collected files fname = globalSettings.getArchDirectory(); final File dir = new File(fname); - loadArchetypesFromFiles(archetypeParser, dir, null, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files + loadArchetypesFromFiles(archetypeParser, null, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files } archetypeSet.reportErrors(parent); @@ -219,7 +219,6 @@ * Loads all archetypes and faces by recursing through the * <code>arch/</code> directory tree. * @param archetypeParser the archetype parser to use - * @param baseDir the base directory to strip from filenames * @param path the base directory relative path of <code>f</code> * @param f file path where we currently are * @param folderLevel level of the folder @@ -230,7 +229,7 @@ * @param invObjects collects all inventory objects * @param parent the parent component for error messages */ - private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final File baseDir, @Nullable final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { + private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @Nullable final String path, @NotNull final File f, final int folderLevel, @NotNull final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels @@ -242,7 +241,7 @@ final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; final String newPath = path == null ? "" : path + "/" + name; for (final String entry : entries) { - loadArchetypesFromFiles(archetypeParser, baseDir, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, false, invObjects, parent); + loadArchetypesFromFiles(archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, false, invObjects, parent); } } else { log.warn("Cannot read directory: " + f); @@ -254,7 +253,7 @@ archetypeParser.parseArchetype(f.getPath(), panelName, folderName, invObjects); } else if (name.endsWith(".png")) { if (archetypeSet.getImageSet() == null || name.contains("." + archetypeSet.getImageSet() + ".")) { - addPNGFace(baseDir, f.getAbsolutePath(), name, parent); + addPNGFace(f.getAbsolutePath(), path, name, parent); } } else if (name.endsWith(".face")) { parseDefFace(f.getAbsolutePath(), path); Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-11-01 05:33:11 UTC (rev 5620) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSetLoader.java 2008-11-01 05:54:22 UTC (rev 5621) @@ -179,8 +179,8 @@ animFiles = new ArrayList<Pair<String, File>>(); fname = globalSettings.getArchDirectory(); final File dir = new File(fname); - addPNGFace(dir, new File(dir, "dev/editor/bug.101.png").getAbsolutePath(), "bug.101.png", parent); - loadArchetypesFromFiles(archetypeParser, dir, null, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files + addPNGFace(new File(dir, "dev/editor/bug.101.png").getAbsolutePath(), "/dev/editor", "bug.101.png", parent); + loadArchetypesFromFiles(archetypeParser, null, dir, 0, "default", "default", false, invObjects, parent); // load arches & images from individual files loadAnimsFromFiles(); } archetypeSet.reportErrors(parent); @@ -237,7 +237,6 @@ * Loads all archetypes and faces by recursing through the * <code>arch/</code> directory tree. * @param archetypeParser the archetype parser to use - * @param baseDir the base directory to strip from filenames * @param path the base directory relative path for <code>f</code> * @param f file path where we currently are * @param folderLevel level of the folder @@ -248,7 +247,7 @@ * @param invObjects collects all inventory objects * @param parent the parent component for error messages */ - private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @NotNull final File baseDir, @Nullable final String path, final File f, final int folderLevel, @Nullable final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { + private void loadArchetypesFromFiles(@NotNull final AbstractArchetypeParser<GameObject, MapArchObject, Archetype> archetypeParser, @Nullable final String path, final File f, final int folderLevel, @Nullable final String panelName, @NotNull final String folderName, final boolean noPanel, @NotNull final List<GameObject> invObjects, @NotNull final Component parent) { final String name = f.getName(); if (f.isDirectory()) { // now, setup the arch panels @@ -260,7 +259,7 @@ final String thisFolderName = folderLevel == 1 || folderLevel == 2 ? name : folderName; final String newPath = path == null ? "" : path + "/" + name; for (final String entry : entries) { - loadArchetypesFromFiles(archetypeParser, baseDir, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, noPanel || name.equalsIgnoreCase("intern"), invObjects, parent); + loadArchetypesFromFiles(archetypeParser, newPath, new File(f, entry), folderLevel + 1, thisPanelName, thisFolderName, noPanel || name.equalsIgnoreCase("intern"), invObjects, parent); } } else { log.warn("Cannot read directory: " + f); @@ -271,7 +270,7 @@ archetypeSet.setCurrentFile(f); archetypeParser.parseArchetype(f.getPath(), panelName, folderName, invObjects); } else if (name.endsWith(".png")) { - addPNGFace(baseDir, f.getAbsolutePath(), name, parent); + addPNGFace(f.getAbsolutePath(), path, name, parent); } else if (name.endsWith(".anim")) { animFiles.add(new Pair(path, f)); } Modified: trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java =================================================================== --- trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java 2008-11-01 05:33:11 UTC (rev 5620) +++ trunk/src/app/net/sf/gridarta/gameobject/AbstractArchetypeSetLoader.java 2008-11-01 05:54:22 UTC (rev 5621) @@ -108,17 +108,16 @@ /** * Load a png from the file, convert it to IconImage and attach it to the * facelist. - * @param baseDir the base directory to strip from filenames * @param filename filename, absolute path + * @param path the path name of <code>name</code> * @param name name of the png (e.g. blocked.111.png) * @param parent the parent component for error messages */ - protected void addPNGFace(@NotNull final File baseDir, final String filename, final String name, @NotNull final Component parent) { + protected void addPNGFace(@NotNull final String filename, @NotNull final String path, @NotNull final String name, @NotNull final Component parent) { final String facename = generateFaceName(name); ((ArchFaceProvider) FaceObjectProviders.normal).addInfo(facename, filename); - final int stripPath = baseDir.getAbsolutePath().length(); try { - faceObjects.addFaceObject(facename, filename.substring(stripPath, filename.length() - 4).replace('\\', '/'), 0, (int) new File(filename).length()); + faceObjects.addFaceObject(facename, path + "/" + facename, 0, (int) new File(filename).length()); } catch (final DuplicateFaceException e) { ACTION_FACTORY.showMessageDialog(parent, "loadDuplicateFace", e.getDuplicate().getFaceName(), e.getDuplicate().getOriginalFilename(), e.getExisting().getOriginalFilename()); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2008-11-01 07:24:48
|
Revision: 5626 http://gridarta.svn.sourceforge.net/gridarta/?rev=5626&view=rev Author: akirschbaum Date: 2008-11-01 07:24:46 +0000 (Sat, 01 Nov 2008) Log Message: ----------- Fix possible file leaks. Modified Paths: -------------- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java Modified: trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-11-01 06:19:54 UTC (rev 5625) +++ trunk/crossfire/src/cfeditor/gameobject/ArchetypeSet.java 2008-11-01 07:24:46 UTC (rev 5626) @@ -77,130 +77,140 @@ public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { final File dfile = new File(collectedDirectory, IGUIConstants.ARCH_FILE); // now open the output-stream - final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dfile), IOUtils.MAP_ENCODING)); + final FileOutputStream fos = new FileOutputStream(dfile); try { - int artifactCount = 0; + final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); + try { + final BufferedWriter out = new BufferedWriter(osw); + try { + int artifactCount = 0; - int count = 0; // count how much arches we've collected + int count = 0; // count how much arches we've collected - for (final Archetype arch : getArchetypes()) { + for (final Archetype arch : getArchetypes()) { - // exclude arches generated from artifacts file from collection - if (arch.isArtifact()) { - artifactCount++; - continue; - } - if (arch.isUndefinedArchetype()) { - continue; - } + // exclude arches generated from artifacts file from collection + if (arch.isArtifact()) { + artifactCount++; + continue; + } + if (arch.isUndefinedArchetype()) { + continue; + } - if (arch.isTail()) { - continue; - } + if (arch.isTail()) { + continue; + } - if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { - // process map arch + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { + // process map arch - out.append("Object ").append(arch.getArchetypeName()).append('\n'); + out.append("Object ").append(arch.getArchetypeName()).append('\n'); - // map object hack: x/y is normally a reference for multi - // part arches - i include this hack until we rework the - // arch objects with more useful script names - if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { - out.append("x ").append(Integer.toString(arch.getMultiX())).append('\n'); - out.append("y ").append(Integer.toString(arch.getMultiY())).append('\n'); - } + // map object hack: x/y is normally a reference for multi + // part arches - i include this hack until we rework the + // arch objects with more useful script names + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { + out.append("x ").append(Integer.toString(arch.getMultiX())).append('\n'); + out.append("y ").append(Integer.toString(arch.getMultiY())).append('\n'); + } - if (arch.getObjName() != null) { - out.append("name ").append(arch.getObjName()).append('\n'); - } - if (arch.getFaceName() != null) { - out.append("face ").append(arch.getFaceName()).append('\n'); - } - if (arch.getTypeNo() > 0) { - out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); - } + if (arch.getObjName() != null) { + out.append("name ").append(arch.getObjName()).append('\n'); + } + if (arch.getFaceName() != null) { + out.append("face ").append(arch.getFaceName()).append('\n'); + } + if (arch.getTypeNo() > 0) { + out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); + } - out.append(arch.getObjectText()); + out.append(arch.getObjectText()); - out.append("end\n"); - } else { - out.append("Object ").append(arch.getArchetypeName()).append('\n'); + out.append("end\n"); + } else { + out.append("Object ").append(arch.getArchetypeName()).append('\n'); - if (arch.getObjName() != null) { - out.append("name ").append(arch.getObjName()).append('\n'); - } - if (arch.getFaceName() != null) { - out.append("face ").append(arch.getFaceName()).append('\n'); - } - if (arch.getTypeNo() > 0) { - out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); - } + if (arch.getObjName() != null) { + out.append("name ").append(arch.getObjName()).append('\n'); + } + if (arch.getFaceName() != null) { + out.append("face ").append(arch.getFaceName()).append('\n'); + } + if (arch.getTypeNo() > 0) { + out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); + } - // special: add a string-attribute with the display-category - out.append("editor_folder ").append(arch.getEditorFolder()).append('\n'); + // special: add a string-attribute with the display-category + out.append("editor_folder ").append(arch.getEditorFolder()).append('\n'); - // add message text - if (arch.getMsgText() != null) { - out.append("msg\n").append(arch.getMsgText()).append("endmsg\n"); - } + // add message text + if (arch.getMsgText() != null) { + out.append("msg\n").append(arch.getMsgText()).append("endmsg\n"); + } - out.append(arch.getObjectText()); + out.append(arch.getObjectText()); - for (final GameObject inv : arch) { - gameObjectParser.save(out, inv); - } + for (final GameObject inv : arch) { + gameObjectParser.save(out, inv); + } - out.append("end\n"); + out.append("end\n"); - // process the multipart tails: - for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - out.append("More\n"); + // process the multipart tails: + for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + out.append("More\n"); - out.append("Object ").append(tail.getArchetypeName()).append('\n'); + out.append("Object ").append(tail.getArchetypeName()).append('\n'); - if (tail.getObjName() != null) { - out.append("name ").append(tail.getObjName()).append('\n'); - } - if (tail.getFaceName() != null) { - out.append("face ").append(tail.getFaceName()).append('\n'); - } - if (tail.getTypeNo() > 0) { - out.append("type ").append(Integer.toString(tail.getTypeNo())).append('\n'); - } + if (tail.getObjName() != null) { + out.append("name ").append(tail.getObjName()).append('\n'); + } + if (tail.getFaceName() != null) { + out.append("face ").append(tail.getFaceName()).append('\n'); + } + if (tail.getTypeNo() > 0) { + out.append("type ").append(Integer.toString(tail.getTypeNo())).append('\n'); + } - out.append(tail.getObjectText()); + out.append(tail.getObjectText()); - // position of multi relative to head - if (tail.getMultiX() != 0) { - out.append("x ").append(Integer.toString(tail.getMultiX())).append('\n'); + // position of multi relative to head + if (tail.getMultiX() != 0) { + out.append("x ").append(Integer.toString(tail.getMultiX())).append('\n'); + } + if (tail.getMultiY() != 0) { + out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); + } + + out.append("end\n"); + + count++; + if (count % 100 == 0) { + progress.setValue(count); + } + } } - if (tail.getMultiY() != 0) { - out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); - } - out.append("end\n"); - count++; if (count % 100 == 0) { progress.setValue(count); } } - } - count++; - if (count % 100 == 0) { + // check if we still missed any arches + if ((count + artifactCount) - getArchetypeCount() != 0) { + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMissed", getArchetypeCount() - count); + } progress.setValue(count); + } finally { + out.close(); } + } finally { + osw.close(); } - - // check if we still missed any arches - if ((count + artifactCount) - getArchetypeCount() != 0) { - ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMissed", getArchetypeCount() - count); - } - progress.setValue(count); } finally { - out.close(); + fos.close(); } } Modified: trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-11-01 06:19:54 UTC (rev 5625) +++ trunk/daimonin/src/daieditor/gameobject/ArchetypeSet.java 2008-11-01 07:24:46 UTC (rev 5626) @@ -101,146 +101,156 @@ public void collect(@NotNull final Progress progress, @NotNull final File collectedDirectory, @NotNull final File archDirectory) throws IOException { final File dfile = new File(collectedDirectory, IGUIConstants.ARCH_FILE); // now open the output-stream - final BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(dfile), IOUtils.MAP_ENCODING)); + final FileOutputStream fos = new FileOutputStream(dfile); try { - int artifactCount = 0; + final OutputStreamWriter osw = new OutputStreamWriter(fos, IOUtils.MAP_ENCODING); + try { + final BufferedWriter out = new BufferedWriter(osw); + try { + int artifactCount = 0; - int count = 0; // count how much arches we've collected + int count = 0; // count how much arches we've collected - for (final Archetype arch : getArchetypes()) { + for (final Archetype arch : getArchetypes()) { - // exclude arches generated from artifacts file from collection - if (arch.isArtifact()) { - artifactCount++; - continue; - } - if (arch.isUndefinedArchetype()) { - continue; - } + // exclude arches generated from artifacts file from collection + if (arch.isArtifact()) { + artifactCount++; + continue; + } + if (arch.isUndefinedArchetype()) { + continue; + } - if (arch.isTail()) { - continue; - } + if (arch.isTail()) { + continue; + } - if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { - // process map arch + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { + // process map arch - out.append("Object ").append(arch.getArchetypeName()).append('\n'); + out.append("Object ").append(arch.getArchetypeName()).append('\n'); - // map object hack: x/y is normally a reference for multi - // part arches - i include this hack until we rework the - // arch objects with more useful script names - if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { - out.append("x ").append(Integer.toString(arch.getMultiX())).append('\n'); - out.append("y ").append(Integer.toString(arch.getMultiY())).append('\n'); - } + // map object hack: x/y is normally a reference for multi + // part arches - i include this hack until we rework the + // arch objects with more useful script names + if (arch.getArchetypeName().equals(net.sf.gridarta.gameobject.ArchetypeParser.STARTARCH_NAME)) { + out.append("x ").append(Integer.toString(arch.getMultiX())).append('\n'); + out.append("y ").append(Integer.toString(arch.getMultiY())).append('\n'); + } - if (arch.getObjName() != null) { - out.append("name ").append(arch.getObjName()).append('\n'); - } - //if(arch.getFaceName() != null) { - // out.append("face ").append(arch.getFaceNAme()).append('\n'); - //} - if (arch.getTypeNo() > 0) { - out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); - } + if (arch.getObjName() != null) { + out.append("name ").append(arch.getObjName()).append('\n'); + } + //if(arch.getFaceName() != null) { + // out.append("face ").append(arch.getFaceNAme()).append('\n'); + //} + if (arch.getTypeNo() > 0) { + out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); + } - out.append(arch.getObjectText()); + out.append(arch.getObjectText()); - out.append("end\n"); - } else { - out.append("Object ").append(arch.getArchetypeName()).append('\n'); + out.append("end\n"); + } else { + out.append("Object ").append(arch.getArchetypeName()).append('\n'); - if (arch.getObjName() != null) { - out.append("name ").append(arch.getObjName()).append('\n'); - } - //if(arch.getFaceName() != null) { - // out.append("face ").append(arch.getFaceName()).append('\n'); - //} - if (arch.getTypeNo() > 0) { - out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); - } - if (arch.getMultiShapeID() > 0) { - out.append("mpart_id ").append(Integer.toString(arch.getMultiShapeID())).append('\n'); - } - if (arch.getMultiPartNr() > 0) { - out.append("mpart_nr ").append(Integer.toString(arch.getMultiPartNr())).append('\n'); - } + if (arch.getObjName() != null) { + out.append("name ").append(arch.getObjName()).append('\n'); + } + //if(arch.getFaceName() != null) { + // out.append("face ").append(arch.getFaceName()).append('\n'); + //} + if (arch.getTypeNo() > 0) { + out.append("type ").append(Integer.toString(arch.getTypeNo())).append('\n'); + } + if (arch.getMultiShapeID() > 0) { + out.append("mpart_id ").append(Integer.toString(arch.getMultiShapeID())).append('\n'); + } + if (arch.getMultiPartNr() > 0) { + out.append("mpart_nr ").append(Integer.toString(arch.getMultiPartNr())).append('\n'); + } - if (arch.getMsgText() != null) { - out.append("msg\n").append(arch.getMsgText()).append("endmsg\n"); - } + if (arch.getMsgText() != null) { + out.append("msg\n").append(arch.getMsgText()).append("endmsg\n"); + } - // special: add a string-attribute with the display-category - out.append("editor_folder ").append(arch.getEditorFolder()).append('\n'); + // special: add a string-attribute with the display-category + out.append("editor_folder ").append(arch.getEditorFolder()).append('\n'); - out.append(arch.getObjectText()); + out.append(arch.getObjectText()); - out.append("end\n"); + out.append("end\n"); - // process the multipart tails: - for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { + // process the multipart tails: + for (GameObject tail = arch.getMultiNext(); tail != null; tail = tail.getMultiNext()) { - if (tail.isHead()) { - ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMultipartTooShort"); - } + if (tail.isHead()) { + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMultipartTooShort"); + } - out.append("More\n"); + out.append("More\n"); - out.append("Object ").append(tail.getArchetypeName()).append('\n'); + out.append("Object ").append(tail.getArchetypeName()).append('\n'); - if (tail.getObjName() != null) { - out.append("name ").append(tail.getObjName()).append('\n'); - } - //if(arch.getFaceName() != null) { - // out.append("face ").append(arch.getFaceName()).append('\n'); - //} - if (tail.getTypeNo() > 0) { - out.append("type ").append(Integer.toString(tail.getTypeNo())).append('\n'); - } - if (tail.getMultiShapeID() > 0) { - out.append("mpart_id ").append(Integer.toString(tail.getMultiShapeID())).append('\n'); - } - if (tail.getMultiPartNr() > 0) { - out.append("mpart_nr ").append(Integer.toString(tail.getMultiPartNr())).append('\n'); - } + if (tail.getObjName() != null) { + out.append("name ").append(tail.getObjName()).append('\n'); + } + //if(arch.getFaceName() != null) { + // out.append("face ").append(arch.getFaceName()).append('\n'); + //} + if (tail.getTypeNo() > 0) { + out.append("type ").append(Integer.toString(tail.getTypeNo())).append('\n'); + } + if (tail.getMultiShapeID() > 0) { + out.append("mpart_id ").append(Integer.toString(tail.getMultiShapeID())).append('\n'); + } + if (tail.getMultiPartNr() > 0) { + out.append("mpart_nr ").append(Integer.toString(tail.getMultiPartNr())).append('\n'); + } - if (tail.getMsgText() != null) { - out.append("msg\n").append(tail.getMsgText()).append("endmsg\n"); - } + if (tail.getMsgText() != null) { + out.append("msg\n").append(tail.getMsgText()).append("endmsg\n"); + } - out.append(tail.getObjectText()); + out.append(tail.getObjectText()); - // position of multi relative to head - if (tail.getMultiX() != 0) { - out.append("x ").append(Integer.toString(tail.getMultiX())).append('\n'); + // position of multi relative to head + if (tail.getMultiX() != 0) { + out.append("x ").append(Integer.toString(tail.getMultiX())).append('\n'); + } + if (tail.getMultiY() != 0) { + out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); + } + + out.append("end\n"); + + count++; + if (count % 100 == 0) { + progress.setValue(count); + } + } } - if (tail.getMultiY() != 0) { - out.append("y ").append(Integer.toString(tail.getMultiY())).append('\n'); - } - out.append("end\n"); - count++; if (count % 100 == 0) { progress.setValue(count); } } - } - count++; - if (count % 100 == 0) { + // check if we still missed any arches + if ((count + artifactCount) - getArchetypeCount() != 0) { + ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMissed", getArchetypeCount() - count); + } progress.setValue(count); + } finally { + out.close(); } + } finally { + osw.close(); } - - // check if we still missed any arches - if ((count + artifactCount) - getArchetypeCount() != 0) { - ACTION_FACTORY.showMessageDialog(progress.getParentComponent(), "archCollectWarningMissed", getArchetypeCount() - count); - } - progress.setValue(count); } finally { - out.close(); + fos.close(); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |