This commit is contained in:
Aotumuri
2025-05-30 14:58:00 +09:00
parent 10846cc4a9
commit 6e924c24a9
4 changed files with 26 additions and 63 deletions
+4 -4
View File
@@ -82,7 +82,7 @@ export class territoryPatternsModal extends LitElement {
class="flex flex-wrap gap-4 p-2"
style="justify-content: center; align-items: flex-start;"
>
${Object.entries(territoryPatterns.patterns).map(([key, pattern]) => {
${Object.entries(territoryPatterns ?? {}).map(([key, pattern]) => {
const isLocked = this.isPatternLocked(key);
const reason = this.lockedReasons[key] || "Locked";
@@ -114,7 +114,7 @@ export class territoryPatternsModal extends LitElement {
"
>
${(() => {
const decoder = new PatternDecoder(pattern.patternBase64!);
const decoder = new PatternDecoder(pattern);
const cellCountX = decoder.getTileWidth();
const cellCountY = decoder.getTileHeight();
const cellSize = Math.floor(
@@ -186,12 +186,12 @@ export class territoryPatternsModal extends LitElement {
private updatePreview() {
if (!this.previewButton || !this.selectedPattern) return;
const pattern = territoryPatterns.patterns[this.selectedPattern];
const pattern = territoryPatterns[this.selectedPattern];
if (!pattern) return;
const fixedHeight = 48;
const fixedWidth = 48;
const decoder = new PatternDecoder(pattern.patternBase64!);
const decoder = new PatternDecoder(pattern);
const cellCountX = decoder.getTileWidth();
const cellCountY = decoder.getTileHeight();