From ec68fa142c6fb0b5e1511acf05c1a27b038833c6 Mon Sep 17 00:00:00 2001 From: Brian Fertig Date: Tue, 8 Sep 2026 10:32:46 -0600 Subject: [PATCH] Fix frozen video feed on window reopen and add construct SFX MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Use `video.resume()` instead of `video.play()` in Build, Map, Quest, and Research windows: Phaser v4's `play()` is a no-op after `pause()` because the `_playCalled` flag stays true, leaving the feed frozen after close → reopen. `resume()` handles both first open and re-open. - Play the 'construct' SFX when the planet HUD lines start their scramble-decode animation in SurfaceScene. --- js/scenes/SurfaceScene.js | 1 + js/ui/BuildWindow.js | 7 ++++++- js/ui/MapWindow.js | 7 ++++++- js/ui/QuestWindow.js | 7 ++++++- js/ui/ResearchWindow.js | 7 ++++++- 5 files changed, 25 insertions(+), 4 deletions(-) diff --git a/js/scenes/SurfaceScene.js b/js/scenes/SurfaceScene.js index 9a56405..42fbe14 100644 --- a/js/scenes/SurfaceScene.js +++ b/js/scenes/SurfaceScene.js @@ -446,6 +446,7 @@ export class SurfaceScene extends Phaser.Scene { if (!this.hudLines) return; if (this.hudT0 === null) { this.hudT0 = time; + this.playSfx('construct'); // the planet info starts typing in (data/sfx.json → construct) for (const ln of this.hudLines) ln.dec = new ScrambleDecode(ln.value, time + ln.delay, ln.dur); } let done = true; diff --git a/js/ui/BuildWindow.js b/js/ui/BuildWindow.js index 78a324c..472e4f3 100644 --- a/js/ui/BuildWindow.js +++ b/js/ui/BuildWindow.js @@ -1233,7 +1233,12 @@ export class BuildWindow extends Phaser.GameObjects.Container { this._paintAll(this.activeCat); this._paintStatusStrip(); - this.video?.play?.(); + // resume() not play(): v4's play() is a no-op after pause() (its + // _playCalled flag stays true, so the native play() is never + // re-issued) — the feed would stay frozen after close → reopen. + // resume() handles both a first open (delegates to play()) and a + // re-open of a paused clip. + this.video?.resume?.(); this.sfx('ui_window'); this._startReveal(); diff --git a/js/ui/MapWindow.js b/js/ui/MapWindow.js index 24f0a38..7faa65f 100644 --- a/js/ui/MapWindow.js +++ b/js/ui/MapWindow.js @@ -2171,7 +2171,12 @@ export class MapWindow extends Phaser.GameObjects.Container { if (this.openState === 'open' || this.openState === 'opening') return; this.openState = 'opening'; this.setAlpha(0); - this.video?.play?.(); + // resume() not play(): v4's play() is a no-op after pause() (its + // _playCalled flag stays true, so the native play() is never + // re-issued) — the feed would stay frozen after close → reopen. + // resume() handles both a first open (delegates to play()) and a + // re-open of a paused clip. + this.video?.resume?.(); this.sfx('ui_window'); const now = this.scene.time.now; this._startReveal(now); diff --git a/js/ui/QuestWindow.js b/js/ui/QuestWindow.js index 22085af..d23431e 100644 --- a/js/ui/QuestWindow.js +++ b/js/ui/QuestWindow.js @@ -1065,7 +1065,12 @@ export class QuestWindow extends Phaser.GameObjects.Container { if (this.openState === 'open' || this.openState === 'opening') return; this.openState = 'opening'; this.setAlpha(0); - this.video?.play?.(); + // resume() not play(): v4's play() is a no-op after pause() (its + // _playCalled flag stays true, so the native play() is never + // re-issued) — the feed would stay frozen after close → reopen. + // resume() handles both a first open (delegates to play()) and a + // re-open of a paused clip. + this.video?.resume?.(); this.sfx('ui_window'); this._startReveal(this.scene.time.now); } diff --git a/js/ui/ResearchWindow.js b/js/ui/ResearchWindow.js index 0cb57c8..b96de82 100644 --- a/js/ui/ResearchWindow.js +++ b/js/ui/ResearchWindow.js @@ -1269,7 +1269,12 @@ export class ResearchWindow extends Phaser.GameObjects.Container { this._paintAll(this.activeCat); this._paintStatusStrip(); - this.video?.play?.(); + // resume() not play(): v4's play() is a no-op after pause() (its + // _playCalled flag stays true, so the native play() is never + // re-issued) — the feed would stay frozen after close → reopen. + // resume() handles both a first open (delegates to play()) and a + // re-open of a paused clip. + this.video?.resume?.(); this.sfx('ui_window'); this._startReveal(); }