From c9a8d10898d396a6258448f351bf581dbabfda09 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 15 Jan 2018 18:43:19 -0500 Subject: [PATCH] Fixes to tutorial and typos --- core/assets/bundles/bundle.properties | 10 +++++----- core/src/io/anuke/mindustry/core/NetServer.java | 3 --- core/src/io/anuke/mindustry/core/Tutorial.java | 2 +- .../io/anuke/mindustry/io/versions/Save14.java | 5 +++-- .../anuke/mindustry/ui/dialogs/PausedDialog.java | 15 +++++++++------ .../world/blocks/types/production/Smelter.java | 4 ++-- 6 files changed, 20 insertions(+), 19 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 4f966cd779..43abd9ee43 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -181,7 +181,7 @@ text.blocks.maxpowertransfersecond=Max power transfer/second text.blocks.explosive=Highly explosive! text.blocks.repairssecond=Repairs/second text.blocks.health=Health -text.blocks.inaccuracy=Health +text.blocks.inaccuracy=Inaccuracy text.blocks.shots=Shots text.blocks.shotssecond=Shots/second text.blocks.fuel=Fuel @@ -248,11 +248,11 @@ tutorial.deleteBlock.text=You can delete blocks by clicking the [orange]right m tutorial.deleteBlockAndroid.text=You can delete blocks by [orange]selecting the crosshair[] in the [orange]break mode menu[] in the bottom left and tapping a block. Try deleting this conveyor. tutorial.placeTurret.text=Now, select and place a [yellow]turret[] at the [yellow]marked location[]. tutorial.placedTurretAmmo.text=This turret will now accept [yellow]ammo[] from the conveyor. You can see how much ammo it has by hovering over it and checking the [green]green bar[]. -tutorial.turretExplanation.text=Turrets will automatically shootInternal at the nearest enemy in range, as long as they have enough ammo. +tutorial.turretExplanation.text=Turrets will automatically shoot at the nearest enemy in range, as long as they have enough ammo. tutorial.waves.text=Every [yellow]60[] seconds, a wave of [coral]enemies[] will spawn in specific locations and attempt to destroy the core. tutorial.coreDestruction.text=Your objective is to [yellow]defend the core[]. If the core is destroyed, you [coral]lose the game[]. -tutorial.pausingDesktop.text=If you ever need to take a break, press the [orange]pause button[] in the top left or [orange]space[] to pause the game. You can still select and place blocks while paused, but cannot move or shootInternal. -tutorial.pausingAndroid.text=If you ever need to take a break, press the [orange]pause button[] in the top left to pause the game. You can still place select and place blocks while paused. +tutorial.pausingDesktop.text=If you ever need to take a break, press the [orange]pause button[] in the top left or [orange]space[] to pause the game. You can still select and place blocks while paused, but cannot move or shoot. +tutorial.pausingAndroid.text=If you ever need to take a break, press the [orange]pause button[] in the top left to pause the game. You can still break and place blocks while paused. tutorial.purchaseWeapons.text=You can purchase new [yellow]weapons[] for your mech by opening the upgrade menu in the bottom left. tutorial.switchWeapons.text=Switch weapons by either clicking its icon in the bottom left, or using numbers [orange][[1-9][]. tutorial.spawnWave.text=Here comes a wave now. Destroy them. @@ -275,7 +275,7 @@ keybind.move_x.name=move_x keybind.move_y.name=move_y keybind.select.name=select keybind.break.name=break -keybind.shootInternal.name=shoot +keybind.shoot.name=shoot keybind.zoom_hold.name=zoom_hold keybind.zoom.name=zoom keybind.menu.name=menu diff --git a/core/src/io/anuke/mindustry/core/NetServer.java b/core/src/io/anuke/mindustry/core/NetServer.java index 25ec6e8f60..00653983d0 100644 --- a/core/src/io/anuke/mindustry/core/NetServer.java +++ b/core/src/io/anuke/mindustry/core/NetServer.java @@ -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)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); diff --git a/core/src/io/anuke/mindustry/core/Tutorial.java b/core/src/io/anuke/mindustry/core/Tutorial.java index 99db58f233..c55778c925 100644 --- a/core/src/io/anuke/mindustry/core/Tutorial.java +++ b/core/src/io/anuke/mindustry/core/Tutorial.java @@ -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){ diff --git a/core/src/io/anuke/mindustry/io/versions/Save14.java b/core/src/io/anuke/mindustry/io/versions/Save14.java index fd8504601c..4bc2a8c967 100644 --- a/core/src/io/anuke/mindustry/io/versions/Save14.java +++ b/core/src/io/anuke/mindustry/io/versions/Save14.java @@ -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); } diff --git a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java index 411597960b..e41f82285e 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/PausedDialog.java @@ -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); }); } } diff --git a/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java b/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java index 718ff9a5ca..313b7c1df2 100644 --- a/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java +++ b/core/src/io/anuke/mindustry/world/blocks/types/production/Smelter.java @@ -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;