Fixed #50 (somehow?), as well as GWT runtime errors

This commit is contained in:
Anuken 2018-01-16 12:36:22 -05:00
parent f736699049
commit c2a10193c6
6 changed files with 21 additions and 14 deletions

View File

@ -21,7 +21,7 @@ allprojects {
appName = "Mindustry"
gdxVersion = '1.9.8'
aiVersion = '1.8.1'
uCoreVersion = '7a567c6';
uCoreVersion = '49d8aecf9c';
}
repositories {

View File

@ -1,8 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit trunk//EN" "https://raw.githubusercontent.com/gwtproject/gwt/master/distro-source/core/src/gwt-module.dtd">
<module>
<source path="io/anuke/mindustry" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.world.Tile" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.io.Maps" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.world.Map" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.game.EnemySpawn" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.io.SaveFileVersion" />
<extend-configuration-property name="gdx.reflect.include" value="io.anuke.mindustry.resource.Recipe" />
</module>

View File

@ -58,7 +58,7 @@ public class Control extends Module{
public final EntityGroup<Bullet> bulletGroup = Entities.addGroup(Bullet.class);
public final EntityGroup<Shield> shieldGroup = Entities.addGroup(Shield.class);
Array<io.anuke.mindustry.game.EnemySpawn> spawns;
Array<EnemySpawn> spawns;
int wave = 1;
int lastUpdated = -1;
float wavetime;
@ -67,7 +67,7 @@ public class Control extends Module{
GameMode mode = GameMode.waves;
Tile core;
Array<io.anuke.mindustry.game.SpawnPoint> spawnpoints = new Array<>();
Array<SpawnPoint> spawnpoints = new Array<>();
boolean shouldUpdateItems = false;
boolean wasPaused = false;
@ -191,7 +191,7 @@ public class Control extends Module{
);
for(int i = 0; i < Vars.saveSlots; i ++){
Settings.defaults("save-" + i + "-autosave", true);
Settings.defaults("save-" + i + "-autosave", !Vars.gwt);
Settings.defaults("save-" + i + "-name", "untitled");
Settings.defaults("save-" + i + "-data", "empty");
}
@ -199,7 +199,7 @@ public class Control extends Module{
Settings.defaultList(
"ip", "localhost",
"port", Vars.port+"",
"name", Vars.android ? "player" : UCore.getProperty("user.name"),
"name", Vars.android || Vars.gwt ? "player" : UCore.getProperty("user.name"),
"servers", ""
);

View File

@ -38,7 +38,8 @@ public class Save14 extends SaveFileVersion{
public void read(DataInputStream stream) throws IOException {
int version = stream.readInt();
/*long loadTime = */stream.readLong();
/*long loadTime = */
stream.readLong();
if(version != this.version){
throw new RuntimeException("Save file version mismatch!");

View File

@ -142,6 +142,8 @@ public class LoadDialog extends FloatingDialog{
slots.row();
if(Vars.gwt) return;
slots.addImageTextButton("$text.save.import", "icon-add", "clear", 14*3, () -> {
new FileChooser("$text.save.import", f -> f.extension().equals("mins"), true, file -> {
if(SaveIO.isSaveValid(file)){

View File

@ -55,13 +55,15 @@ public class PausedDialog extends FloatingDialog{
content().row();
content().addButton("$text.hostserver", () ->{
if(Vars.world.getMap().custom){
ui.showError("$text.nohost");
}else {
ui.host.show();
}
}).disabled(b -> Net.active());
if(!Vars.gwt) {
content().addButton("$text.hostserver", () -> {
if (Vars.world.getMap().custom) {
ui.showError("$text.nohost");
} else {
ui.host.show();
}
}).disabled(b -> Net.active());
}
content().row();