From fd0d4fb09720b4fdf32eddd9ac872b6702417c62 Mon Sep 17 00:00:00 2001 From: null <89076920+stacktrace-error@users.noreply.github.com> Date: Sat, 24 Sep 2022 13:49:54 +0200 Subject: [PATCH] why is this hardcoded anyway (#7617) --- core/src/mindustry/world/draw/DrawHeatRegion.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/core/src/mindustry/world/draw/DrawHeatRegion.java b/core/src/mindustry/world/draw/DrawHeatRegion.java index 8b2ccd129d..7c42f9c228 100644 --- a/core/src/mindustry/world/draw/DrawHeatRegion.java +++ b/core/src/mindustry/world/draw/DrawHeatRegion.java @@ -12,10 +12,15 @@ import mindustry.world.blocks.production.HeatCrafter.*; public class DrawHeatRegion extends DrawBlock{ public Color color = new Color(1f, 0.22f, 0.22f, 0.8f); public float pulse = 0.3f, pulseScl = 10f; + public float layer = Layer.blockAdditive; public TextureRegion heat; public String suffix = "-glow"; + public DrawHeatRegion(float layer){ + this.layer = layer; + } + public DrawHeatRegion(String suffix){ this.suffix = suffix; } @@ -27,13 +32,16 @@ public class DrawHeatRegion extends DrawBlock{ public void draw(Building build){ Draw.z(Layer.blockAdditive); if(build instanceof HeatCrafterBuild hc && hc.heat > 0){ + + float z = Draw.z(); + if(layer > 0) Draw.z(layer); Draw.blend(Blending.additive); Draw.color(color, Mathf.clamp(hc.heat / hc.heatRequirement()) * (color.a * (1f - pulse + Mathf.absin(pulseScl, pulse)))); Draw.rect(heat, build.x, build.y); Draw.blend(); Draw.color(); + Draw.z(z); } - Draw.z(Layer.block); } @Override