show incoming tradeships as green in alternate view

This commit is contained in:
evan
2025-04-23 13:46:19 -07:00
parent b13029591d
commit fe4396ebcd
+7 -1
View File
@@ -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();