From 5476bca070fb7080f2af270b3748f40b7af22376 Mon Sep 17 00:00:00 2001 From: TheSlaylord Date: Fri, 22 Sep 2023 22:11:32 +0300 Subject: [PATCH] Softbush (this isn't the best bush out there) and luminium ore editor fix --- .../sprites/blocks/environment/softbush1.png | Bin 0 -> 730 bytes .../sprites/blocks/environment/softbush2.png | Bin 0 -> 756 bytes .../sprites/blocks/environment/softbush3.png | Bin 0 -> 677 bytes core/src/fos/content/FOSBlocks.java | 8 +++++++ .../blocks/environment/AnimatedOreBlock.java | 21 ++++++++++++++---- 5 files changed, 25 insertions(+), 4 deletions(-) create mode 100644 core/res/sprites/blocks/environment/softbush1.png create mode 100644 core/res/sprites/blocks/environment/softbush2.png create mode 100644 core/res/sprites/blocks/environment/softbush3.png diff --git a/core/res/sprites/blocks/environment/softbush1.png b/core/res/sprites/blocks/environment/softbush1.png new file mode 100644 index 0000000000000000000000000000000000000000..1c459038beb7e7e5349d20f67bca5af2549d9243 GIT binary patch literal 730 zcmV<00ww*4P)Px%lu1NERA_N@%zQ5;vfTXt)6<;082N3T_aIOVF^9 zI6$hTf#e2}mI65#$DZ+cW<#@|gp{A1+4shtSvvr9baZt5CzW^L-TSKHpS@gNxaafY zx}hYVa!e!1H;RcztR`|JnPgxxZ4Pd>8?V*tV?siUVKvdSTojz39_(L-%y43n#P4H9 zvLhftjc@^}QIzJOoLB^V;&bhQ$(B`g-9CQpHx>%~nB7zW zKce~d!}DtZ05~0<0l;7J_!)q_iFf0*_&_UCHA-SNtR^_xe#)+eylj^nI31n^MI)iZ zpjh1=iUOt;LQ{{z&4h#_ts3CMIg*joXH9a`p;d-j1Y#y~$!<8T8@Mea>ZF#|aq+w` z-)QtOI{2(a?<`Kh>-G>a6OwRFj*;jwDm_p%Xqs4?|6G!v1HF21V1noOWZE=P{~Z@H ze)qm=yipKqp;&!Fqaun|#^5-7?QJ6|YB85vWN9nTMdN#K$_1;@P|Yu`9v zk5M#%tLtg%@z}*CMd|}`Fg*uyevQ!BN2AV5q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^i?IrFY!j zqW400O=3gy#I}{2IZln>f-R%=2@0U8G-fhuIuF1k;Bp?Jm83C{llc7N5@7oCu9=t| zkaEDK{ky(SL6DQ!*EQ~%1WSc}BMEjPGf8OP7g51d4vn^YkH3y@SBfn!ssUYs00000 LNkvXXu0mjfqH-;a literal 0 HcmV?d00001 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)); }