From f4c9645d733ed75825f91a65f2711c40357c041b Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 25 Jun 2018 14:18:33 -0400 Subject: [PATCH] Fixed power distributors connecting to generators, wrong save extension --- .../blocks/production/siliconextractor.png | Bin 262 -> 0 bytes core/src/io/anuke/mindustry/content/Recipes.java | 5 +++++ core/src/io/anuke/mindustry/io/Saves.java | 5 ++--- .../anuke/mindustry/ui/dialogs/LoadDialog.java | 4 ++-- .../anuke/mindustry/world/blocks/OreBlock.java | 2 +- .../world/blocks/power/PowerDistributor.java | 3 ++- packer/src/io/anuke/mindustry/Generators.java | 15 +++++++++++++++ 7 files changed, 27 insertions(+), 7 deletions(-) delete mode 100644 core/assets-raw/sprites/blocks/production/siliconextractor.png diff --git a/core/assets-raw/sprites/blocks/production/siliconextractor.png b/core/assets-raw/sprites/blocks/production/siliconextractor.png deleted file mode 100644 index d774add1df3ee83f22a52602f8be852d93c12173..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 262 zcmeAS@N?(olHy`uVBq!ia0vp^93afW1|*O0@9PFqoCO|{#S9GG!XV7ZFl&wkP>{XE z)7O>#5tEp>ics^VJVBt4WQl7;iF1B#Zfaf$gL6@8Vo7R>LV0FMhJw4NZ$Nk>pEyua zgQtsQh{WaEUPG=!0Rk@bAAVoSG=Fd7)CasltVQc%G$&}83#{35&>-O{=N69N7mvOC zw(;|`Ejp)nU*l@XW%$JQLM3r_>22wl?R#y@8MgmkY`S^w8W$Ep$5{-|GLM*T<3GG# z#Pi3`UyUp0FaKx|qo2-D^lr8&gXfin`E6ETJeVFZOK6%@?0TGL4s;8Hr>mdKI;Vst E08Uq2dH?_b diff --git a/core/src/io/anuke/mindustry/content/Recipes.java b/core/src/io/anuke/mindustry/content/Recipes.java index cbdf715032..9dbdfef11b 100644 --- a/core/src/io/anuke/mindustry/content/Recipes.java +++ b/core/src/io/anuke/mindustry/content/Recipes.java @@ -88,6 +88,11 @@ public class Recipes implements ContentList{ new Recipe(production, ProductionBlocks.oilextractor, new ItemStack(Items.tungsten, 90), new ItemStack(Items.carbide, 150), new ItemStack(Items.lead, 100), new ItemStack(Items.silicon, 100)); //UNITS + + //bodies + //new Recipe(units, UpgradeBlocks.deltaFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30)); + + //actual unit related stuff new Recipe(units, UnitBlocks.droneFactory, new ItemStack(Items.tungsten, 30), new ItemStack(Items.lead, 50), new ItemStack(Items.silicon, 30)); new Recipe(units, UnitBlocks.repairPoint, new ItemStack(Items.lead, 30), new ItemStack(Items.tungsten, 30), new ItemStack(Items.silicon, 20)); diff --git a/core/src/io/anuke/mindustry/io/Saves.java b/core/src/io/anuke/mindustry/io/Saves.java index c81707427b..b9dfaed522 100644 --- a/core/src/io/anuke/mindustry/io/Saves.java +++ b/core/src/io/anuke/mindustry/io/Saves.java @@ -3,7 +3,6 @@ package io.anuke.mindustry.io; import com.badlogic.gdx.files.FileHandle; import com.badlogic.gdx.utils.Array; import com.badlogic.gdx.utils.async.AsyncExecutor; -import io.anuke.mindustry.Vars; import io.anuke.mindustry.core.GameState.State; import io.anuke.mindustry.game.Difficulty; import io.anuke.mindustry.game.GameMode; @@ -169,8 +168,8 @@ public class Saves { public void exportFile(FileHandle file) throws IOException{ try{ - if(!file.extension().equals("mins")){ - file = file.parent().child(file.nameWithoutExtension() + "." + Vars.saveExtension); + if(!file.extension().equals(saveExtension)){ + file = file.parent().child(file.nameWithoutExtension() + "." + saveExtension); } SaveIO.fileFor(index).copyTo(file); }catch (Exception e){ diff --git a/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java b/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java index b36175f61b..7c1f54d3df 100644 --- a/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java +++ b/core/src/io/anuke/mindustry/ui/dialogs/LoadDialog.java @@ -95,7 +95,7 @@ public class LoadDialog extends FloatingDialog{ } catch (IOException e) { ui.showError(Bundles.format("text.save.export.fail", Strings.parseException(e, false))); } - }, false, "mins"); + }, false, saveExtension); }else{ try { FileHandle file = Gdx.files.local("save-" + slot.getName() + "." + Vars.saveExtension); @@ -162,7 +162,7 @@ public class LoadDialog extends FloatingDialog{ }else{ ui.showError("$text.save.import.invalid"); } - }, true, "mins"); + }, true, saveExtension); }).fillX().margin(10f).minWidth(300f).height(70f).pad(4f).padRight(-4); } diff --git a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java index 8295d9e532..99ca64a663 100644 --- a/core/src/io/anuke/mindustry/world/blocks/OreBlock.java +++ b/core/src/io/anuke/mindustry/world/blocks/OreBlock.java @@ -9,7 +9,7 @@ import io.anuke.mindustry.world.Tile; import io.anuke.ucore.graphics.Draw; public class OreBlock extends Floor { - protected Floor base; + public Floor base; public OreBlock(Item ore, Floor base){ super("ore-" + ore.name + "-" + base.name); diff --git a/core/src/io/anuke/mindustry/world/blocks/power/PowerDistributor.java b/core/src/io/anuke/mindustry/world/blocks/power/PowerDistributor.java index e05082a3f0..d29cc19349 100644 --- a/core/src/io/anuke/mindustry/world/blocks/power/PowerDistributor.java +++ b/core/src/io/anuke/mindustry/world/blocks/power/PowerDistributor.java @@ -253,7 +253,8 @@ public class PowerDistributor extends PowerBlock{ } protected boolean linkValid(Tile tile, Tile link){ - if(!(tile != link && link != null && link.block().hasPower)) return false; + if(!(tile != link && link != null && link.block().hasPower) + || link.block() instanceof PowerGenerator) return false; if(link.block() instanceof PowerDistributor){ DistributorEntity oe = link.entity(); diff --git a/packer/src/io/anuke/mindustry/Generators.java b/packer/src/io/anuke/mindustry/Generators.java index e6897c8409..b0261c7bfa 100644 --- a/packer/src/io/anuke/mindustry/Generators.java +++ b/packer/src/io/anuke/mindustry/Generators.java @@ -1,9 +1,11 @@ package io.anuke.mindustry; import com.badlogic.gdx.graphics.g2d.TextureRegion; +import io.anuke.mindustry.type.Item; import io.anuke.mindustry.type.Mech; import io.anuke.mindustry.type.Upgrade; import io.anuke.mindustry.world.Block; +import io.anuke.mindustry.world.blocks.OreBlock; public class Generators { @@ -56,6 +58,19 @@ public class Generators { image.save("mech-icon-" + mech.name); } }); + + context.generate("ore-icons", () -> { + for(Block block : Block.all()){ + if(!(block instanceof OreBlock)) continue; + + OreBlock ore = (OreBlock)block; + Item item = ore.drops.item; + Block base = ore.base; + + //get base image to draw on + Image image = context.get(base.name); + } + }); } }