Search in sources :

Example 1 with UndoWalkzonePointPos

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

the class ScnWidgetInputListener method touchUp.

@Override
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
    super.touchUp(event, x, y, pointer, button);
    if (draggingMode == DraggingModes.DRAGGING_ACTOR) {
        Ctx.project.getUndoStack().add(new UndoPosition(selActor, new Vector2(undoOrg)));
    } else if (draggingMode == DraggingModes.DRAGGING_REFPOINT) {
        Ctx.project.getUndoStack().add(new UndoRefPosition((InteractiveActor) selActor, new Vector2(undoOrg)));
    } else if (draggingMode == DraggingModes.DRAGGING_WALKZONE_POINT) {
        Polygon poly = scnWidget.getScene().getPolygonalNavGraph().getWalkZone();
        Ctx.project.getUndoStack().add(new UndoWalkzonePointPos(poly, vertIndex, new Vector2(undoOrg)));
    } else if (draggingMode == DraggingModes.DRAGGING_BBOX_POINT) {
        Ctx.project.getUndoStack().add(new UndoBboxPointPos(selActor, vertIndex, new Vector2(undoOrg)));
    } else if (draggingMode == DraggingModes.DRAGGING_MARKER_0 || draggingMode == DraggingModes.DRAGGING_MARKER_100) {
        Ctx.project.getUndoStack().add(new UndoDepthVector(scnWidget.getScene(), new Vector2(undoOrg)));
    } else if (draggingMode == DraggingModes.DRAGGING_WALKZONE) {
        Ctx.project.getUndoStack().add(new UndoWalkZonePosition(scnWidget.getScene().getPolygonalNavGraph().getWalkZone(), new Vector2(undoOrg)));
    }
    draggingMode = DraggingModes.NONE;
    return;
}
Also used : UndoRefPosition(com.bladecoder.engineeditor.undo.UndoRefPosition) UndoBboxPointPos(com.bladecoder.engineeditor.undo.UndoBboxPointPos) Vector2(com.badlogic.gdx.math.Vector2) UndoPosition(com.bladecoder.engineeditor.undo.UndoPosition) UndoDepthVector(com.bladecoder.engineeditor.undo.UndoDepthVector) UndoWalkZonePosition(com.bladecoder.engineeditor.undo.UndoWalkZonePosition) Polygon(com.badlogic.gdx.math.Polygon) UndoWalkzonePointPos(com.bladecoder.engineeditor.undo.UndoWalkzonePointPos)

Aggregations

Polygon (com.badlogic.gdx.math.Polygon)1 Vector2 (com.badlogic.gdx.math.Vector2)1 UndoBboxPointPos (com.bladecoder.engineeditor.undo.UndoBboxPointPos)1 UndoDepthVector (com.bladecoder.engineeditor.undo.UndoDepthVector)1 UndoPosition (com.bladecoder.engineeditor.undo.UndoPosition)1 UndoRefPosition (com.bladecoder.engineeditor.undo.UndoRefPosition)1 UndoWalkZonePosition (com.bladecoder.engineeditor.undo.UndoWalkZonePosition)1 UndoWalkzonePointPos (com.bladecoder.engineeditor.undo.UndoWalkzonePointPos)1