🐛 fix build tray background and buttons ignoring uiOpacity
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1259,7 +1259,7 @@ export class UIScene extends Phaser.Scene {
|
|||||||
const { width, height } = this.scale
|
const { width, height } = this.scale
|
||||||
const trayY = height - UIScene.BAR_H - UIScene.TRAY_H
|
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)
|
.setOrigin(0, 0).setScrollFactor(0).setDepth(300)
|
||||||
this.actionTrayGroup.add(bg)
|
this.actionTrayGroup.add(bg)
|
||||||
|
|
||||||
@@ -1275,10 +1275,10 @@ export class UIScene extends Phaser.Scene {
|
|||||||
const itemW = 84
|
const itemW = 84
|
||||||
buildings.forEach((b, i) => {
|
buildings.forEach((b, i) => {
|
||||||
const bx = 8 + i * (itemW + 4)
|
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()
|
.setOrigin(0, 0).setScrollFactor(0).setDepth(301).setInteractive()
|
||||||
btn.on('pointerover', () => btn.setFillStyle(0x2d4a2d, 0.9))
|
btn.on('pointerover', () => btn.setFillStyle(0x2d4a2d, this.uiOpacity))
|
||||||
btn.on('pointerout', () => btn.setFillStyle(0x1a2a1a, 0.9))
|
btn.on('pointerout', () => btn.setFillStyle(0x1a2a1a, this.uiOpacity))
|
||||||
btn.on('pointerdown', () => {
|
btn.on('pointerdown', () => {
|
||||||
this.closeActionTray()
|
this.closeActionTray()
|
||||||
this.deactivateCategory()
|
this.deactivateCategory()
|
||||||
|
|||||||
Reference in New Issue
Block a user