diff --git a/core/src/io/anuke/mindustry/editor/DrawOperation.java b/core/src/io/anuke/mindustry/editor/DrawOperation.java index 49765644b5..bfa6b25673 100755 --- a/core/src/io/anuke/mindustry/editor/DrawOperation.java +++ b/core/src/io/anuke/mindustry/editor/DrawOperation.java @@ -30,6 +30,11 @@ public class DrawOperation{ class TileOpStruct{ short x; short y; + /** + * 0: floor + * 1: block + * 2: rotation + */ byte type; byte from; byte to; diff --git a/core/src/io/anuke/mindustry/editor/MapEditor.java b/core/src/io/anuke/mindustry/editor/MapEditor.java index afa19d6f0e..9a2b2d427b 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditor.java +++ b/core/src/io/anuke/mindustry/editor/MapEditor.java @@ -235,6 +235,12 @@ public class MapEditor{ renderer.resize(width, height); } + public void changeFloor(int x, int y, Block to){ + Block from = tiles[x][y].floor(); + tiles[x][y].setFloor((Floor)to); + addTileOp(TileOp.get((short)x, (short)y, (byte)0, from.id, to.id)); + } + public void undo(){ if(stack.canUndo()){ stack.undo(this);