diff --git a/core/src/mindustry/content/TechTree.java b/core/src/mindustry/content/TechTree.java index bec574d24f..59a89d427e 100644 --- a/core/src/mindustry/content/TechTree.java +++ b/core/src/mindustry/content/TechTree.java @@ -465,7 +465,8 @@ public class TechTree implements ContentList{ //TODO change positions? node(impact0078, Seq.with( new SectorComplete(tarFields), - new Research(Items.thorium) + new Research(Items.thorium), + new Research(coreFoundation) ), () -> { node(desolateRift, Seq.with( new SectorComplete(impact0078), diff --git a/core/src/mindustry/content/UnitTypes.java b/core/src/mindustry/content/UnitTypes.java index 380df9d03b..7ecee44bc4 100644 --- a/core/src/mindustry/content/UnitTypes.java +++ b/core/src/mindustry/content/UnitTypes.java @@ -995,6 +995,7 @@ public class UnitTypes implements ContentList{ shots = 2; inaccuracy = 5f; velocityRnd = 0.2f; + shootSound = Sounds.missile; bullet = new MissileBulletType(3f, 12){{ width = 8f; @@ -1055,7 +1056,7 @@ public class UnitTypes implements ContentList{ ejectEffect = Fx.casing1; rotateSpeed = 8f; bullet = missiles; - shootSound = Sounds.shoot; + shootSound = Sounds.missile; rotate = true; occlusion = 6f; }}, @@ -1066,7 +1067,7 @@ public class UnitTypes implements ContentList{ rotateSpeed = 8f; ejectEffect = Fx.casing1; bullet = missiles; - shootSound = Sounds.shoot; + shootSound = Sounds.missile; rotate = true; occlusion = 6f; }}, @@ -1147,7 +1148,7 @@ public class UnitTypes implements ContentList{ y = 27f; rotateSpeed = 2f; reload = 9f; - shootSound = Sounds.flame; + shootSound = Sounds.shoot; occlusion = 7f; rotate = true; recoil = 0.5f; diff --git a/core/src/mindustry/core/Control.java b/core/src/mindustry/core/Control.java index 1c0d2cf267..d3ab614452 100644 --- a/core/src/mindustry/core/Control.java +++ b/core/src/mindustry/core/Control.java @@ -164,7 +164,7 @@ public class Control implements ApplicationListener, Loadable{ if(state.isCampaign() && !net.client() && !headless){ //save gameover sate immediately - if(saves.getCurrent() != null && !state.rules.tutorial){ + if(saves.getCurrent() != null){ saves.getCurrent().save(); } } @@ -479,10 +479,6 @@ public class Control implements ApplicationListener, Loadable{ if(state.isGame()){ input.update(); - if(state.rules.tutorial){ - tutorial.update(); - } - //auto-update rpc every 5 seconds if(timer.get(0, 60 * 5)){ platform.updateRPC(); diff --git a/core/src/mindustry/core/UI.java b/core/src/mindustry/core/UI.java index 5ef61b71cc..566d26feb0 100644 --- a/core/src/mindustry/core/UI.java +++ b/core/src/mindustry/core/UI.java @@ -140,12 +140,6 @@ public class UI implements ApplicationListener, Loadable{ } } - //draw overlay for buttons - if(state.rules.tutorial){ - control.tutorial.draw(); - Draw.flush(); - } - Events.fire(Trigger.uiDrawEnd); } diff --git a/core/src/mindustry/game/Rules.java b/core/src/mindustry/game/Rules.java index 3f9e104a68..c91a3fcb7f 100644 --- a/core/src/mindustry/game/Rules.java +++ b/core/src/mindustry/game/Rules.java @@ -32,8 +32,6 @@ public class Rules{ public boolean attackMode = false; /** Whether this is the editor gamemode. */ public boolean editor = false; - /** Whether the tutorial is enabled. False by default. */ - public boolean tutorial = false; /** Whether a gameover can happen at all. Set this to false to implement custom gameover conditions. */ public boolean canGameOver = true; /** Whether reactors can explode and damage other blocks. */ diff --git a/core/src/mindustry/game/Saves.java b/core/src/mindustry/game/Saves.java index dc43f3c740..c832f86471 100644 --- a/core/src/mindustry/game/Saves.java +++ b/core/src/mindustry/game/Saves.java @@ -85,7 +85,7 @@ public class Saves{ lastTimestamp = Time.millis(); } - if(state.isGame() && !state.gameOver && current != null && current.isAutosave() && !state.rules.tutorial){ + if(state.isGame() && !state.gameOver && current != null && current.isAutosave()){ time += Time.delta; if(time > Core.settings.getInt("saveinterval") * 60){ saving = true; diff --git a/core/src/mindustry/ui/dialogs/PausedDialog.java b/core/src/mindustry/ui/dialogs/PausedDialog.java index a1feb73457..5e9b5d1666 100644 --- a/core/src/mindustry/ui/dialogs/PausedDialog.java +++ b/core/src/mindustry/ui/dialogs/PausedDialog.java @@ -35,30 +35,28 @@ public class PausedDialog extends BaseDialog{ cont.button("@back", Icon.left, this::hide).name("back"); cont.button("@settings", Icon.settings, ui.settings::show).name("settings"); - if(!state.rules.tutorial){ - if(!state.isCampaign() && !state.isEditor()){ - cont.row(); - cont.button("@savegame", Icon.save, save::show); - cont.button("@loadgame", Icon.upload, load::show).disabled(b -> net.active()); - } - + if(!state.isCampaign() && !state.isEditor()){ cont.row(); - - cont.button("@hostserver", Icon.host, () -> { - if(net.server() && steam){ - platform.inviteFriends(); - }else{ - if(steam){ - ui.host.runHost(); - }else{ - ui.host.show(); - } - } - }).disabled(b -> !((steam && net.server()) || !net.active())).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.server() && steam ? "@invitefriends" : "@hostserver")); + cont.button("@savegame", Icon.save, save::show); + cont.button("@loadgame", Icon.upload, load::show).disabled(b -> net.active()); } cont.row(); + cont.button("@hostserver", Icon.host, () -> { + if(net.server() && steam){ + platform.inviteFriends(); + }else{ + if(steam){ + ui.host.runHost(); + }else{ + ui.host.show(); + } + } + }).disabled(b -> !((steam && net.server()) || !net.active())).colspan(2).width(dw * 2 + 20f).update(e -> e.setText(net.server() && steam ? "@invitefriends" : "@hostserver")); + + cont.row(); + cont.button("@quit", Icon.exit, this::showQuitConfirm).colspan(2).width(dw + 20f).update(s -> s.setText(control.saves.getCurrent() != null && control.saves.getCurrent().isAutosave() ? "@save.quit" : "@quit")); }else{ @@ -95,10 +93,7 @@ public class PausedDialog extends BaseDialog{ } void showQuitConfirm(){ - ui.showConfirm("@confirm", state.rules.tutorial ? "@quit.confirm.tutorial" : "@quit.confirm", () -> { - if(state.rules.tutorial){ - Core.settings.put("playedtutorial", true); - } + ui.showConfirm("@confirm", "@quit.confirm", () -> { wasClient = net.client(); if(net.client()) netClient.disconnectQuietly(); runExitSave(); @@ -112,7 +107,7 @@ public class PausedDialog extends BaseDialog{ return; } - if(control.saves.getCurrent() == null || !control.saves.getCurrent().isAutosave() || state.rules.tutorial || wasClient){ + if(control.saves.getCurrent() == null || !control.saves.getCurrent().isAutosave() || wasClient){ logic.reset(); return; } diff --git a/core/src/mindustry/ui/fragments/HudFragment.java b/core/src/mindustry/ui/fragments/HudFragment.java index e558a63422..fefaf67f42 100644 --- a/core/src/mindustry/ui/fragments/HudFragment.java +++ b/core/src/mindustry/ui/fragments/HudFragment.java @@ -96,13 +96,13 @@ public class HudFragment extends Fragment{ //minimap + position parent.fill(t -> { t.name = "minimap/position"; - t.visible(() -> Core.settings.getBool("minimap") && !state.rules.tutorial && shown); + t.visible(() -> Core.settings.getBool("minimap") && shown); //minimap t.add(new Minimap()).name("minimap"); t.row(); //position t.label(() -> player.tileX() + "," + player.tileY()) - .visible(() -> Core.settings.getBool("position") && !state.rules.tutorial) + .visible(() -> Core.settings.getBool("position")) .touchable(Touchable.disabled) .name("position"); t.top().right(); @@ -319,12 +319,12 @@ public class HudFragment extends Fragment{ .update(label -> label.color.set(Color.orange).lerp(Color.scarlet, Mathf.absin(Time.time(), 2f, 1f)))).touchable(Touchable.disabled); }); - //tutorial text + //TODO tutorial text parent.fill(t -> { t.name = "tutorial"; Runnable resize = () -> { t.clearChildren(); - t.top().right().visible(() -> state.rules.tutorial); + t.top().right().visible(() -> false); t.stack(new Button(){{ marginLeft(48f); labelWrap(() -> control.tutorial.stage.text() + (control.tutorial.canNext() ? "\n\n" + Core.bundle.get("tutorial.next") : "")).width(!Core.graphics.isPortrait() ? 400f : 160f).pad(2f); @@ -465,7 +465,7 @@ public class HudFragment extends Fragment{ public void showUnlock(UnlockableContent content){ //some content may not have icons... yet //also don't play in the tutorial to prevent confusion - if(state.isMenu() || state.rules.tutorial) return; + if(state.isMenu()) return; Sounds.message.play(); @@ -788,7 +788,7 @@ public class HudFragment extends Fragment{ } private boolean canSkipWave(){ - return state.rules.waves && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning() && !state.rules.tutorial; + return state.rules.waves && ((net.server() || player.admin) || !net.active()) && state.enemies == 0 && !spawner.isSpawning(); } } diff --git a/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java b/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java index 6cd731aa80..62b542338a 100644 --- a/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java +++ b/core/src/mindustry/world/blocks/defense/turrets/ItemTurret.java @@ -139,11 +139,6 @@ public class ItemTurret extends Turret{ //must not be found ammo.add(new ItemEntry(item, (int)type.ammoMultiplier)); - - //fire events for the tutorial - if(state.rules.tutorial){ - Events.fire(new TurretAmmoDeliverEvent()); - } } @Override diff --git a/core/src/mindustry/world/blocks/storage/CoreBlock.java b/core/src/mindustry/world/blocks/storage/CoreBlock.java index 96418c30b0..094260d968 100644 --- a/core/src/mindustry/world/blocks/storage/CoreBlock.java +++ b/core/src/mindustry/world/blocks/storage/CoreBlock.java @@ -366,10 +366,6 @@ public class CoreBlock extends StorageBlock{ }else{ super.handleItem(source, item); } - - if(state.rules.tutorial){ - Events.fire(new CoreItemDeliverEvent()); - } } } }