mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-03-12 19:09:34 +07:00
why is this hardcoded anyway (#7617)
This commit is contained in:
parent
c818611bb4
commit
fd0d4fb097
@ -12,10 +12,15 @@ import mindustry.world.blocks.production.HeatCrafter.*;
|
|||||||
public class DrawHeatRegion extends DrawBlock{
|
public class DrawHeatRegion extends DrawBlock{
|
||||||
public Color color = new Color(1f, 0.22f, 0.22f, 0.8f);
|
public Color color = new Color(1f, 0.22f, 0.22f, 0.8f);
|
||||||
public float pulse = 0.3f, pulseScl = 10f;
|
public float pulse = 0.3f, pulseScl = 10f;
|
||||||
|
public float layer = Layer.blockAdditive;
|
||||||
|
|
||||||
public TextureRegion heat;
|
public TextureRegion heat;
|
||||||
public String suffix = "-glow";
|
public String suffix = "-glow";
|
||||||
|
|
||||||
|
public DrawHeatRegion(float layer){
|
||||||
|
this.layer = layer;
|
||||||
|
}
|
||||||
|
|
||||||
public DrawHeatRegion(String suffix){
|
public DrawHeatRegion(String suffix){
|
||||||
this.suffix = suffix;
|
this.suffix = suffix;
|
||||||
}
|
}
|
||||||
@ -27,13 +32,16 @@ public class DrawHeatRegion extends DrawBlock{
|
|||||||
public void draw(Building build){
|
public void draw(Building build){
|
||||||
Draw.z(Layer.blockAdditive);
|
Draw.z(Layer.blockAdditive);
|
||||||
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
if(build instanceof HeatCrafterBuild hc && hc.heat > 0){
|
||||||
|
|
||||||
|
float z = Draw.z();
|
||||||
|
if(layer > 0) Draw.z(layer);
|
||||||
Draw.blend(Blending.additive);
|
Draw.blend(Blending.additive);
|
||||||
Draw.color(color, Mathf.clamp(hc.heat / hc.heatRequirement()) * (color.a * (1f - pulse + Mathf.absin(pulseScl, pulse))));
|
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.rect(heat, build.x, build.y);
|
||||||
Draw.blend();
|
Draw.blend();
|
||||||
Draw.color();
|
Draw.color();
|
||||||
|
Draw.z(z);
|
||||||
}
|
}
|
||||||
Draw.z(Layer.block);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
Loading…
Reference in New Issue
Block a user