Fortress builtin map / Attributes / Efficiency stat / Bugfixes
This commit is contained in:
@@ -4,6 +4,7 @@ import io.anuke.arc.Core;
|
||||
import io.anuke.arc.collection.ObjectMap;
|
||||
import io.anuke.arc.files.FileHandle;
|
||||
import io.anuke.arc.graphics.Texture;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.io.MapIO;
|
||||
|
||||
public class Map{
|
||||
@@ -44,6 +45,15 @@ public class Map{
|
||||
return file.nameWithoutExtension();
|
||||
}
|
||||
|
||||
public int getHightScore(){
|
||||
return Core.settings.getInt("hiscore" + fileName(), 0);
|
||||
}
|
||||
|
||||
public void setHighScore(int score){
|
||||
Core.settings.put("hiscore" + fileName(), score);
|
||||
Vars.data.modified();
|
||||
}
|
||||
|
||||
public String getDisplayName(){
|
||||
return tags.get("name", fileName());
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import static io.anuke.mindustry.Vars.*;
|
||||
|
||||
public class Maps implements Disposable{
|
||||
/** List of all built-in maps. */
|
||||
private static final String[] defaultMapNames = {"impact0079"};
|
||||
private static final String[] defaultMapNames = {"Fortress"};
|
||||
/** All maps stored in an ordered array. */
|
||||
private Array<Map> maps = new Array<>();
|
||||
|
||||
@@ -107,7 +107,7 @@ public class Maps implements Disposable{
|
||||
|
||||
/** Import a map, then save it. This updates all values and stored data necessary. */
|
||||
public void importMap(FileHandle file, Map map) throws IOException{
|
||||
file.copyTo(customMapDirectory.child(file.name()));
|
||||
file.copyTo(customMapDirectory.child(map.name() + ".mmap"));
|
||||
if(!headless){
|
||||
map.texture = new Texture(MapIO.generatePreview(map));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user