mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-01-19 08:47:29 +07:00
Functional play button
This commit is contained in:
parent
153e6c5f1b
commit
0a6f7ac817
@ -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(){
|
||||
|
@ -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);
|
||||
|
@ -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();
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user