From 24ee3257df7d337817f5396a4ed8718759647b22 Mon Sep 17 00:00:00 2001 From: tekki mariani Date: Tue, 24 Mar 2026 17:05:11 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20action=20bar=20buttons=20a?= =?UTF-8?q?lso=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) } /**