Duct transparent color tweak

This commit is contained in:
Anuken
2022-04-18 22:43:44 -04:00
parent 0915598d64
commit 1fc983bd4e

View File

@@ -1,6 +1,7 @@
package mindustry.world.blocks.distribution; package mindustry.world.blocks.distribution;
import arc.*; import arc.*;
import arc.graphics.*;
import arc.graphics.g2d.*; import arc.graphics.g2d.*;
import arc.math.*; import arc.math.*;
import arc.math.geom.*; import arc.math.geom.*;
@@ -24,6 +25,7 @@ import static mindustry.Vars.*;
public class Duct extends Block implements Autotiler{ public class Duct extends Block implements Autotiler{
public float speed = 5f; public float speed = 5f;
public boolean armored = false; public boolean armored = false;
public Color transparentColor = new Color(0.4f, 0.4f, 0.4f, 0.1f);
public @Load(value = "@-top-#", length = 5) TextureRegion[] topRegions; public @Load(value = "@-top-#", length = 5) TextureRegion[] topRegions;
public @Load(value = "@-bottom-#", length = 5, fallback = "duct-bottom-#") TextureRegion[] botRegions; public @Load(value = "@-bottom-#", length = 5, fallback = "duct-bottom-#") TextureRegion[] botRegions;
@@ -143,7 +145,7 @@ public class Duct extends Block implements Autotiler{
Draw.rect(sliced(botRegions[bits], slice), x, y, rotation); Draw.rect(sliced(botRegions[bits], slice), x, y, rotation);
Draw.z(Layer.blockUnder + 0.2f); Draw.z(Layer.blockUnder + 0.2f);
Draw.color(0.4f, 0.4f, 0.4f, 0.4f); Draw.color(transparentColor);
Draw.rect(sliced(botRegions[bits], slice), x, y, rotation); Draw.rect(sliced(botRegions[bits], slice), x, y, rotation);
Draw.color(); Draw.color();
Draw.rect(sliced(topRegions[bits], slice), x, y, rotation); Draw.rect(sliced(topRegions[bits], slice), x, y, rotation);