Vent condenser block

This commit is contained in:
Anuken
2021-12-09 17:16:32 -05:00
parent 8a2908374a
commit 57e5acdbd7
26 changed files with 222 additions and 75 deletions
@@ -13,6 +13,7 @@ public class DrawRegion extends DrawBlock{
public TextureRegion region;
public String suffix = "";
public boolean spinSprite = false;
public boolean drawPlan = true;
public float rotateSpeed, x, y;
/** Any number <=0 disables layer changes. */
public float layer = -1;
@@ -38,6 +39,7 @@ public class DrawRegion extends DrawBlock{
@Override
public void drawPlan(Block block, BuildPlan plan, Eachable<BuildPlan> list){
if(!drawPlan) return;
Draw.rect(region, plan.drawx(), plan.drawy());
}
@@ -168,6 +168,7 @@ public class DrawTurret extends DrawBlock{
progress = interp.apply(progress);
for(int i = 0; i < regions.length; i++){
//can be null if drawRegion == false
var region = regions[i];
float sign = i == 1 ? -1 : 1;
Tmp.v1.set((x + moveX * progress) * sign, y + moveY * progress).rotate((build.rotation - 90));
@@ -218,6 +219,8 @@ public class DrawTurret extends DrawBlock{
regions = new TextureRegion[]{Core.atlas.find(block.name + suffix)};
outlines = new TextureRegion[]{Core.atlas.find(block.name + suffix + "-outline")};
}
}else{
regions = new TextureRegion[1];
}
heat = Core.atlas.find(block.name + suffix + "-heat");