Disabled mobile debug / Added no-core error message
This commit is contained in:
@@ -168,6 +168,7 @@ text.custom=Custom
|
|||||||
text.builtin=Built-In
|
text.builtin=Built-In
|
||||||
text.map.delete.confirm=Are you sure you want to delete this map? This action cannot be undone!
|
text.map.delete.confirm=Are you sure you want to delete this map? This action cannot be undone!
|
||||||
text.map.random=[accent]Random Map
|
text.map.random=[accent]Random Map
|
||||||
|
text.map.nospawn=This map does not have any cores for the player to spawn in! Add a [ROYAL]blue[] core to this map in the editor.
|
||||||
text.editor.slope=\\
|
text.editor.slope=\\
|
||||||
text.editor.openin=Open In Editor
|
text.editor.openin=Open In Editor
|
||||||
text.editor.oregen=Ore Generation
|
text.editor.oregen=Ore Generation
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ import io.anuke.ucore.util.OS;
|
|||||||
import java.util.Locale;
|
import java.util.Locale;
|
||||||
|
|
||||||
public class Vars{
|
public class Vars{
|
||||||
public static final boolean testMobile = true;
|
public static final boolean testMobile = false;
|
||||||
//shorthand for whether or not this is running on android or ios
|
//shorthand for whether or not this is running on android or ios
|
||||||
public static boolean mobile;
|
public static boolean mobile;
|
||||||
public static boolean ios;
|
public static boolean ios;
|
||||||
|
|||||||
@@ -126,7 +126,9 @@ public class Logic extends Module {
|
|||||||
Timers.update();
|
Timers.update();
|
||||||
}
|
}
|
||||||
|
|
||||||
checkGameOver();
|
if(!world.isInvalidMap()){
|
||||||
|
checkGameOver();
|
||||||
|
}
|
||||||
|
|
||||||
if(!state.is(State.paused) || Net.active()){
|
if(!state.is(State.paused) || Net.active()){
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ import com.badlogic.gdx.utils.ObjectMap;
|
|||||||
import io.anuke.mindustry.ai.BlockIndexer;
|
import io.anuke.mindustry.ai.BlockIndexer;
|
||||||
import io.anuke.mindustry.ai.Pathfinder;
|
import io.anuke.mindustry.ai.Pathfinder;
|
||||||
import io.anuke.mindustry.content.blocks.Blocks;
|
import io.anuke.mindustry.content.blocks.Blocks;
|
||||||
|
import io.anuke.mindustry.core.GameState.State;
|
||||||
import io.anuke.mindustry.game.EventType.TileChangeEvent;
|
import io.anuke.mindustry.game.EventType.TileChangeEvent;
|
||||||
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
import io.anuke.mindustry.game.EventType.WorldLoadEvent;
|
||||||
import io.anuke.mindustry.io.*;
|
import io.anuke.mindustry.io.*;
|
||||||
@@ -34,7 +35,7 @@ public class World extends Module{
|
|||||||
private Maps maps = new Maps();
|
private Maps maps = new Maps();
|
||||||
|
|
||||||
private Array<Tile> tempTiles = new ThreadArray<>();
|
private Array<Tile> tempTiles = new ThreadArray<>();
|
||||||
private boolean generating;
|
private boolean generating, invalidMap;
|
||||||
|
|
||||||
public World(){
|
public World(){
|
||||||
maps.load();
|
maps.load();
|
||||||
@@ -56,7 +57,11 @@ public class World extends Module{
|
|||||||
public Pathfinder pathfinder(){
|
public Pathfinder pathfinder(){
|
||||||
return pathfinder;
|
return pathfinder;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isInvalidMap() {
|
||||||
|
return invalidMap;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean solid(int x, int y){
|
public boolean solid(int x, int y){
|
||||||
Tile tile = tile(x, y);
|
Tile tile = tile(x, y);
|
||||||
|
|
||||||
@@ -216,6 +221,14 @@ public class World extends Module{
|
|||||||
|
|
||||||
WorldGenerator.loadTileData(tiles, MapIO.readTileData(map, true), map.meta.hasOreGen(), seed);
|
WorldGenerator.loadTileData(tiles, MapIO.readTileData(map, true), map.meta.hasOreGen(), seed);
|
||||||
|
|
||||||
|
if(!headless && state.teams.get(players[0].getTeam()).cores.size == 0){
|
||||||
|
ui.showError("$text.map.nospawn");
|
||||||
|
threads.runDelay(() -> state.set(State.menu));
|
||||||
|
invalidMap = true;
|
||||||
|
}else{
|
||||||
|
invalidMap = false;
|
||||||
|
}
|
||||||
|
|
||||||
endMapLoad();
|
endMapLoad();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ public class MenuFragment implements Fragment{
|
|||||||
|
|
||||||
FloatingDialog dialog = new FloatingDialog("$text.play");
|
FloatingDialog dialog = new FloatingDialog("$text.play");
|
||||||
dialog.addCloseButton();
|
dialog.addCloseButton();
|
||||||
dialog.content().defaults().height(70f).width(w).padRight(5f);
|
dialog.content().defaults().height(66f).width(w).padRight(5f);
|
||||||
|
|
||||||
dialog.content().add(new MenuButton("icon-play-2", "$text.newgame", () -> {
|
dialog.content().add(new MenuButton("icon-play-2", "$text.newgame", () -> {
|
||||||
dialog.hide();
|
dialog.hide();
|
||||||
|
|||||||
Reference in New Issue
Block a user