Unit selection overlay improvements
This commit is contained in:
@@ -131,7 +131,9 @@ public class OverlayRenderer{
|
||||
Building build = (select instanceof BlockUnitc b ? b.tile() : select instanceof Building b ? b : null);
|
||||
TextureRegion region = build != null ? build.block.fullIcon : select instanceof Unit u ? u.icon() : Core.atlas.white();
|
||||
|
||||
Draw.rect(region, select.getX(), select.getY(), select instanceof Unit u && !(select instanceof BlockUnitc) ? u.rotation - 90f : 0f);
|
||||
if(!(select instanceof Unitc)){
|
||||
Draw.rect(region, select.getX(), select.getY());
|
||||
}
|
||||
|
||||
for(int i = 0; i < 4; i++){
|
||||
float rot = i * 90f + 45f + (-Time.time) % 360f;
|
||||
@@ -255,6 +257,12 @@ public class OverlayRenderer{
|
||||
}
|
||||
}
|
||||
|
||||
public void checkApplySelection(Unit u){
|
||||
if(unitFade > 0 && lastSelect == u){
|
||||
Draw.mixcol(Pal.accent, unitFade);
|
||||
}
|
||||
}
|
||||
|
||||
private static class CoreEdge{
|
||||
float x1, y1, x2, y2;
|
||||
Team t1, t2;
|
||||
|
||||
@@ -1465,6 +1465,7 @@ public class UnitType extends UnlockableContent implements Senseable{
|
||||
}
|
||||
|
||||
public <T extends Unit & Tankc> void drawTank(T unit){
|
||||
applyColor(unit);
|
||||
Draw.rect(treadRegion, unit.x, unit.y, unit.rotation - 90);
|
||||
|
||||
if(treadRegion.found()){
|
||||
@@ -1636,6 +1637,10 @@ public class UnitType extends UnlockableContent implements Senseable{
|
||||
if(unit.drownTime > 0 && unit.lastDrownFloor != null){
|
||||
Draw.mixcol(Tmp.c1.set(unit.lastDrownFloor.mapColor).mul(0.83f), unit.drownTime * 0.9f);
|
||||
}
|
||||
//this is horribly scuffed.
|
||||
if(renderer != null && renderer.overlays != null){
|
||||
renderer.overlays.checkApplySelection(unit);
|
||||
}
|
||||
}
|
||||
|
||||
//endregion
|
||||
|
||||
Reference in New Issue
Block a user