From cad44cf379afbea2987b43c05749fa72a3162aae Mon Sep 17 00:00:00 2001 From: Anuken Date: Thu, 28 Jun 2018 10:11:25 -0400 Subject: [PATCH] Added warning text on first startup, tutorial stub text, desc fixes --- core/assets/bundles/bundle.properties | 3 +- .../content/blocks/TurretBlocks.java | 2 + core/src/io/anuke/mindustry/core/Control.java | 46 +++++++------------ .../mindustry/ui/fragments/MenuFragment.java | 8 ++-- .../world/blocks/power/TurbineGenerator.java | 8 ++++ .../world/blocks/production/Cultivator.java | 2 +- .../world/blocks/production/Drill.java | 9 +++- .../anuke/mindustry/world/meta/BlockStat.java | 1 + 8 files changed, 42 insertions(+), 37 deletions(-) diff --git a/core/assets/bundles/bundle.properties b/core/assets/bundles/bundle.properties index 4f7fa2c655..0d4445c092 100644 --- a/core/assets/bundles/bundle.properties +++ b/core/assets/bundles/bundle.properties @@ -1,4 +1,4 @@ -text.about=Created by [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[]\nOriginally an entry in the [orange]GDL[] Metal Monstrosity Jam.\n\nCredits:\n- SFX made with [YELLOW]bfxr[]\n- Music made by [GREEN]a beat a day[]\n\nSpecial thanks to:\n- [coral]MitchellFJN[]: extensive playtesting and feedback\n- [sky]Luxray5474[]: wiki work, code contributions\n- [lime]Epowerj[]: code build system, icon\n- All the beta testers on itch.io and Google Play\n +text.about=Created by [ROYAL]Anuken[] - [SKY]anukendev@gmail.com[] text.credits=Credits text.discord=Join the mindustry discord! text.changes=[SCARLET]Attention!\n[]Some important game mechanics have been changed.\n\n- [accent]Teleporters[] now use power.\n- [accent]Smelteries[] and [accent]crucibles[] now have a maximum item capacity.\n- [accent]Crucibles[] now require coal as fuel. @@ -271,6 +271,7 @@ text.blocks.maxpowergeneration=Max Power Generation text.blocks.powertransferspeed=Power Transfer text.blocks.craftspeed=Production Speed text.blocks.inputliquid=Input Liquid +text.blocks.inputliquidaux=Aux Liquid text.blocks.inputitem=Input Item text.blocks.inputitems=Input Items text.blocks.outputitem=Output Item diff --git a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java index 74384e5fe9..4632470522 100644 --- a/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/TurretBlocks.java @@ -85,6 +85,8 @@ public class TurretBlocks extends BlockList implements ContentList { recoil = 2f; reload = 130f; cooldown = 0.03f; + powerUsed = 20f; + powerCapacity = 60f; shootEffect = ShootFx.lancerLaserShoot; smokeEffect = ShootFx.lancerLaserShootSmoke; chargeEffect = ShootFx.lancerLaserCharge; diff --git a/core/src/io/anuke/mindustry/core/Control.java b/core/src/io/anuke/mindustry/core/Control.java index e6c88190bc..e1ba7ece94 100644 --- a/core/src/io/anuke/mindustry/core/Control.java +++ b/core/src/io/anuke/mindustry/core/Control.java @@ -21,10 +21,10 @@ import io.anuke.mindustry.io.Map; import io.anuke.mindustry.io.Saves; import io.anuke.mindustry.net.Net; import io.anuke.mindustry.type.Recipe; +import io.anuke.mindustry.ui.dialogs.FloatingDialog; import io.anuke.ucore.core.*; import io.anuke.ucore.entities.Entities; import io.anuke.ucore.entities.EntityPhysics; -import io.anuke.ucore.input.InputProxy; import io.anuke.ucore.modules.Module; import io.anuke.ucore.util.Atlas; @@ -46,7 +46,6 @@ public class Control extends Module{ private ObjectMap soundMap = new ObjectMap<>(); private Throwable error; - private InputProxy proxy; private Input gdxInput; public Control(){ @@ -69,30 +68,6 @@ public class Control extends Module{ gdxInput = Gdx.input; - proxy = new InputProxy(Gdx.input){ - @Override - public int getX(int pointer) { - return pointer >= inputs.length ? super.getX(pointer) : (int)inputs[pointer].getMouseX(); - } - - @Override - public int getY(int pointer) { - return pointer >= inputs.length ? super.getY(pointer) : (int)inputs[pointer].getMouseY(); - } - - @Override - public int getX() { - return (int)inputs[0].getMouseX(); - } - - @Override - public int getY() { - return (int)inputs[0].getMouseY(); - } - }; - - //Gdx.input = proxy; - Sounds.load("shoot.mp3", "place.mp3", "explosion.mp3", "enemyshoot.mp3", "corexplode.mp3", "break.mp3", "spawn.mp3", "flame.mp3", "die.mp3", "respawn.mp3", "purchase.mp3", "flame2.mp3", "bigshot.mp3", "laser.mp3", "lasershot.mp3", @@ -261,15 +236,14 @@ public class Control extends Module{ public void playMap(Map map){ ui.loadfrag.show(); - Timers.run(5f, () -> { + Timers.run(5f, () -> threads.run(() -> { logic.reset(); world.loadMap(map); logic.play(); Gdx.app.postRunnable(ui.loadfrag::hide); - }); - }); + })); } public boolean isHighScore(){ @@ -317,6 +291,20 @@ public class Control extends Module{ EntityPhysics.initPhysics(); Platform.instance.updateRPC(); + + if(!Settings.has("4.0-warning")){ + Settings.putBool("4.0-warning", true); + + Timers.runTask(5f, () -> { + FloatingDialog dialog = new FloatingDialog("[orange]WARNING![]"); + dialog.buttons().addButton("$text.ok", dialog::hide).size(100f, 60f); + dialog.content().add("The beta version you are about to play should be considered very unstable, and is [accent]not representative of the final 4.0 release.[]\n\n " + + "A large portion of content is still unimplemented. \nAll current art and UI is temporary, and will be re-drawn before release. " + + "\n\n[accent]Saves and maps may be corrupted without warning between updates.[] You have been warned!").wrap().width(500f); + dialog.show(); + + }); + } } /**Called from main logic thread.*/ diff --git a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java index 7d6429c41d..6b0a7b6285 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/MenuFragment.java @@ -58,9 +58,8 @@ public class MenuFragment implements Fragment{ new imagebutton("icon-play-2", isize, ui.levels::show).text("$text.play").padTop(4f); - new imagebutton("icon-tutorial", isize, () -> { - - }).text("$text.tutorial").padTop(4f); + new imagebutton("icon-tutorial", isize, () -> ui.showInfo("The tutorial is currently not yet implemented.")) + .text("$text.tutorial").padTop(4f); new imagebutton("icon-load", isize, ui.load::show).text("$text.load").padTop(4f); @@ -125,7 +124,8 @@ public class MenuFragment implements Fragment{ ui.showInfo("$text.multiplayer.web"); } })); - dialog.content().add(new MenuButton("icon-tutorial", "$text.tutorial", ()-> {})); + + dialog.content().add(new MenuButton("icon-tutorial", "$text.tutorial", ()-> ui.showInfo("The tutorial is currently not yet implemented."))); dialog.content().row(); diff --git a/core/src/io/anuke/mindustry/world/blocks/power/TurbineGenerator.java b/core/src/io/anuke/mindustry/world/blocks/power/TurbineGenerator.java index 1e99b88883..d29d5bb67e 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/TurbineGenerator.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/TurbineGenerator.java @@ -4,6 +4,7 @@ import io.anuke.mindustry.content.Liquids; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Liquid; import io.anuke.mindustry.world.Tile; +import io.anuke.mindustry.world.meta.BlockStat; import io.anuke.ucore.core.Timers; public class TurbineGenerator extends BurnerGenerator { @@ -15,6 +16,13 @@ public class TurbineGenerator extends BurnerGenerator { super(name); } + @Override + public void setStats() { + super.setStats(); + + stats.add(BlockStat.inputLiquidAux, auxLiquid); + } + @Override public void update(Tile tile) { TurbineEntity entity = tile.entity(); diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java b/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java index e9d24ad75e..52bf4488a4 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Cultivator.java @@ -40,7 +40,7 @@ public class Cultivator extends Drill { stats.remove(BlockStat.drillTier); stats.add(BlockStat.drillTier, table -> { - table.addImage("grass1").size(8*3); + table.addImage("grass1").size(8*3).padBottom(3).padTop(3); }); } diff --git a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java index 5ea1d90a05..80a95e7edc 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/Drill.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/Drill.java @@ -118,7 +118,6 @@ public class Drill extends Block{ @Override public void setStats(){ super.setStats(); - //TODO add drill speed stats stats.add(BlockStat.drillTier, table -> { Array list = new Array<>(); @@ -131,16 +130,22 @@ public class Drill extends Block{ for (int i = 0; i < list.size; i++) { Item item = list.get(i); - table.addImage(item.name + "1").size(8*3).padRight(2).padLeft(2); + table.addImage(item.name + "1").size(8*3).padRight(2).padLeft(2).padTop(3).padBottom(3); if(i != list.size - 1){ table.add("/"); } } }); + stats.add(BlockStat.drillSpeed, 60f/drillTime, StatUnit.itemsSecond); + if(inputLiquid != null){ stats.add(BlockStat.inputLiquid, inputLiquid); } + + if(hasPower){ + stats.add(BlockStat.powerUse, powerUse*60f, StatUnit.powerSecond); + } } @Override diff --git a/core/src/io/anuke/mindustry/world/meta/BlockStat.java b/core/src/io/anuke/mindustry/world/meta/BlockStat.java index 2580c4c7bf..a72600dc32 100644 --- a/core/src/io/anuke/mindustry/world/meta/BlockStat.java +++ b/core/src/io/anuke/mindustry/world/meta/BlockStat.java @@ -22,6 +22,7 @@ public enum BlockStat { maxPowerGeneration(StatCategory.power), inputLiquid(StatCategory.crafting), + inputLiquidAux(StatCategory.crafting), liquidUse(StatCategory.crafting), inputItem(StatCategory.crafting), inputItems(StatCategory.crafting),