Skip to content

Commit 6e31c20

Browse files
The64thRealmclaude
andcommitted
dev: hide loading overlay on loadComplete() instead of init()
The `wavedash dev` init gate polled window.Wavedash.initialized, which is only set by Wavedash.init(). Both prod loaders (the play embed spinner and the mainsite GameSessionFrame loader) instead key off loadComplete() / gameLoaded, which the engine default entrypoints call automatically. A Godot/Unity game that never calls init() therefore spun forever under `wavedash dev` while clearing fine on the site. Gate the overlay on window.Wavedash.gameLoaded for parity with prod, and update the 10s timeout message to reference loadComplete(). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent db36df7 commit 6e31c20

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/dev/dev.js

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@
2424
}
2525
});
2626

27-
// Covers the page until the game calls Wavedash.init() — stricter than
28-
// prod's gate, deliberately. Translucent so engine loading UI shows through.
27+
// Covers the page until the game signals Wavedash.loadComplete() — the same
28+
// signal prod's loader waits for. Translucent so engine loading UI shows through.
2929
function initGate() {
30-
if (window.Wavedash.initialized) return;
30+
if (window.Wavedash.gameLoaded) return;
3131
var style = document.createElement('style');
3232
style.textContent = '@keyframes wd-spin{to{transform:rotate(360deg)}}';
3333
var spinner = document.createElement('div');
@@ -45,7 +45,7 @@
4545
document.body.append(overlay);
4646
var started = Date.now();
4747
var tick = setInterval(function () {
48-
if (window.Wavedash.initialized) {
48+
if (window.Wavedash.gameLoaded) {
4949
overlay.remove();
5050
clearInterval(tick);
5151
return;
@@ -56,8 +56,10 @@
5656
msg.textContent = window.__wavedashBootError;
5757
} else if (Date.now() - started > 10000) {
5858
msg.textContent =
59-
"Your game hasn't called Wavedash.init() — on wavedash.com " +
60-
'the loading screen hangs exactly like this.';
59+
"Your game hasn't called Wavedash.loadComplete() — on wavedash.com " +
60+
'the loading screen hangs exactly like this. Engine builds call it ' +
61+
'automatically when loading finishes, so this usually means the game ' +
62+
'is still loading or failed to boot.';
6163
}
6264
}, 150);
6365
}

0 commit comments

Comments
 (0)