Merge branch 'master' of https://github.com/Anuken/Mindustry
Before Width: | Height: | Size: 206 B After Width: | Height: | Size: 206 B |
Before Width: | Height: | Size: 260 B |
BIN
core/assets-raw/sprites/blocks/production/spore-press-bottom.png
Normal file
After Width: | Height: | Size: 222 B |
Before Width: | Height: | Size: 568 B |
Before Width: | Height: | Size: 562 B |
Before Width: | Height: | Size: 531 B |
After Width: | Height: | Size: 217 B |
After Width: | Height: | Size: 219 B |
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
@ -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"){{
|
||||
|
@ -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);
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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};
|
||||
}
|
||||
}
|