From fe4396ebcd5ef6e36b59216271a67b1c85f128a0 Mon Sep 17 00:00:00 2001 From: evan Date: Wed, 23 Apr 2025 13:46:19 -0700 Subject: [PATCH] show incoming tradeships as green in alternate view --- src/client/graphics/layers/UnitLayer.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/client/graphics/layers/UnitLayer.ts b/src/client/graphics/layers/UnitLayer.ts index 552470879..03bfd8b81 100644 --- a/src/client/graphics/layers/UnitLayer.ts +++ b/src/client/graphics/layers/UnitLayer.ts @@ -425,7 +425,13 @@ export class UnitLayer implements Layer { let alternateViewColor = null; if (this.alternateView) { - const rel = this.relationship(unit); + let rel = this.relationship(unit); + if (unit.type() == UnitType.TradeShip && unit.dstPortId() != null) { + const target = this.game.unit(unit.dstPortId())?.owner(); + if (this.game.myPlayer() != null && this.game.myPlayer() == target) { + rel = Relationship.Self; + } + } switch (rel) { case Relationship.Self: alternateViewColor = this.theme.selfColor();