diff --git a/core/src/io/anuke/mindustry/editor/MapView.java b/core/src/io/anuke/mindustry/editor/MapView.java index fa250bc3f4..d89fb3c248 100644 --- a/core/src/io/anuke/mindustry/editor/MapView.java +++ b/core/src/io/anuke/mindustry/editor/MapView.java @@ -223,7 +223,7 @@ public class MapView extends Element implements GestureListener{ } private void clampZoom(){ - zoom = Mathf.clamp(zoom, 0.2f, 12f); + zoom = Mathf.clamp(zoom, 0.2f, 20f); } private Point2 project(float x, float y){ @@ -273,6 +273,10 @@ public class MapView extends Element implements GestureListener{ editor.renderer().draw(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight); Draw.reset(); + if(!ScissorStack.pushScissors(rect.set(x, y, width, height))){ + return; + } + if(grid){ Draw.color(Color.GRAY); image.setBounds(centerx - sclwidth / 2, centery - sclheight / 2, sclwidth, sclheight); @@ -326,6 +330,7 @@ public class MapView extends Element implements GestureListener{ Draw.reset(); ScissorStack.popScissors(); + ScissorStack.popScissors(); } private boolean active(){ diff --git a/core/src/io/anuke/mindustry/io/SaveFileVersion.java b/core/src/io/anuke/mindustry/io/SaveFileVersion.java index 59bb6fdf73..6d2c42baec 100644 --- a/core/src/io/anuke/mindustry/io/SaveFileVersion.java +++ b/core/src/io/anuke/mindustry/io/SaveFileVersion.java @@ -13,7 +13,6 @@ import io.anuke.mindustry.game.Content; import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.MappableContent; import io.anuke.mindustry.game.Team; -import io.anuke.mindustry.maps.Map; import io.anuke.mindustry.type.ContentType; import io.anuke.mindustry.world.Tile; import io.anuke.mindustry.world.blocks.BlockPart; @@ -92,7 +91,6 @@ public abstract class SaveFileVersion{ short width = stream.readShort(); short height = stream.readShort(); - world.setMap(new Map("unknown", width, height)); world.beginMapLoad(); Tile[][] tiles = world.createTiles(width, height); diff --git a/core/src/io/anuke/mindustry/io/versions/Save16.java b/core/src/io/anuke/mindustry/io/versions/Save16.java index bdff215bb9..67b4bff21e 100644 --- a/core/src/io/anuke/mindustry/io/versions/Save16.java +++ b/core/src/io/anuke/mindustry/io/versions/Save16.java @@ -29,6 +29,7 @@ public class Save16 extends SaveFileVersion{ byte mode = stream.readByte(); String mapname = stream.readUTF(); Map map = world.maps.getByName(mapname); + if(map == null) map = new Map("unknown", 1, 1); world.setMap(map); int wave = stream.readInt(); diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index b779011188..b613ede8fc 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -146,9 +146,9 @@ public class MenuFragment extends Fragment{ dialog.addCloseButton(); dialog.content().defaults().height(66f).width(w).padRight(5f); - dialog.content().add(new MenuButton("icon-play-2", "$text.sectors", () -> { + dialog.content().add(new MenuButton("icon-play-2", "$text.map.random", () -> { dialog.hide(); - ui.showInfo("aaaaaaaaaAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAa"); + world.generator.playRandomMap(); })).width(bw).colspan(2); dialog.content().row();