progress
This commit is contained in:
@@ -34,4 +34,9 @@ class AllDefs{
|
||||
class sync{
|
||||
|
||||
}
|
||||
|
||||
@GroupDef(Drawc.class)
|
||||
class draw{
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,14 +8,14 @@ import mindustry.gen.*;
|
||||
|
||||
@EntityDef(value = {Decalc.class}, pooled = true)
|
||||
@Component
|
||||
abstract class DecalComp implements Drawc, Timedc, Rotc, Posc, DrawLayerFloorc{
|
||||
abstract class DecalComp implements Drawc, Timedc, Rotc, Posc{
|
||||
@Import float x, y, rotation;
|
||||
|
||||
Color color = new Color(1, 1, 1, 1);
|
||||
TextureRegion region;
|
||||
|
||||
@Override
|
||||
public void drawFloor(){
|
||||
public void draw(){
|
||||
Draw.color(color);
|
||||
Draw.alpha(1f - Mathf.curve(fin(), 0.98f));
|
||||
Draw.rect(region, x, y, rotation);
|
||||
|
||||
@@ -6,4 +6,8 @@ import mindustry.gen.*;
|
||||
@Component
|
||||
abstract class DrawComp implements Posc{
|
||||
abstract float clipSize();
|
||||
|
||||
void draw(){
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@ import mindustry.annotations.Annotations.*;
|
||||
import mindustry.gen.*;
|
||||
|
||||
@Component
|
||||
abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc, Unitc, Legsc, ElevationMovec{
|
||||
abstract class LegsComp implements Posc, Flyingc, Hitboxc, Unitc, Legsc, ElevationMovec{
|
||||
@Import float x, y;
|
||||
|
||||
float baseRotation;
|
||||
@@ -18,9 +18,4 @@ abstract class LegsComp implements Posc, Flyingc, Hitboxc, DrawLayerGroundUnderc
|
||||
baseRotation = Angles.moveToward(baseRotation, vel().angle(), type().baseRotateSpeed * Mathf.clamp(len / type().speed));
|
||||
walkTime += Time.delta()*len/1f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGroundUnder(){
|
||||
type().drawLegs(this);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ import mindustry.world.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@Component
|
||||
abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, DrawLayerGroundc{
|
||||
abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, Drawc{
|
||||
@Import float x, y, rotation;
|
||||
|
||||
transient float mineTimer;
|
||||
@@ -80,7 +80,7 @@ abstract class MinerComp implements Itemsc, Posc, Teamc, Rotc, DrawLayerGroundc{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGround(){
|
||||
public void draw(){
|
||||
if(!mining()) return;
|
||||
float focusLen = 4f + Mathf.absin(Time.time(), 1.1f, 0.5f);
|
||||
float swingScl = 12f, swingMag = tilesize / 8f;
|
||||
|
||||
@@ -18,8 +18,7 @@ import mindustry.world.blocks.environment.*;
|
||||
import static mindustry.Vars.*;
|
||||
|
||||
@Component
|
||||
abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitboxc, Rotc, Massc, Unitc, Weaponsc, Drawc, Boundedc,
|
||||
DrawLayerGroundc, DrawLayerFlyingc, DrawLayerGroundShadowsc, DrawLayerFlyingShadowsc, Syncc{
|
||||
abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitboxc, Rotc, Massc, Unitc, Weaponsc, Drawc, Boundedc, Syncc{
|
||||
@Import float x, y, rotation, elevation;
|
||||
|
||||
private UnitController controller;
|
||||
@@ -172,32 +171,7 @@ abstract class UnitComp implements Healthc, Velc, Statusc, Teamc, Itemsc, Hitbox
|
||||
|
||||
@Override
|
||||
public void draw(){
|
||||
type.drawEngine(this);
|
||||
type.drawBody(this);
|
||||
type.drawWeapons(this);
|
||||
if(type.drawCell) type.drawCell(this);
|
||||
if(type.drawItems) type.drawItems(this);
|
||||
type.drawLight(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFlyingShadows(){
|
||||
if(isFlying()) type.drawShadow(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGroundShadows(){
|
||||
type.drawOcclusion(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFlying(){
|
||||
if(isFlying()) draw();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawGround(){
|
||||
if(isGrounded()) draw();
|
||||
type.draw(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user