mirror of
https://github.com/Anuken/Mindustry.git
synced 2025-02-02 04:13:44 +07:00
Full unit payload drawing
This commit is contained in:
parent
437fea686b
commit
b35c435ebd
@ -431,6 +431,8 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||||||
public TextureRegion[] wreckRegions, segmentRegions, segmentOutlineRegions;
|
public TextureRegion[] wreckRegions, segmentRegions, segmentOutlineRegions;
|
||||||
public TextureRegion[][] treadRegions;
|
public TextureRegion[][] treadRegions;
|
||||||
|
|
||||||
|
//INTERNAL REQUIREMENTS
|
||||||
|
|
||||||
protected float buildTime = -1f;
|
protected float buildTime = -1f;
|
||||||
protected @Nullable ItemStack[] totalRequirements, cachedRequirements, firstRequirements;
|
protected @Nullable ItemStack[] totalRequirements, cachedRequirements, firstRequirements;
|
||||||
|
|
||||||
@ -1183,6 +1185,8 @@ public class UnitType extends UnlockableContent implements Senseable{
|
|||||||
|
|
||||||
//region drawing
|
//region drawing
|
||||||
|
|
||||||
|
|
||||||
|
/** Set up drawing state before calling! e.g. drawingPayload */
|
||||||
public void draw(Unit unit){
|
public void draw(Unit unit){
|
||||||
if(unit.inFogTo(Vars.player.team())) return;
|
if(unit.inFogTo(Vars.player.team())) return;
|
||||||
|
|
||||||
|
@ -146,19 +146,10 @@ public class UnitPayload implements Payload{
|
|||||||
//TODO should not happen
|
//TODO should not happen
|
||||||
if(unit.type == null) return;
|
if(unit.type == null) return;
|
||||||
|
|
||||||
//TODO this would be more accurate but has all sorts of associated problems (?)
|
|
||||||
if(false){
|
|
||||||
float e = unit.elevation;
|
float e = unit.elevation;
|
||||||
unit.elevation = 0f;
|
unit.elevation = 0f;
|
||||||
//avoids drawing mining or building
|
|
||||||
unit.type.draw(unit);
|
unit.type.draw(unit);
|
||||||
unit.elevation = e;
|
unit.elevation = e;
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
unit.type.drawSoftShadow(unit);
|
|
||||||
Draw.rect(unit.type.fullIcon, unit.x, unit.y, unit.rotation - 90);
|
|
||||||
unit.type.drawCell(unit);
|
|
||||||
|
|
||||||
//draw warning
|
//draw warning
|
||||||
if(overlayTime > 0){
|
if(overlayTime > 0){
|
||||||
|
Loading…
Reference in New Issue
Block a user