diff --git a/core/res/sprites/blocks/environment/softbush1.png b/core/res/sprites/blocks/environment/softbush1.png new file mode 100644 index 00000000..1c459038 Binary files /dev/null and b/core/res/sprites/blocks/environment/softbush1.png differ diff --git a/core/res/sprites/blocks/environment/softbush2.png b/core/res/sprites/blocks/environment/softbush2.png new file mode 100644 index 00000000..d1323aee Binary files /dev/null and b/core/res/sprites/blocks/environment/softbush2.png differ diff --git a/core/res/sprites/blocks/environment/softbush3.png b/core/res/sprites/blocks/environment/softbush3.png new file mode 100644 index 00000000..80b29bd0 Binary files /dev/null and b/core/res/sprites/blocks/environment/softbush3.png differ diff --git a/core/src/fos/content/FOSBlocks.java b/core/src/fos/content/FOSBlocks.java index 85271b85..b0c418fe 100644 --- a/core/src/fos/content/FOSBlocks.java +++ b/core/src/fos/content/FOSBlocks.java @@ -70,6 +70,8 @@ public class FOSBlocks { alienMoss, oreTin, oreTinSurface, oreSilver, oreLithium, oreDiamond, oreVanadium, oreIridium, oreLuminium, bugSpawn, + //props + softbush, //units upgradeCenter, hovercraftFactory, droidConstructor, //storage @@ -1159,6 +1161,12 @@ protected boolean canPump(Tile tile) { size = 3; interval = 20 * 60; }}; + + softbush = new Prop("softbush"){{ + variants = 3; + blublu.asFloor().decoration = this; + breakSound = Sounds.plantBreak; + }}; //endregion //region units upgradeCenter = new UpgradeCenter("upgrade-center"){{ diff --git a/core/src/fos/type/blocks/environment/AnimatedOreBlock.java b/core/src/fos/type/blocks/environment/AnimatedOreBlock.java index 8ff21dc0..26fef6e1 100644 --- a/core/src/fos/type/blocks/environment/AnimatedOreBlock.java +++ b/core/src/fos/type/blocks/environment/AnimatedOreBlock.java @@ -1,8 +1,7 @@ package fos.type.blocks.environment; -import arc.Events; -import arc.graphics.Color; -import arc.graphics.Texture; +import arc.*; +import arc.graphics.*; import arc.graphics.g2d.*; import arc.graphics.gl.Shader; import arc.math.Mathf; @@ -13,7 +12,7 @@ import mindustry.Vars; import mindustry.content.Blocks; import mindustry.game.EventType; -import mindustry.graphics.*; +import mindustry.graphics.Drawf; import mindustry.world.Tile; import mindustry.world.blocks.environment.OreBlock; @@ -47,6 +46,19 @@ public void load() { } } + //overridden to prevent crashes. FIXME: actual regions are fucked up + @Override + public TextureRegion[] editorVariantRegions() { + if (editorVariantRegions == null) { + variantRegions(); + editorVariantRegions = new TextureRegion[variantRegions.length]; + for (int i = 1; i <= variantRegions.length; i++) { + editorVariantRegions[i-1] = Core.atlas.find(name + "-" + i + "-2"); + } + } + return editorVariantRegions; + } + @Override public void drawBase(Tile tile) { @@ -84,6 +96,7 @@ public boolean updateRender(Tile tile) { public abstract static class DrawRequest { public static Seq requests = new Seq<>(); static { + Events.run(EventType.Trigger.postDraw, () -> requests.clear()); Events.run(EventType.Trigger.draw, () -> requests.each(DrawRequest::draw)); }