mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-24 13:39:03 +07:00
Merge pull request #2738 from Voz-Duh/top-for-liquid-turrets
Top For Liquid Turrets
This commit is contained in:
commit
f4b6600a6d
BIN
core/assets-raw/sprites/blocks/turrets/wave-top.png
Normal file
BIN
core/assets-raw/sprites/blocks/turrets/wave-top.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 285 B |
@ -17,6 +17,7 @@ import static mindustry.Vars.tilesize;
|
||||
public class LiquidTurret extends Turret{
|
||||
public ObjectMap<Liquid, BulletType> ammoTypes = new ObjectMap<>();
|
||||
public @Load("@-liquid") TextureRegion liquidRegion;
|
||||
public @Load("@-top") TextureRegion topRegion;
|
||||
|
||||
public LiquidTurret(String name){
|
||||
super(name);
|
||||
@ -53,8 +54,12 @@ public class LiquidTurret extends Turret{
|
||||
});
|
||||
}
|
||||
|
||||
public class LiquidTurretBuild extends TurretBuild{
|
||||
@Override
|
||||
public TextureRegion[] icons(){
|
||||
return Core.atlas.isFound(topRegion) ? new TextureRegion[]{baseRegion, region, topRegion} : super.icons();
|
||||
}
|
||||
|
||||
public class LiquidTurretBuild extends TurretBuild{
|
||||
@Override
|
||||
public void draw(){
|
||||
super.draw();
|
||||
@ -63,8 +68,9 @@ public class LiquidTurret extends Turret{
|
||||
Draw.color(liquids.current().color);
|
||||
Draw.alpha(liquids.total() / liquidCapacity);
|
||||
Draw.rect(liquidRegion, x + tr2.x, y + tr2.y, rotation - 90);
|
||||
Draw.color();
|
||||
Draw.reset();
|
||||
}
|
||||
if(Core.atlas.isFound(topRegion)) Draw.rect(topRegion, x + tr2.x, y + tr2.y, rotation - 90);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Loading…
Reference in New Issue
Block a user