diff --git a/src/client/graphics/layers/TerritoryLayer.ts b/src/client/graphics/layers/TerritoryLayer.ts index 945ac3524..c8ba09200 100644 --- a/src/client/graphics/layers/TerritoryLayer.ts +++ b/src/client/graphics/layers/TerritoryLayer.ts @@ -2,7 +2,12 @@ import { PriorityQueue } from "@datastructures-js/priority-queue"; import { Colord } from "colord"; import { Theme } from "../../../core/configuration/Config"; import { EventBus } from "../../../core/EventBus"; -import { Cell, PlayerType, UnitType } from "../../../core/game/Game"; +import { + Cell, + ColoredTeams, + PlayerType, + UnitType, +} from "../../../core/game/Game"; import { euclDistFN, TileRef } from "../../../core/game/GameMap"; import { GameUpdateType } from "../../../core/game/GameUpdates"; import { GameView, PlayerView } from "../../../core/game/GameView"; @@ -170,6 +175,7 @@ export class TerritoryLayer implements Layer { .filter((p) => p.type() === PlayerType.Human); const focusedPlayer = this.game.focusedPlayer(); + const teamColors = Object.values(ColoredTeams); for (const human of humans) { if (human === focusedPlayer) { continue; @@ -191,7 +197,17 @@ export class TerritoryLayer implements Layer { // In Team games, the spawn highlight color becomes that player's team color // Optionally, this could be broken down to teammate or enemy and simplified to green and red, respectively const team = human.team(); - if (team !== null) color = this.theme.teamColor(team); + if (team !== null) { + if (teamColors.includes(team)) { + color = this.theme.teamColor(team); + } else { + if (myPlayer.isFriendly(human)) { + color = this.theme.spawnHighlightTeamColor(); + } else { + color = this.theme.spawnHighlightColor(); + } + } + } } for (const tile of this.game.bfs(