Fix archive local storage bug

This commit is contained in:
Anuken
2017-12-20 20:56:59 -05:00
parent a8b6ebacca
commit ac7deb77b6
4 changed files with 14 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ public class Control extends Module{
if(Mindustry.args.contains("-debug", false))
Vars.debug = true;
UCore.log("Total blocks loaded: " + Block.getAllBlocks().size);
log("Total blocks loaded: " + Block.getAllBlocks().size);
for(Block block : Block.getAllBlocks()){
block.postInit();

View File

@@ -8,6 +8,7 @@ import java.io.IOException;
import java.util.Arrays;
import java.util.Date;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.files.FileHandle;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.ObjectMap;
@@ -314,7 +315,7 @@ public class SaveIO{
/*long loadTime = */stream.readLong();
if(version != fileVersionID){
//TODO throw an exception?
throw new RuntimeException("Save file version mismatch!");
}
//general state

View File

@@ -23,6 +23,7 @@ import io.anuke.ucore.util.Tmp;
public class MapView extends Element implements GestureListener{
private MapEditor editor;
private EditorTool tool = EditorTool.pencil;
private OperationStack stack = new OperationStack();
private Bresenham2 br = new Bresenham2();
private float offsetx, offsety;
private float zoom = 1f;
@@ -30,7 +31,11 @@ public class MapView extends Element implements GestureListener{
public void setTool(EditorTool tool){
this.tool = tool;
}
public void clearStack(){
stack.clear();
}
public MapView(MapEditor editor){
this.editor = editor;

View File

@@ -1,5 +1,6 @@
package io.anuke.mindustry.ui;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.utils.reflect.ClassReflection;
import io.anuke.mindustry.Vars;
@@ -41,6 +42,10 @@ public class SaveDialog extends LoadDialog{
Timers.runTask(5f, () -> {
hide();
Vars.ui.hideLoading();
if(Gdx.files.getLocalStoragePath().equals("C:\\Windows\\System32")){
Vars.ui.showError("[orange]Invalid local storage directory![]\nAre you running the game from inside a zip file?");
return;
}
try{
SaveIO.saveToSlot(slot);
}catch(Throwable e){