Hide missiles on minimap

This commit is contained in:
Anuken
2022-09-16 08:59:28 -04:00
parent b28b628b17
commit 942a3796d7
3 changed files with 5 additions and 2 deletions

View File

@@ -123,7 +123,7 @@ public class MinimapRenderer{
rect.set((dx - sz) * tilesize, (dy - sz) * tilesize, sz * 2 * tilesize, sz * 2 * tilesize);
for(Unit unit : units){
if(unit.inFogTo(player.team())) continue;
if(unit.inFogTo(player.team()) || !unit.type.drawMinimap) continue;
float rx = !withLabels ? (unit.x - rect.x) / rect.width * w : unit.x / (world.width() * tilesize) * w;
float ry = !withLabels ? (unit.y - rect.y) / rect.width * h : unit.y / (world.height() * tilesize) * h;

View File

@@ -226,7 +226,9 @@ public class UnitType extends UnlockableContent{
/** if false, the unit shield (usually seen in waves) is not drawn. */
drawShields = true,
/** if false, the unit body is not drawn. */
drawBody = true;
drawBody = true,
/** if false, the unit is not drawn on the minimap. */
drawMinimap = true;
/** The default AI controller to assign on creation. */
public Prov<? extends UnitController> aiController = () -> !flying ? new GroundAI() : new FlyingAI();

View File

@@ -37,6 +37,7 @@ public class MissileUnitType extends UnitType{
fogRadius = 2f;
loopSound = Sounds.missileTrail;
loopSoundVolume = 0.05f;
drawMinimap = false;
//TODO weapon configs, etc?
}
}