Made save format actually functional, many things still broken
This commit is contained in:
@@ -1,15 +1,10 @@
|
||||
package io.anuke.mindustry.maps;
|
||||
|
||||
import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.*;
|
||||
import io.anuke.arc.collection.StringMap;
|
||||
import io.anuke.arc.files.FileHandle;
|
||||
import io.anuke.arc.graphics.Texture;
|
||||
import io.anuke.arc.util.Log;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.game.DefaultWaves;
|
||||
import io.anuke.mindustry.game.SpawnGroup;
|
||||
|
||||
import static io.anuke.mindustry.Vars.world;
|
||||
|
||||
public class Map implements Comparable<Map>{
|
||||
/** Whether this is a custom map. */
|
||||
@@ -49,20 +44,6 @@ public class Map implements Comparable<Map>{
|
||||
this(Vars.customMapDirectory.child(tags.get("name", "unknown")), 0, 0, tags, true);
|
||||
}
|
||||
|
||||
public Array<SpawnGroup> getWaves(){
|
||||
if(tags.containsKey("waves")){
|
||||
try{
|
||||
return world.maps.readWaves(tags.get("waves"));
|
||||
}catch(Exception e){
|
||||
Log.err("Malformed waves: {0}", tags.get("waves"));
|
||||
e.printStackTrace();
|
||||
return DefaultWaves.get();
|
||||
}
|
||||
}else{
|
||||
return DefaultWaves.get();
|
||||
}
|
||||
}
|
||||
|
||||
public int getHightScore(){
|
||||
return Core.settings.getInt("hiscore" + file.nameWithoutExtension(), 0);
|
||||
}
|
||||
|
||||
@@ -8,8 +8,7 @@ import io.anuke.arc.util.Disposable;
|
||||
import io.anuke.arc.util.Log;
|
||||
import io.anuke.arc.util.serialization.Json;
|
||||
import io.anuke.mindustry.game.SpawnGroup;
|
||||
import io.anuke.mindustry.io.LegacyMapIO;
|
||||
import io.anuke.mindustry.io.MapIO;
|
||||
import io.anuke.mindustry.io.*;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.StringWriter;
|
||||
@@ -61,6 +60,7 @@ public class Maps implements Disposable{
|
||||
public void load(){
|
||||
try{
|
||||
//TODO remove, this is only for testing
|
||||
|
||||
for(FileHandle in : Core.files.absolute("/home/anuke/Projects/Mindustry/core/assets/maps").list()){
|
||||
if(in.extension().equalsIgnoreCase(oldMapExtension)){
|
||||
Log.info("Converting {0}...", in);
|
||||
|
||||
@@ -60,10 +60,9 @@ public class MapGenerator extends Generator{
|
||||
@Override
|
||||
public void init(Loadout loadout){
|
||||
this.loadout = loadout;
|
||||
//TODO uncomment once conversion works
|
||||
//map = world.maps.loadInternalMap(mapName);
|
||||
//width = map.width;
|
||||
//height = map.height;
|
||||
map = world.maps.loadInternalMap(mapName);
|
||||
width = map.width;
|
||||
height = map.height;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user