From 9130302c93cfe85d68f54503990244b8b3fc0109 Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 2 Jul 2018 21:35:21 -0400 Subject: [PATCH] Fixed pyratite mixer glitchy animation / Fixed block select flashing --- build.gradle | 2 +- .../mindustry/content/blocks/CraftingBlocks.java | 1 + .../mindustry/ui/fragments/BlocksFragment.java | 2 ++ .../world/blocks/production/PowerSmelter.java | 13 +++++++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/build.gradle b/build.gradle index a5ceeb2f48..b1d44b0ab8 100644 --- a/build.gradle +++ b/build.gradle @@ -27,7 +27,7 @@ allprojects { gdxVersion = '1.9.8' roboVMVersion = '2.3.0' aiVersion = '1.8.1' - uCoreVersion = '2e6aa0a1df' + uCoreVersion = '7945183f17' getVersionString = { String buildVersion = getBuildVersion() diff --git a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java index 22906f0ae3..a98d848607 100644 --- a/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java +++ b/core/src/io/anuke/mindustry/content/blocks/CraftingBlocks.java @@ -129,6 +129,7 @@ public class CraftingBlocks extends BlockList implements ContentList { }}; pyratiteMixer = new PowerSmelter("pyratite-mixer") {{ + flameColor = Color.CLEAR; itemCapacity = 20; hasItems = true; hasPower = true; diff --git a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java index ab22669d78..0dc42e3615 100644 --- a/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java +++ b/core/src/io/anuke/mindustry/ui/fragments/BlocksFragment.java @@ -1,5 +1,6 @@ package io.anuke.mindustry.ui.fragments; +import com.badlogic.gdx.Gdx; import com.badlogic.gdx.graphics.Color; import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.math.Interpolation; @@ -148,6 +149,7 @@ public class BlocksFragment extends Fragment{ input.recipe = null; } lastCategory = cat; + stack.act(Gdx.graphics.getDeltaTime()); }).growX().height(54).group(group) .name("sectionbutton" + cat.name()).get(); diff --git a/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java b/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java index b6fb136c3f..fc552c8135 100644 --- a/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java +++ b/core/src/io/anuke/mindustry/world/blocks/production/PowerSmelter.java @@ -1,6 +1,7 @@ package io.anuke.mindustry.world.blocks.production; import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.g2d.TextureRegion; import io.anuke.mindustry.content.fx.BlockFx; import io.anuke.mindustry.entities.TileEntity; import io.anuke.mindustry.type.Item; @@ -48,6 +49,8 @@ public class PowerSmelter extends PowerBlock { burnEffect = BlockFx.fuelburn; protected Color flameColor = Color.valueOf("ffc999"); + protected TextureRegion topRegion; + public PowerSmelter(String name) { super(name); hasItems = true; @@ -56,6 +59,12 @@ public class PowerSmelter extends PowerBlock { itemCapacity = 20; } + @Override + public void load() { + super.load(); + topRegion = Draw.region(name + "-top"); + } + @Override public void setBars(){ super.setBars(); @@ -169,7 +178,7 @@ public class PowerSmelter extends PowerBlock { PowerSmelterEntity entity = tile.entity(); //draw glowing center - if(entity.heat > 0f){ + if(entity.heat > 0f && flameColor.a > 0.001f){ float g = 0.3f; float r = 0.06f; float cr = Mathf.random(0.1f); @@ -179,7 +188,7 @@ public class PowerSmelter extends PowerBlock { Draw.tint(flameColor); Fill.circle(tile.drawx(), tile.drawy(), 3f + Mathf.absin(Timers.time(), 5f, 2f) + cr); Draw.color(1f, 1f, 1f, entity.heat); - Draw.rect(name + "-top", tile.drawx(), tile.drawy()); + Draw.rect(topRegion, tile.drawx(), tile.drawy()); Fill.circle(tile.drawx(), tile.drawy(), 1.9f + Mathf.absin(Timers.time(), 5f, 1f) + cr); Draw.color();