From 78c184c560ed8c474118f4fcc9b7160b013db287 Mon Sep 17 00:00:00 2001 From: tekki mariani Date: Tue, 24 Mar 2026 17:00:08 +0000 Subject: [PATCH 1/4] =?UTF-8?q?=F0=9F=90=9B=20fix=20uiOpacity=20on=20stock?= =?UTF-8?q?pile=20panel=20and=20action=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #39, closes #40. Co-Authored-By: Claude Sonnet 4.6 --- CHANGELOG.md | 4 ++++ src/scenes/UIScene.ts | 7 ++++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 86a7b03..ca2999b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ Format follows [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] +### Fixed +- **Stockpile-Overlay Transparenz** (Issue #39): `updateStaticPanelOpacity()` verwendete `setAlpha()` statt `setFillStyle()` — dadurch wurde die Opacity quadratisch statt linear angewendet; bei 100 % blieb das Panel sichtbar transparent +- **Action Bar Transparenz** (Issue #40): Action Bar ignorierte `uiOpacity` komplett — Hintergrund war hardcoded auf 0.92; wird jetzt korrekt mit `uiOpacity` erstellt und per `updateStaticPanelOpacity()` live aktualisiert + ### Performance - **Event-queue timers** (Issue #36): crops, tree seedlings, and tile-recovery events now use a sorted priority queue with absolute `gameTime` timestamps instead of per-frame countdown iteration — O(due items) per tick instead of O(total items); `WorldState.gameTime` tracks the in-game clock; save migrated from v5 to v6 diff --git a/src/scenes/UIScene.ts b/src/scenes/UIScene.ts index 770bf89..6c9cfda 100644 --- a/src/scenes/UIScene.ts +++ b/src/scenes/UIScene.ts @@ -783,11 +783,12 @@ export class UIScene extends Phaser.Scene { /** * Applies the current uiOpacity to all static UI elements that are not - * rebuilt on open (stockpile panel, debug panel background). + * rebuilt on open (stockpile panel, action bar, debug panel background). * Called whenever uiOpacity changes. */ private updateStaticPanelOpacity(): void { - this.stockpilePanel.setAlpha(this.uiOpacity) + this.stockpilePanel.setFillStyle(0x000000, this.uiOpacity) + this.actionBarBg.setFillStyle(0x080808, this.uiOpacity) const hexAlpha = Math.round(this.uiOpacity * 255).toString(16).padStart(2, '0') this.debugPanelText.setStyle({ backgroundColor: `#000000${hexAlpha}` }) } @@ -1169,7 +1170,7 @@ export class UIScene extends Phaser.Scene { const { width, height } = this.scale const barY = height - UIScene.BAR_H - this.actionBarBg = this.add.rectangle(0, barY, width, UIScene.BAR_H, 0x080808, 0.92) + this.actionBarBg = this.add.rectangle(0, barY, width, UIScene.BAR_H, 0x080808, this.uiOpacity) .setOrigin(0, 0).setScrollFactor(0).setDepth(300) this.actionBuildBtn = this.add.rectangle(8, barY + 8, 88, 32, 0x1a3a1a, 0.9) -- 2.49.1 From 24ee3257df7d337817f5396a4ed8718759647b22 Mon Sep 17 00:00:00 2001 From: tekki mariani Date: Tue, 24 Mar 2026 17:05:11 +0000 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=90=9B=20fix=20action=20bar=20buttons?= =?UTF-8?q?=20also=20ignoring=20uiOpacity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build, Nisse buttons and hover states all had hardcoded 0.9 alpha. updateStaticPanelOpacity() now calls updateCategoryHighlights() so live changes take effect immediately. Co-Authored-By: Claude Sonnet 4.6 --- src/scenes/UIScene.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/scenes/UIScene.ts b/src/scenes/UIScene.ts index 6c9cfda..237c769 100644 --- a/src/scenes/UIScene.ts +++ b/src/scenes/UIScene.ts @@ -789,6 +789,7 @@ export class UIScene extends Phaser.Scene { private updateStaticPanelOpacity(): void { this.stockpilePanel.setFillStyle(0x000000, this.uiOpacity) this.actionBarBg.setFillStyle(0x080808, this.uiOpacity) + this.updateCategoryHighlights() const hexAlpha = Math.round(this.uiOpacity * 255).toString(16).padStart(2, '0') this.debugPanelText.setStyle({ backgroundColor: `#000000${hexAlpha}` }) } @@ -1173,13 +1174,13 @@ export class UIScene extends Phaser.Scene { this.actionBarBg = this.add.rectangle(0, barY, width, UIScene.BAR_H, 0x080808, this.uiOpacity) .setOrigin(0, 0).setScrollFactor(0).setDepth(300) - this.actionBuildBtn = this.add.rectangle(8, barY + 8, 88, 32, 0x1a3a1a, 0.9) + this.actionBuildBtn = this.add.rectangle(8, barY + 8, 88, 32, 0x1a3a1a, this.uiOpacity) .setOrigin(0, 0).setScrollFactor(0).setDepth(301).setInteractive() this.actionBuildBtn.on('pointerover', () => { - if (this.activeCategory !== 'build') this.actionBuildBtn.setFillStyle(0x2a5a2a, 0.9) + if (this.activeCategory !== 'build') this.actionBuildBtn.setFillStyle(0x2a5a2a, this.uiOpacity) }) this.actionBuildBtn.on('pointerout', () => { - if (this.activeCategory !== 'build') this.actionBuildBtn.setFillStyle(0x1a3a1a, 0.9) + if (this.activeCategory !== 'build') this.actionBuildBtn.setFillStyle(0x1a3a1a, this.uiOpacity) }) this.actionBuildBtn.on('pointerdown', () => this.toggleCategory('build')) @@ -1187,13 +1188,13 @@ export class UIScene extends Phaser.Scene { fontSize: '12px', color: '#cccccc', fontFamily: 'monospace', }).setOrigin(0.5, 0.5).setScrollFactor(0).setDepth(302) - this.actionNisseBtn = this.add.rectangle(104, barY + 8, 88, 32, 0x1a1a3a, 0.9) + this.actionNisseBtn = this.add.rectangle(104, barY + 8, 88, 32, 0x1a1a3a, this.uiOpacity) .setOrigin(0, 0).setScrollFactor(0).setDepth(301).setInteractive() this.actionNisseBtn.on('pointerover', () => { - if (this.activeCategory !== 'nisse') this.actionNisseBtn.setFillStyle(0x2a2a5a, 0.9) + if (this.activeCategory !== 'nisse') this.actionNisseBtn.setFillStyle(0x2a2a5a, this.uiOpacity) }) this.actionNisseBtn.on('pointerout', () => { - if (this.activeCategory !== 'nisse') this.actionNisseBtn.setFillStyle(0x1a1a3a, 0.9) + if (this.activeCategory !== 'nisse') this.actionNisseBtn.setFillStyle(0x1a1a3a, this.uiOpacity) }) this.actionNisseBtn.on('pointerdown', () => this.toggleCategory('nisse')) @@ -1241,8 +1242,8 @@ export class UIScene extends Phaser.Scene { * to reflect the current active category. */ private updateCategoryHighlights(): void { - this.actionBuildBtn.setFillStyle(this.activeCategory === 'build' ? 0x3d7a3d : 0x1a3a1a, 0.9) - this.actionNisseBtn.setFillStyle(this.activeCategory === 'nisse' ? 0x3d3d7a : 0x1a1a3a, 0.9) + this.actionBuildBtn.setFillStyle(this.activeCategory === 'build' ? 0x3d7a3d : 0x1a3a1a, this.uiOpacity) + this.actionNisseBtn.setFillStyle(this.activeCategory === 'nisse' ? 0x3d3d7a : 0x1a1a3a, this.uiOpacity) } /** -- 2.49.1 From 84aa1a7ce589d6047663916381ec09d7baa19144 Mon Sep 17 00:00:00 2001 From: tekki mariani Date: Tue, 24 Mar 2026 17:07:54 +0000 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=90=9B=20fix=20build=20tray=20backgro?= =?UTF-8?q?und=20and=20buttons=20ignoring=20uiOpacity?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- src/scenes/UIScene.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scenes/UIScene.ts b/src/scenes/UIScene.ts index 237c769..9d12b43 100644 --- a/src/scenes/UIScene.ts +++ b/src/scenes/UIScene.ts @@ -1259,7 +1259,7 @@ export class UIScene extends Phaser.Scene { const { width, height } = this.scale const trayY = height - UIScene.BAR_H - UIScene.TRAY_H - const bg = this.add.rectangle(0, trayY, width, UIScene.TRAY_H, 0x0d0d0d, 0.88) + const bg = this.add.rectangle(0, trayY, width, UIScene.TRAY_H, 0x0d0d0d, this.uiOpacity) .setOrigin(0, 0).setScrollFactor(0).setDepth(300) this.actionTrayGroup.add(bg) @@ -1275,10 +1275,10 @@ export class UIScene extends Phaser.Scene { const itemW = 84 buildings.forEach((b, i) => { const bx = 8 + i * (itemW + 4) - const btn = this.add.rectangle(bx, trayY + 4, itemW, UIScene.TRAY_H - 8, 0x1a2a1a, 0.9) + const btn = this.add.rectangle(bx, trayY + 4, itemW, UIScene.TRAY_H - 8, 0x1a2a1a, this.uiOpacity) .setOrigin(0, 0).setScrollFactor(0).setDepth(301).setInteractive() - btn.on('pointerover', () => btn.setFillStyle(0x2d4a2d, 0.9)) - btn.on('pointerout', () => btn.setFillStyle(0x1a2a1a, 0.9)) + btn.on('pointerover', () => btn.setFillStyle(0x2d4a2d, this.uiOpacity)) + btn.on('pointerout', () => btn.setFillStyle(0x1a2a1a, this.uiOpacity)) btn.on('pointerdown', () => { this.closeActionTray() this.deactivateCategory() -- 2.49.1 From f78645bb791947cc0ceb8b5d80a70e563fcfb7ea Mon Sep 17 00:00:00 2001 From: tekki mariani Date: Tue, 24 Mar 2026 17:12:30 +0000 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=90=9B=20fix=20seam=20between=20actio?= =?UTF-8?q?n=20tray=20and=20bar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Tray bg now covers bar area (TRAY_H + BAR_H), actionBarBg is hidden while tray is open to avoid double-transparency artifacts. Co-Authored-By: Claude Sonnet 4.6 --- src/scenes/UIScene.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/scenes/UIScene.ts b/src/scenes/UIScene.ts index 9d12b43..d1c37e9 100644 --- a/src/scenes/UIScene.ts +++ b/src/scenes/UIScene.ts @@ -1255,12 +1255,13 @@ export class UIScene extends Phaser.Scene { this.actionTrayVisible = true this.actionTrayGroup.destroy(true) this.actionTrayGroup = this.add.group() + this.actionBarBg.setAlpha(0) const { width, height } = this.scale const trayY = height - UIScene.BAR_H - UIScene.TRAY_H - const bg = this.add.rectangle(0, trayY, width, UIScene.TRAY_H, 0x0d0d0d, this.uiOpacity) - .setOrigin(0, 0).setScrollFactor(0).setDepth(300) + const bg = this.add.rectangle(0, trayY, width, UIScene.TRAY_H + UIScene.BAR_H, 0x080808, this.uiOpacity) + .setOrigin(0, 0).setScrollFactor(0).setDepth(299) this.actionTrayGroup.add(bg) const buildings: { kind: BuildingType; emoji: string; label: string }[] = [ @@ -1305,6 +1306,7 @@ export class UIScene extends Phaser.Scene { this.actionTrayVisible = false this.actionTrayGroup.destroy(true) this.actionTrayGroup = this.add.group() + this.actionBarBg.setAlpha(1) } // ─── Resize ─────────────────────────────────────────────────────────────── -- 2.49.1