diff --git a/src/client/TerritoryPatternsModal.ts b/src/client/TerritoryPatternsModal.ts index 99c6bfc51..69c21fca6 100644 --- a/src/client/TerritoryPatternsModal.ts +++ b/src/client/TerritoryPatternsModal.ts @@ -162,50 +162,11 @@ export class TerritoryPatternsModal extends LitElement { " > ${(() => { - const decoder = new PatternDecoder(pattern.pattern); - const cellCountX = decoder.getTileWidth(); - const cellCountY = decoder.getTileHeight(); - const cellSize = Math.floor( - this.buttonWidth / Math.max(cellCountX, cellCountY), + return this.renderPatternPreview( + pattern, + this.buttonWidth, + this.buttonWidth, ); - - return html` -
- ${(() => { - const tiles: TemplateResult[] = []; - for (let py = 0; py < cellCountY; py++) { - for (let px = 0; px < cellCountX; px++) { - const x = px * decoder.getScale(); - const y = py * decoder.getScale(); - const bit = decoder.isSet(x, y); - tiles.push(html` -
- `); - } - } - return tiles; - })()} -
- `; })()}