Unfinished generation tool
This commit is contained in:
@@ -13,7 +13,7 @@ import io.anuke.mindustry.io.MapIO;
|
||||
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class Map{
|
||||
public class Map implements Comparable<Map>{
|
||||
/** Whether this is a custom map.*/
|
||||
public final boolean custom;
|
||||
/** Metadata. Author description, display name, etc.*/
|
||||
@@ -54,10 +54,10 @@ public class Map{
|
||||
}catch(Exception e){
|
||||
Log.err("Malformed waves: {0}", tags.get("waves"));
|
||||
e.printStackTrace();
|
||||
return DefaultWaves.getDefaultSpawns();
|
||||
return DefaultWaves.get();
|
||||
}
|
||||
}else{
|
||||
return DefaultWaves.getDefaultSpawns();
|
||||
return DefaultWaves.get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -90,6 +90,16 @@ public class Map{
|
||||
return tags.containsKey(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Map map){
|
||||
int type = -Boolean.compare(custom, map.custom);
|
||||
if(type != 0){
|
||||
return type;
|
||||
}else{
|
||||
return name().compareTo(map.name());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString(){
|
||||
return "Map{" +
|
||||
|
||||
@@ -113,6 +113,7 @@ public class Maps implements Disposable{
|
||||
map.texture = new Texture(MapIO.generatePreview(data));
|
||||
}
|
||||
maps.add(map);
|
||||
maps.sort();
|
||||
}catch(IOException e){
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
@@ -181,6 +182,7 @@ public class Maps implements Disposable{
|
||||
}
|
||||
|
||||
maps.add(map);
|
||||
maps.sort();
|
||||
}
|
||||
|
||||
private void loadCustomMaps(){
|
||||
|
||||
Reference in New Issue
Block a user