use of com.bladecoder.engineeditor.undo.UndoDeleteAnimation in project bladecoder-adventure-engine by bladecoder.
the class SpriteList method delete.
@Override
protected void delete() {
AnimationDesc d = removeSelected();
AnimationRenderer renderer = (AnimationRenderer) parent.getRenderer();
renderer.getAnimations().remove(d.id);
// UNDO
Ctx.project.getUndoStack().add(new UndoDeleteAnimation(parent, d));
// init_animation
if (renderer.getInitAnimation().equals(d.id)) {
HashMap<String, AnimationDesc> animations = renderer.getAnimations();
String newValue = null;
if (animations.size() > 0)
newValue = animations.keySet().iterator().next();
renderer.setInitAnimation(newValue);
Ctx.project.setModified(this, "init_animation", d.id, newValue);
}
Ctx.project.setModified();
}
Aggregations