thead_split: add is traitor, fix icon scaling issue

This commit is contained in:
evanpelle
2025-01-21 18:53:35 -08:00
committed by Evan
parent ab183e4f59
commit 62a0642b4d
4 changed files with 8 additions and 2 deletions
+4
View File
@@ -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)
+1 -1
View File
@@ -166,7 +166,7 @@ export class PlayerView implements Player {
return []
}
isTraitor(): boolean {
return false
return this.data.isTraitor
}
canTarget(other: Player): boolean {
return false
+1
View File
@@ -429,6 +429,7 @@ export interface PlayerUpdate {
troops: number,
targetTroopRatio: number
alliances: number[]
isTraitor: boolean
}
+2 -1
View File
@@ -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(),
}
}