From 78c184c560ed8c474118f4fcc9b7160b013db287 Mon Sep 17 00:00:00 2001 From: tekki mariani Date: Tue, 24 Mar 2026 17:00:08 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20uiOpacity=20on=20stockpile?= =?UTF-8?q?=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)