Skip to content

Commit 55e413c

Browse files
authored
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
1 parent 5d513df commit 55e413c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

src/core/game/GameView.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,9 @@ export class PlayerView {
212212
.theme()
213213
.borderColor(defaultTerritoryColor);
214214

215-
const pattern = this.cosmetics.pattern;
215+
const pattern = userSettings.territoryPatterns()
216+
? this.cosmetics.pattern
217+
: undefined;
216218
if (pattern) {
217219
pattern.colorPalette ??= {
218220
name: "",
@@ -224,7 +226,7 @@ export class PlayerView {
224226
if (this.team() === null) {
225227
this._territoryColor = colord(
226228
this.cosmetics.color?.color ??
227-
this.cosmetics.pattern?.colorPalette?.primaryColor ??
229+
pattern?.colorPalette?.primaryColor ??
228230
defaultTerritoryColor.toHex(),
229231
);
230232
} else {
@@ -253,9 +255,9 @@ export class PlayerView {
253255
.defendedBorderColors(this._borderColor);
254256

255257
this.decoder =
256-
this.cosmetics.pattern === undefined
258+
pattern === undefined
257259
? undefined
258-
: new PatternDecoder(this.cosmetics.pattern, base64url.decode);
260+
: new PatternDecoder(pattern, base64url.decode);
259261
}
260262

261263
territoryColor(tile?: TileRef): Colord {

0 commit comments

Comments
 (0)