Search in sources :

Example 1 with UndoDeleteScene

use of com.bladecoder.engineeditor.undo.UndoDeleteScene in project bladecoder-adventure-engine by bladecoder.

the class SceneList method delete.

@Override
protected void delete() {
    Scene s = removeSelected();
    parent.getScenes().remove(s.getId());
    // init_scene
    if (parent.getInitScene() != null && parent.getInitScene().equals(s.getId())) {
        if (parent.getScenes().size() > 0)
            parent.setInitScene(parent.getScenes().values().iterator().next().getId());
        else
            parent.setInitScene(null);
    }
    // TRANSLATIONS
    Ctx.project.getI18N().putTranslationsInElement(s);
    // UNDO
    UndoOp undoOp = new UndoDeleteScene(s);
    Ctx.project.getUndoStack().add(undoOp);
    Ctx.project.setModified();
}
Also used : UndoDeleteScene(com.bladecoder.engineeditor.undo.UndoDeleteScene) Scene(com.bladecoder.engine.model.Scene) UndoDeleteScene(com.bladecoder.engineeditor.undo.UndoDeleteScene) UndoOp(com.bladecoder.engineeditor.undo.UndoOp)

Aggregations

Scene (com.bladecoder.engine.model.Scene)1 UndoDeleteScene (com.bladecoder.engineeditor.undo.UndoDeleteScene)1 UndoOp (com.bladecoder.engineeditor.undo.UndoOp)1