From: <aki...@us...> - 2008-07-31 20:53:53
|
Revision: 4614 http://gridarta.svn.sourceforge.net/gridarta/?rev=4614&view=rev Author: akirschbaum Date: 2008-07-31 20:54:00 +0000 (Thu, 31 Jul 2008) Log Message: ----------- Remove calls to CMainControlInstance.getInstance() and MainControl.getArchetypeSet(). Modified Paths: -------------- trunk/crossfire/src/cfeditor/CMainControl.java trunk/crossfire/src/cfeditor/gameobject/GameObject.java trunk/daimonin/src/daieditor/CMainControl.java trunk/daimonin/src/daieditor/gameobject/GameObject.java Modified: trunk/crossfire/src/cfeditor/CMainControl.java =================================================================== --- trunk/crossfire/src/cfeditor/CMainControl.java 2008-07-31 20:46:44 UTC (rev 4613) +++ trunk/crossfire/src/cfeditor/CMainControl.java 2008-07-31 20:54:00 UTC (rev 4614) @@ -227,6 +227,7 @@ globalSettings.readGlobalSettings(); animationObjects = new cfeditor.gameobject.anim.AnimationObjects(); archetypeSet = new ArchetypeSet(this, getEditTypes(), animationObjects, faceObjects, globalSettings.getImageSet()); + GameObject.setArchetypeSet(archetypeSet); final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); final SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareControl = new SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, this, getEditTypes(), mapTileListBottom, null, archetypeSet); final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView = selectedSquareControl.getSelectedSquareView(); Modified: trunk/crossfire/src/cfeditor/gameobject/GameObject.java =================================================================== --- trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-07-31 20:46:44 UTC (rev 4613) +++ trunk/crossfire/src/cfeditor/gameobject/GameObject.java 2008-07-31 20:54:00 UTC (rev 4614) @@ -19,11 +19,11 @@ package cfeditor.gameobject; -import cfeditor.CMainControlInstance; import cfeditor.gameobject.scripts.ScriptArchData; import cfeditor.map.MapArchObject; import javax.swing.ImageIcon; import javax.swing.JList; +import net.sf.gridarta.gameobject.ArchetypeSet; import net.sf.gridarta.gameobject.scripts.AbstractScriptArchEditor; import net.sf.gridarta.gui.GameObjectAttributesPanel; import net.sf.gridarta.utils.StringUtils; @@ -64,6 +64,13 @@ /** The normal face. */ private ImageIcon normalFace; + @Nullable + private static ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet = null; + + public static void setArchetypeSet(@Nullable final ArchetypeSet<GameObject, MapArchObject, Archetype> archetypeSet) { + GameObject.archetypeSet = archetypeSet; + } + /** {@inheritDoc} */ @Override public void propagateElevation(@NotNull final GameObject gameObject) { @@ -109,8 +116,7 @@ /** {@inheritDoc} */ public void setObjectFace() { - if (!isArchetype()) { - final ArchetypeSet archetypeSet = CMainControlInstance.getInstance().getArchetypeSet(); + if (!isArchetype() && archetypeSet != null) { normalFace = archetypeSet.getFace(this); } } Modified: trunk/daimonin/src/daieditor/CMainControl.java =================================================================== --- trunk/daimonin/src/daieditor/CMainControl.java 2008-07-31 20:46:44 UTC (rev 4613) +++ trunk/daimonin/src/daieditor/CMainControl.java 2008-07-31 20:54:00 UTC (rev 4614) @@ -283,6 +283,7 @@ animationObjects = new daieditor.gameobject.anim.AnimationObjects(); GameObject.setAnimationObjects(animationObjects); archetypeSet = new ArchetypeSet(this, getEditTypes(), animationObjects, faceObjects); + GameObject.setArchetypeSet(archetypeSet); final boolean mapTileListBottom = prefs.getBoolean(MainView.MAP_TILE_LIST_BOTTOM_KEY, MainView.MAP_TILE_LIST_BOTTOM_DEFAULT); final SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareControl = new SelectedSquareControl<GameObject, MapArchObject, Archetype, CMapViewBasic>(ACTION_FACTORY, this, getEditTypes(), mapTileListBottom, GUIUtils.getSysIcon(IGUIConstants.TILE_NORTH), archetypeSet); final SelectedSquareView<GameObject, MapArchObject, Archetype, CMapViewBasic> selectedSquareView = selectedSquareControl.getSelectedSquareView(); Modified: trunk/daimonin/src/daieditor/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-07-31 20:46:44 UTC (rev 4613) +++ trunk/daimonin/src/daieditor/gameobject/GameObject.java 2008-07-31 20:54:00 UTC (rev 4614) @@ -19,7 +19,6 @@ package daieditor.gameobject; -import daieditor.CMainControlInstance; import daieditor.gameobject.anim.AnimationObject; import daieditor.gameobject.scripts.ScriptArchData; import daieditor.map.MapArchObject; @@ -96,6 +95,13 @@ GameObject.animationObjects = animationObjects; } + @Nullable + private static ArchetypeSet archetypeSet = null; + + public static void setArchetypeSet(@Nullable final ArchetypeSet archetypeSet) { + GameObject.archetypeSet = archetypeSet; + } + /** {@inheritDoc} */ public int getMultiShapeID() { return multi != null ? multi.getMultiShapeID() : 0; @@ -253,7 +259,6 @@ faceObjSource = FaceSource.FACE_NOT_FOUND; } if (!isArchetype()) { - final ArchetypeSet archetypeSet = CMainControlInstance.getInstance().getArchetypeSet(); normalFace = archetypeSet.getFace(this); transFace = archetypeSet.getTrans(this); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |