From fe51500e8e5c81323c86bd44af38d87c349fa557 Mon Sep 17 00:00:00 2001 From: Goobrr <73060700+Goobrr@users.noreply.github.com> Date: Tue, 5 Jul 2022 21:44:15 +0700 Subject: [PATCH] Use new drawers (#7127) --- ...rbine1.png => steam-generator-turbine.png} | Bin .../blocks/power/steam-generator-turbine0.png | Bin 260 -> 0 bytes .../blocks/production/spore-press-bottom.png | Bin 0 -> 222 bytes .../blocks/production/spore-press-frame0.png | Bin 568 -> 0 bytes .../blocks/production/spore-press-frame1.png | Bin 562 -> 0 bytes .../blocks/production/spore-press-frame2.png | Bin 531 -> 0 bytes .../blocks/production/spore-press-piston0.png | Bin 0 -> 217 bytes .../blocks/production/spore-press-piston1.png | Bin 0 -> 219 bytes .../sprites/blocks/production/spore-press.png | Bin 1098 -> 1146 bytes core/src/mindustry/content/Blocks.java | 18 +++++++- core/src/mindustry/mod/ClassMap.java | 1 - core/src/mindustry/world/draw/DrawRegion.java | 6 +-- .../mindustry/world/draw/DrawTurbines.java | 39 ------------------ 13 files changed, 19 insertions(+), 45 deletions(-) rename core/assets-raw/sprites/blocks/power/{steam-generator-turbine1.png => steam-generator-turbine.png} (100%) delete mode 100644 core/assets-raw/sprites/blocks/power/steam-generator-turbine0.png create mode 100644 core/assets-raw/sprites/blocks/production/spore-press-bottom.png delete mode 100644 core/assets-raw/sprites/blocks/production/spore-press-frame0.png delete mode 100644 core/assets-raw/sprites/blocks/production/spore-press-frame1.png delete mode 100644 core/assets-raw/sprites/blocks/production/spore-press-frame2.png create mode 100644 core/assets-raw/sprites/blocks/production/spore-press-piston0.png create mode 100644 core/assets-raw/sprites/blocks/production/spore-press-piston1.png delete mode 100644 core/src/mindustry/world/draw/DrawTurbines.java diff --git a/core/assets-raw/sprites/blocks/power/steam-generator-turbine1.png b/core/assets-raw/sprites/blocks/power/steam-generator-turbine.png similarity index 100% rename from core/assets-raw/sprites/blocks/power/steam-generator-turbine1.png rename to core/assets-raw/sprites/blocks/power/steam-generator-turbine.png diff --git a/core/assets-raw/sprites/blocks/power/steam-generator-turbine0.png b/core/assets-raw/sprites/blocks/power/steam-generator-turbine0.png deleted file mode 100644 index 27d0b9354ccb2cf796ae87cd1a069c7d17708abd..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 260 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|_IbKEhE&XX zd&8Qq*@34evH1KIL3gK>#pjo7Y7yw4AS-_DPyG24LTMY#nSiPp7&LU&e_!sL=5k~S zUyQhwz5Jv zb*jYlMTz$qPyXWZxK`hoV#~fHZ*oGX-)^v57~1x^MjhLq9K9kF#P@Xdb6Mw<&;$T8 Cdt_4p diff --git a/core/assets-raw/sprites/blocks/production/spore-press-bottom.png b/core/assets-raw/sprites/blocks/production/spore-press-bottom.png new file mode 100644 index 0000000000000000000000000000000000000000..a100086fe3e930f46cacddbd2bf436d548664bbb GIT binary patch literal 222 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|W_Y?dhE&XX zdm&JiL4e_aLyL&xf3_n#_;<5Z&#s?`rn>!xj-C(U(AZh>g(6!DDZ4v{lL;}&oVEV0&L?VItl+O zHdf5p`%lw&{{H2E=f2)jzA>(L|5Z_ir-d`kwwV=fUGU#2*+F~$#${($HEgO$J0rB_ z)67{ds*F)T&q%1Q39?)4*%8d}^YrP@nWcv%9;e-?=f5@~^fu2`(FL9opFKBpwcPRy z_{%Xx=-*+(49^XH2WN09-32*>lhI>)3&WCVCx|=6RxwDXZD`jrVN5Mt#?r;G*1+4T zm@zD{jpdb`g7dY13$~hKNVPmOc6{A0eo*Q(zvE}o1ks$>xCL(*qXOM38_T$+v_?K{ g{Sgld0WU9mCDE;$Tc(Cjr>mdKI;Vst0OhOb#sB~S diff --git a/core/assets-raw/sprites/blocks/production/spore-press-frame1.png b/core/assets-raw/sprites/blocks/production/spore-press-frame1.png deleted file mode 100644 index 9b403cb9ceb691dba5e8b95b3de6e968908ede14..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 562 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|SkfJR9T^xl z_H+M9WCij$3p^r=85sBugD~Uq{1quc4aYrQ978JN-p(}iVsR93O=mrto$*Lj%*0U4 zQCZaYh{ur&9yW~~6K7~7rKIF6+A#ft+MF}KI|7KSC!E12HBn;-r2kS6P_hCLR+Os)rhzb#+B;hQb@8P+9>vg3ExKXFoMW_CSOU*9z4+J?PV zjhpMu{HAyP&;Q7E;govZeY>jfY@yOyt}Hvdis9x82|n?{WtY`CCol7ve_H?O+39@^ zf0{olB+mN8>FZ>}Iw9Gw@B1&v`t>-`SY0fJ>7+IjGqoxYRsSE))W?} zagWKr-~DL(t>ecNe4XAJN*FsXiFRVRq^pSPQYTRbX3=i}t!fJT=cYIaE)Y%gG!PHa zJ~bi1j(m)fJr;yMO-)e)jiA>1^}s&#(U9zKiJ; z=i92YnNdh)xgn^sLVUzE97`@nC9^FoV037c{nGfrG9r}`$i?$GOL<&01CFScEL zoVLT-x2tVUoOwBGMgE(gejEB*Ziz?lWjV$Fr~P(AXf1+%T+3k!TxD2rOFq4KEdfzj_c(Gwyk^(S!v^#MTw zpV)u90};nB|NQqhN3-_Lwe}tB^v=$F>hEXjxb(~Uuiv)ipIgfFq3Wljw$m<#t*803 z1TV2lXva3JyKVA4t3PoUgWy+=weuBH8#=yo%-`n-HC0Y7alPczOfg|;kbtMFpUXO@ GgeCxcB~R!8 literal 0 HcmV?d00001 diff --git a/core/assets-raw/sprites/blocks/production/spore-press-piston1.png b/core/assets-raw/sprites/blocks/production/spore-press-piston1.png new file mode 100644 index 0000000000000000000000000000000000000000..e1b46944abb2b98ef7c1dec9f9ac4da0c4879f29 GIT binary patch literal 219 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=jKx9jP7LeL$-D$|rh2+KhE&XX zdsUI|kby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v$!0`szUmqGvK0(O^dq5u*?7o!n7x_Kl23_gw&;S4c07*qoM6N<$g3H|kqW}N^ diff --git a/core/src/mindustry/content/Blocks.java b/core/src/mindustry/content/Blocks.java index 53fdf7ae10..8e27d2b8c0 100644 --- a/core/src/mindustry/content/Blocks.java +++ b/core/src/mindustry/content/Blocks.java @@ -1092,8 +1092,11 @@ public class Blocks{ hasPower = true; craftEffect = Fx.none; drawer = new DrawMulti( + new DrawRegion("-bottom"), + new DrawPistons(){{ + sinMag = 1f; + }}, new DrawDefault(), - new DrawFrames(), new DrawLiquidRegion(), new DrawRegion("-top") ); @@ -2298,7 +2301,18 @@ public class Blocks{ consume(new ConsumeItemFlammable()); consume(new ConsumeItemExplode()); - drawer = new DrawMulti(new DrawDefault(), new DrawWarmupRegion(), new DrawTurbines()); + drawer = new DrawMulti( + new DrawDefault(), + new DrawWarmupRegion(), + new DrawRegion("-turbine"){{ + rotateSpeed = 2f; + }}, + new DrawRegion("-turbine"){{ + rotateSpeed = -2f; + rotation = 45f; + }}, + new DrawRegion("-cap") + ); }}; differentialGenerator = new ConsumeGenerator("differential-generator"){{ diff --git a/core/src/mindustry/mod/ClassMap.java b/core/src/mindustry/mod/ClassMap.java index cd09d64cc5..c95603abac 100644 --- a/core/src/mindustry/mod/ClassMap.java +++ b/core/src/mindustry/mod/ClassMap.java @@ -447,7 +447,6 @@ public class ClassMap{ classes.put("DrawShape", mindustry.world.draw.DrawShape.class); classes.put("DrawSideRegion", mindustry.world.draw.DrawSideRegion.class); classes.put("DrawSpikes", mindustry.world.draw.DrawSpikes.class); - classes.put("DrawTurbines", mindustry.world.draw.DrawTurbines.class); classes.put("DrawTurret", mindustry.world.draw.DrawTurret.class); classes.put("DrawWarmupRegion", mindustry.world.draw.DrawWarmupRegion.class); classes.put("DrawWeave", mindustry.world.draw.DrawWeave.class); diff --git a/core/src/mindustry/world/draw/DrawRegion.java b/core/src/mindustry/world/draw/DrawRegion.java index df04838cfd..492310eafb 100644 --- a/core/src/mindustry/world/draw/DrawRegion.java +++ b/core/src/mindustry/world/draw/DrawRegion.java @@ -13,7 +13,7 @@ public class DrawRegion extends DrawBlock{ public String suffix = ""; public boolean spinSprite = false; public boolean drawPlan = true; - public float rotateSpeed, x, y; + public float rotateSpeed, x, y, rotation; /** Any number <=0 disables layer changes. */ public float layer = -1; @@ -29,9 +29,9 @@ public class DrawRegion extends DrawBlock{ float z = Draw.z(); if(layer > 0) Draw.z(layer); if(spinSprite){ - Drawf.spinSprite(region, build.x + x, build.y + y, build.totalProgress() * rotateSpeed); + Drawf.spinSprite(region, build.x + x, build.y + y, build.totalProgress() * rotateSpeed + rotation); }else{ - Draw.rect(region, build.x + x, build.y + y, build.totalProgress() * rotateSpeed); + Draw.rect(region, build.x + x, build.y + y, build.totalProgress() * rotateSpeed + rotation); } Draw.z(z); } diff --git a/core/src/mindustry/world/draw/DrawTurbines.java b/core/src/mindustry/world/draw/DrawTurbines.java deleted file mode 100644 index 11273d94aa..0000000000 --- a/core/src/mindustry/world/draw/DrawTurbines.java +++ /dev/null @@ -1,39 +0,0 @@ -package mindustry.world.draw; - -import arc.*; -import arc.graphics.g2d.*; -import mindustry.gen.*; -import mindustry.world.*; - -public class DrawTurbines extends DrawBlock{ - public TextureRegion[] turbines = new TextureRegion[2]; - public TextureRegion cap; - public float turbineSpeed = 2f; - - @Override - public void draw(Building build){ - float totalTime = build.totalProgress(); - Draw.rect(turbines[0], build.x, build.y, totalTime * turbineSpeed); - Draw.rect(turbines[1], build.x, build.y, -totalTime * turbineSpeed); - - if(cap.found()){ - Draw.rect(cap, build.x, build.y); - } - } - - @Override - public void load(Block block){ - super.load(block); - - cap = Core.atlas.find(block.name + "-cap"); - - for(int i = 0; i < 2; i++){ - turbines[i] = Core.atlas.find(block.name + "-turbine" + i); - } - } - - @Override - public TextureRegion[] icons(Block block){ - return new TextureRegion[]{turbines[0], turbines[1], cap}; - } -}