Fix archive local storage bug
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user