diff --git a/src/java/com/threerings/stage/tools/editor/EditorFrame.java b/src/java/com/threerings/stage/tools/editor/EditorFrame.java index 1a20ce30..3ba95387 100644 --- a/src/java/com/threerings/stage/tools/editor/EditorFrame.java +++ b/src/java/com/threerings/stage/tools/editor/EditorFrame.java @@ -55,8 +55,10 @@ import com.threerings.media.ManagedJFrame; import com.threerings.miso.tile.BaseTileSet; +import com.threerings.whirled.data.AuxModel; import com.threerings.whirled.tools.xml.SceneParser; +import com.threerings.stage.data.StageMisoSceneModel; import com.threerings.stage.data.StageScene; import com.threerings.stage.data.StageSceneModel; import com.threerings.stage.tools.editor.util.EditorContext; @@ -67,6 +69,7 @@ import com.threerings.stage.tools.xml.StageSceneWriter; import static com.threerings.stage.Log.log; public class EditorFrame extends ManagedJFrame + implements EditorScenePanel.SceneModelListener { public EditorFrame (StageSceneWriter writer) { @@ -191,7 +194,7 @@ public class EditorFrame extends ManagedJFrame */ protected EditorScenePanel createScenePanel () { - return new EditorScenePanel(_ctx, this, _model); + return new EditorScenePanel(_ctx, this, _model, this); } /** @@ -307,6 +310,16 @@ public class EditorFrame extends ManagedJFrame } } + public void setMisoSceneModel (StageMisoSceneModel model) + { + AuxModel[] models = _scene.getSceneModel().auxModels; + for (int ii = 0; ii < models.length; ii++) { + if (models[ii] instanceof StageMisoSceneModel) { + models[ii] = model; + } + } + } + /** * Creates a blank scene and configures the editor to begin editing * it. Eventually this should make sure the user has a chance to save diff --git a/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java b/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java index 090833b0..db7fb8af 100644 --- a/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java +++ b/src/java/com/threerings/stage/tools/editor/EditorScenePanel.java @@ -89,13 +89,21 @@ import static com.threerings.stage.Log.log; public class EditorScenePanel extends StageScenePanel implements EditorModelListener, ChangeListener { + public interface SceneModelListener + { + public void setMisoSceneModel (StageMisoSceneModel sceneModel); + } + /** * Constructs the editor scene view panel. */ - public EditorScenePanel (EditorContext ctx, JFrame frame, EditorModel model) + public EditorScenePanel (EditorContext ctx, JFrame frame, EditorModel model, + SceneModelListener sceneListener) { super(ctx, new Controller() { }); + _sceneListener = sceneListener; + // keep these around for later _ctx = ctx; _frame = frame; @@ -1164,6 +1172,7 @@ public class EditorScenePanel extends StageScenePanel public void rollback () { if (_list.size() > 0) { _model = _list.removeFirst(); + _sceneListener.setMisoSceneModel((StageMisoSceneModel)_model); refreshScene(); } } @@ -1243,6 +1252,8 @@ public class EditorScenePanel extends StageScenePanel protected UndoStack _undo = new UndoStack(); protected UndoStack _redo = new UndoStack(); + protected SceneModelListener _sceneListener; + /** The triangle used to render a portal on-screen. */ protected static Polygon _locTri;