more iOS mess-fixing

This commit is contained in:
Anuken
2019-08-15 22:44:37 -04:00
parent 6f2fc00045
commit a12af852ab
7 changed files with 64 additions and 60 deletions

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.io;
import io.anuke.arc.collection.*;
import io.anuke.mindustry.game.Rules;
import io.anuke.mindustry.maps.Map;
@@ -13,8 +14,9 @@ public class SaveMeta{
public Map map;
public int wave;
public Rules rules;
public StringMap tags;
public SaveMeta(int version, long timestamp, long timePlayed, int build, String map, int wave, Rules rules){
public SaveMeta(int version, long timestamp, long timePlayed, int build, String map, int wave, Rules rules, StringMap tags){
this.version = version;
this.build = build;
this.timestamp = timestamp;
@@ -22,5 +24,6 @@ public class SaveMeta{
this.map = world.maps.all().find(m -> m.name().equals(map));
this.wave = wave;
this.rules = rules;
this.tags = tags;
}
}

View File

@@ -28,7 +28,7 @@ public abstract class SaveVersion extends SaveFileReader{
public SaveMeta getMeta(DataInput stream) throws IOException{
stream.readInt(); //length of data, doesn't matter here
StringMap map = readStringMap(stream);
return new SaveMeta(map.getInt("version"), map.getLong("saved"), map.getLong("playtime"), map.getInt("build"), map.get("mapname"), map.getInt("wave"), JsonIO.read(Rules.class, map.get("rules", "{}")));
return new SaveMeta(map.getInt("version"), map.getLong("saved"), map.getLong("playtime"), map.getInt("build"), map.get("mapname"), map.getInt("wave"), JsonIO.read(Rules.class, map.get("rules", "{}")), map);
}
@Override

View File

@@ -109,8 +109,9 @@ public class MenuFragment extends Fragment{
container.add(play);
container.add(join);
container.add(custom);
if(ios) container.row();
container.add(maps);
container.row();
if(!ios) container.row();
container.table(table -> {
table.defaults().set(container.defaults());
@@ -119,7 +120,7 @@ public class MenuFragment extends Fragment{
table.add(tools);
if(Platform.instance.canDonate()) table.add(donate);
table.add(exit);
if(!ios) table.add(exit);
}).colspan(4);
}else{
container.marginTop(0f);