Fixes to tutorial and typos
This commit is contained in:
@@ -278,8 +278,6 @@ public class NetServer extends Module{
|
||||
for(EntityGroup<?> group : Entities.getAllGroups()) {
|
||||
if(group.amount() == 0 || !(group.all().first() instanceof SyncEntity)) continue;
|
||||
|
||||
UCore.log("Writing group " + group.getType(), "amount: " + group.amount());
|
||||
|
||||
//get write size for one entity (adding 4, as you need to write the ID as well)
|
||||
int writesize = SyncEntity.getWriteSize((Class<? extends SyncEntity>)group.getType()) + 4;
|
||||
//amount of entities
|
||||
@@ -308,7 +306,6 @@ public class NetServer extends Module{
|
||||
}
|
||||
|
||||
SyncEntity entity = (SyncEntity) group.all().get(i);
|
||||
UCore.log("Writing entity: " + entity.id);
|
||||
|
||||
//write ID to the buffer
|
||||
current.putInt(entity.id);
|
||||
|
||||
@@ -31,7 +31,7 @@ public class Tutorial{
|
||||
}
|
||||
|
||||
public boolean active(){
|
||||
return world.getMap().name.equals("tutorial") && !GameState.is(State.menu);
|
||||
return world.getMap() != null && world.getMap().name.equals("tutorial") && !GameState.is(State.menu);
|
||||
}
|
||||
|
||||
public void buildUI(table table){
|
||||
|
||||
@@ -6,14 +6,14 @@ import com.badlogic.gdx.utils.TimeUtils;
|
||||
import io.anuke.mindustry.Vars;
|
||||
import io.anuke.mindustry.entities.enemies.Enemy;
|
||||
import io.anuke.mindustry.entities.enemies.EnemyType;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
import io.anuke.mindustry.io.SaveFileVersion;
|
||||
import io.anuke.mindustry.resource.Item;
|
||||
import io.anuke.mindustry.resource.Upgrade;
|
||||
import io.anuke.mindustry.resource.Weapon;
|
||||
import io.anuke.mindustry.world.Block;
|
||||
import io.anuke.mindustry.game.GameMode;
|
||||
import io.anuke.mindustry.world.WorldGenerator;
|
||||
import io.anuke.mindustry.world.Tile;
|
||||
import io.anuke.mindustry.world.WorldGenerator;
|
||||
import io.anuke.mindustry.world.blocks.Blocks;
|
||||
import io.anuke.mindustry.world.blocks.types.BlockPart;
|
||||
import io.anuke.mindustry.world.blocks.types.Rock;
|
||||
@@ -165,6 +165,7 @@ public class Save14 extends SaveFileVersion{
|
||||
for(int i = 0; i < rocks; i ++){
|
||||
int pos = stream.readInt();
|
||||
Tile tile = Vars.world.tile(pos % Vars.world.width(), pos / Vars.world.width());
|
||||
if(tile == null) continue;
|
||||
Block result = WorldGenerator.rocks.get(tile.floor());
|
||||
if(result != null) tile.setBlock(result);
|
||||
}
|
||||
|
||||
@@ -68,9 +68,8 @@ public class PausedDialog extends FloatingDialog{
|
||||
content().addButton("$text.quit", () -> {
|
||||
ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
|
||||
if(Net.active() && Net.client()) Vars.netClient.disconnectQuietly();
|
||||
runSave();
|
||||
runExitSave();
|
||||
hide();
|
||||
GameState.set(State.menu);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -111,9 +110,8 @@ public class PausedDialog extends FloatingDialog{
|
||||
new imagebutton("icon-quit", isize, () -> {
|
||||
Vars.ui.showConfirm("$text.confirm", "$text.quit.confirm", () -> {
|
||||
if(Net.active() && Net.client()) Vars.netClient.disconnectQuietly();
|
||||
runSave();
|
||||
runExitSave();
|
||||
hide();
|
||||
GameState.set(State.menu);
|
||||
});
|
||||
}).text("Quit").padTop(4f);
|
||||
|
||||
@@ -127,9 +125,13 @@ public class PausedDialog extends FloatingDialog{
|
||||
}
|
||||
}
|
||||
|
||||
private void runSave(){
|
||||
private void runExitSave(){
|
||||
if(Vars.control.getSaves().getCurrent() == null ||
|
||||
!Vars.control.getSaves().getCurrent().isAutosave()) return;
|
||||
!Vars.control.getSaves().getCurrent().isAutosave()){
|
||||
GameState.set(State.menu);
|
||||
Vars.control.getTutorial().reset();
|
||||
return;
|
||||
}
|
||||
|
||||
Vars.ui.loadfrag.show("$text.saveload");
|
||||
|
||||
@@ -141,6 +143,7 @@ public class PausedDialog extends FloatingDialog{
|
||||
e = (e.getCause() == null ? e : e.getCause());
|
||||
Vars.ui.showError("[orange]"+ Bundles.get("text.savefail")+"\n[white]" + ClassReflection.getSimpleName(e.getClass()) + ": " + e.getMessage() + "\n" + "at " + e.getStackTrace()[0].getFileName() + ":" + e.getStackTrace()[0].getLineNumber());
|
||||
}
|
||||
GameState.set(State.menu);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,8 +25,8 @@ public class Smelter extends Block{
|
||||
protected Item fuel;
|
||||
protected Item result;
|
||||
|
||||
protected float craftTime = 15f; //time to craft one item, so max 4 items per second by default
|
||||
protected float burnDuration = 45f; //by default, the fuel will burn 45 frames, so that's 4 items/fuel at most
|
||||
protected float craftTime = 20f; //time to craft one item, so max 3 items per second by default
|
||||
protected float burnDuration = 50f; //by default, the fuel will burn 45 frames, so that's 2.5 items/fuel at most
|
||||
protected Effect craftEffect = Fx.smelt, burnEffect = Fx.fuelburn;
|
||||
|
||||
protected int capacity = 20;
|
||||
|
||||
Reference in New Issue
Block a user