Fix video overlay

This commit is contained in:
Brian Fertig 2026-06-07 15:23:53 -06:00
parent e5c1021322
commit 0317d1c14f
1 changed files with 9 additions and 0 deletions

View File

@ -406,6 +406,9 @@ export default class MonopolyGame extends Phaser.Scene {
reg(o) { this.dyn.push(o); return o; } reg(o) { this.dyn.push(o); return o; }
clearDyn() { this.dyn.forEach(o => { try { o.destroy(); } catch {} }); this.dyn = []; } clearDyn() { this.dyn.forEach(o => { try { o.destroy(); } catch {} }); this.dyn = []; }
hidePortraits() { this.portraits.forEach(p => { if (p?.hide) p.hide(); }); }
showPortraits() { this.portraits.forEach(p => { if (p?.show) p.show(); }); }
render() { render() {
this.clearDyn(); this.clearDyn();
this.drawHousesHotels(); this.drawHousesHotels();
@ -415,6 +418,9 @@ export default class MonopolyGame extends Phaser.Scene {
if (this.gs.pendingCard) this.drawCardPopup(); if (this.gs.pendingCard) this.drawCardPopup();
if (this.gs.phase === 'auction' && this.gs.pendingAuction) this.drawAuctionPanel(); if (this.gs.phase === 'auction' && this.gs.pendingAuction) this.drawAuctionPanel();
if (this.modalActive && this.gs.phase === 'buy') this.drawModalBuyButtons(); if (this.modalActive && this.gs.phase === 'buy') this.drawModalBuyButtons();
// DOM video portraits always render above canvas — hide them during any overlay
if (this.gs.pendingCard || this.modalActive) this.hidePortraits();
else this.showPortraits();
} }
drawHousesHotels() { drawHousesHotels() {
@ -1411,6 +1417,9 @@ export default class MonopolyGame extends Phaser.Scene {
const scaleStart = geo.w / MODAL_W; const scaleStart = geo.w / MODAL_W;
const rotStart = -geo.rotation; const rotStart = -geo.rotation;
// Hide DOM portraits immediately — they render above canvas regardless of depth
this.hidePortraits();
// Dim overlay // Dim overlay
this.modalOverlay = this.add.rectangle(GAME_WIDTH/2, GAME_HEIGHT/2, GAME_WIDTH, GAME_HEIGHT, 0x000000, 0) this.modalOverlay = this.add.rectangle(GAME_WIDTH/2, GAME_HEIGHT/2, GAME_WIDTH, GAME_HEIGHT, 0x000000, 0)
.setDepth(DEPTH.popup - 2).setInteractive(); .setDepth(DEPTH.popup - 2).setInteractive();