From 62a0642b4d824fad9f7407e77cfb3fd655ba90a8 Mon Sep 17 00:00:00 2001 From: evanpelle Date: Tue, 21 Jan 2025 18:53:35 -0800 Subject: [PATCH] thead_split: add is traitor, fix icon scaling issue --- src/client/graphics/layers/NameLayer.ts | 4 ++++ src/core/GameView.ts | 2 +- src/core/game/Game.ts | 1 + src/core/game/PlayerImpl.ts | 3 ++- 4 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/client/graphics/layers/NameLayer.ts b/src/client/graphics/layers/NameLayer.ts index b45eec776..997569a0a 100644 --- a/src/client/graphics/layers/NameLayer.ts +++ b/src/client/graphics/layers/NameLayer.ts @@ -163,6 +163,10 @@ export class NameLayer implements Layer { iconsDiv.style.position = 'absolute' iconsDiv.style.display = 'flex' iconsDiv.style.zIndex = '1' // Lower z-index to appear behind + iconsDiv.style.width = '100%' // Add this + iconsDiv.style.height = '100%' // Add this + iconsDiv.style.top = '0' // Add this + iconsDiv.style.left = '0' // Add this element.appendChild(iconsDiv) this.container.appendChild(element) diff --git a/src/core/GameView.ts b/src/core/GameView.ts index fd551da65..9343b755c 100644 --- a/src/core/GameView.ts +++ b/src/core/GameView.ts @@ -166,7 +166,7 @@ export class PlayerView implements Player { return [] } isTraitor(): boolean { - return false + return this.data.isTraitor } canTarget(other: Player): boolean { return false diff --git a/src/core/game/Game.ts b/src/core/game/Game.ts index a62aabffc..1b2a8eba3 100644 --- a/src/core/game/Game.ts +++ b/src/core/game/Game.ts @@ -429,6 +429,7 @@ export interface PlayerUpdate { troops: number, targetTroopRatio: number alliances: number[] + isTraitor: boolean } diff --git a/src/core/game/PlayerImpl.ts b/src/core/game/PlayerImpl.ts index f3101a260..bf1577b49 100644 --- a/src/core/game/PlayerImpl.ts +++ b/src/core/game/PlayerImpl.ts @@ -76,7 +76,8 @@ export class PlayerImpl implements MutablePlayer { workers: this.workers(), troops: this.troops(), targetTroopRatio: this.targetTroopRatio(), - alliances: this.alliances().map(a => a.other(this).smallID()) + alliances: this.alliances().map(a => a.other(this).smallID()), + isTraitor: this.isTraitor(), } }