diff --git a/core/assets/planets/TODO.dat b/core/assets/planets/TODO.dat index 9f0778d116..ecc370bc49 100644 Binary files a/core/assets/planets/TODO.dat and b/core/assets/planets/TODO.dat differ diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index f5381d9ec7..a425bc45fd 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -251,8 +251,8 @@ public class Control implements ApplicationListener, Loadable{ ui.loadAnd(() -> { ui.planet.hide(); SaveSlot slot = sector.save; - //TODO remove for persistent sector slots - slot = null; + //TODO comment for new sector states + //slot = null; if(slot != null){ try{ net.reset(); diff --git a/core/src/mindustry/ui/dialogs/PlanetDialog.java b/core/src/mindustry/ui/dialogs/PlanetDialog.java index 69bd980c99..a817785539 100644 --- a/core/src/mindustry/ui/dialogs/PlanetDialog.java +++ b/core/src/mindustry/ui/dialogs/PlanetDialog.java @@ -162,12 +162,15 @@ public class PlanetDialog extends FloatingDialog{ bloom.render(); Gl.disable(Gl.cullFace); - //Gl.disable(Gl.depthTest); + Gl.disable(Gl.depthTest); - if(false && selected != null){ - Vec3 pos = cam.project(Tmp.v31.set(selected.tile.v).setLength(outlineRad)); + if(selected != null){ + addChild(stable); + Vec3 pos = cam.project(Tmp.v31.set(selected.tile.v).setLength(outlineRad).rotate(Vec3.Y, -planet.getRotation()).add(planet.position)); stable.setPosition(pos.x, pos.y, Align.center); - stable.draw(); + stable.toFront(); + }else{ + stable.remove(); } cam.update(); @@ -225,12 +228,6 @@ public class PlanetDialog extends FloatingDialog{ if(selected != null){ drawSelection(selected); drawBorders(selected, borderColor); - - //TODO use better input - if(Core.input.keyTap(KeyCode.SPACE)){ - control.playSector(selected); - ui.planet.hide(); - } } batch.flush(Gl.triangles); @@ -277,6 +274,7 @@ public class PlanetDialog extends FloatingDialog{ } private void updateSelected(){ + float x = stable.getX(Align.center), y = stable.getY(Align.center); stable.clear(); stable.background(Styles.black6); @@ -302,8 +300,17 @@ public class PlanetDialog extends FloatingDialog{ } }).fillX().row(); + stable.row(); + + stable.addButton("Launch", () -> { + if(selected != null){ + control.playSector(selected); + hide(); + } + }).size(120f, 50f).pad(2f); + stable.pack(); - stable.setPosition(0, 0, Align.center); + stable.setPosition(x, y, Align.center); } private void setPlane(Sector sector){ diff --git a/tests/src/test/java/ApplicationTests.java b/tests/src/test/java/ApplicationTests.java index 484e31625b..b7bfe1bf91 100644 --- a/tests/src/test/java/ApplicationTests.java +++ b/tests/src/test/java/ApplicationTests.java @@ -404,6 +404,8 @@ public class ApplicationTests{ //infinite build range state.rules.editor = true; + state.rules.infiniteResources = true; + state.rules.buildSpeedMultiplier = 999999f; d1.set(0f, 0f); d2.set(20f, 20f); @@ -411,7 +413,6 @@ public class ApplicationTests{ d1.addBuild(new BuildRequest(0, 0, 0, Blocks.copperWallLarge)); d2.addBuild(new BuildRequest(1, 1, 0, Blocks.copperWallLarge)); - Time.setDeltaProvider(() -> 9999999f); d1.update(); d2.update(); diff --git a/tools/src/mindustry/tools/SectorDataGenerator.java b/tools/src/mindustry/tools/SectorDataGenerator.java index ec1688f32f..77c0134e3e 100644 --- a/tools/src/mindustry/tools/SectorDataGenerator.java +++ b/tools/src/mindustry/tools/SectorDataGenerator.java @@ -39,6 +39,7 @@ public class SectorDataGenerator{ for(Planet planet : content.getBy(ContentType.planet)){ int[] count = {0}; + if(planet.grid == null) continue; Fi fi = Fi.get("planets").child(planet.name + ".dat");