From 55e413c5288d4267d8f701360dad91298141a627 Mon Sep 17 00:00:00 2001 From: Lavodan <21205085+Lavodan@users.noreply.github.com> Date: Mon, 1 Dec 2025 04:38:35 +0100 Subject: [PATCH] Fix Territory Skins option (#2538) Resolves #2517 ## Description: Fixes territory skin option not doing anything. Also changes some instances of directly accessing "this.cosmetics.pattern" to use the precalculated "pattern" variable. ## Please complete the following: - [x] I have added screenshots for all UI updates - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory - [x] I confirm I have thoroughly tested these changes and take full responsibility for any bugs introduced ## Please put your Discord username so you can be contacted if a bug or regression is found: Lavodan --- src/core/game/GameView.ts | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/core/game/GameView.ts b/src/core/game/GameView.ts index 63ce987de..c525129d1 100644 --- a/src/core/game/GameView.ts +++ b/src/core/game/GameView.ts @@ -212,7 +212,9 @@ export class PlayerView { .theme() .borderColor(defaultTerritoryColor); - const pattern = this.cosmetics.pattern; + const pattern = userSettings.territoryPatterns() + ? this.cosmetics.pattern + : undefined; if (pattern) { pattern.colorPalette ??= { name: "", @@ -224,7 +226,7 @@ export class PlayerView { if (this.team() === null) { this._territoryColor = colord( this.cosmetics.color?.color ?? - this.cosmetics.pattern?.colorPalette?.primaryColor ?? + pattern?.colorPalette?.primaryColor ?? defaultTerritoryColor.toHex(), ); } else { @@ -253,9 +255,9 @@ export class PlayerView { .defendedBorderColors(this._borderColor); this.decoder = - this.cosmetics.pattern === undefined + pattern === undefined ? undefined - : new PatternDecoder(this.cosmetics.pattern, base64url.decode); + : new PatternDecoder(pattern, base64url.decode); } territoryColor(tile?: TileRef): Colord {