Stabilize WebGL title and timeline texture flow
This commit is contained in:
@@ -11,7 +11,7 @@ const DEFAULT_PAGE_RESERVE = 50;
|
||||
class WebGLBookSceneModule extends BaseModule {
|
||||
constructor() {
|
||||
super('webgl-book-scene', 'WebGL Book Scene');
|
||||
this.dependencies = ['persistence-manager', 'localization', 'game-config', 'book-texture-renderer'];
|
||||
this.dependencies = ['persistence-manager', 'localization', 'game-config', 'book-pagination', 'book-texture-renderer'];
|
||||
this.persistenceManager = null;
|
||||
this.localization = null;
|
||||
this.gameConfig = null;
|
||||
@@ -365,7 +365,13 @@ class WebGLBookSceneModule extends BaseModule {
|
||||
this.labImportPromise = import(`/js/webgl-book-lab.js?v=${encodeURIComponent(cacheBuster)}`);
|
||||
await this.labImportPromise;
|
||||
this.reportProgress(94, 'Uploading initial book page textures');
|
||||
window.BookTextureRenderer?.publishSpread?.();
|
||||
const pagination = this.getModule('book-pagination');
|
||||
const initialSpread = pagination?.getCurrentSpread?.();
|
||||
if (initialSpread && typeof window.BookTextureRenderer?.drawSpread === 'function') {
|
||||
window.BookTextureRenderer.drawSpread(initialSpread, ['left', 'right'], { force: true });
|
||||
} else {
|
||||
window.BookTextureRenderer?.publishSpread?.();
|
||||
}
|
||||
await new Promise(resolve => requestAnimationFrame(resolve));
|
||||
this.reportProgress(96, 'Binding WebGL page controls');
|
||||
this.installTextureEventBridge();
|
||||
|
||||
Reference in New Issue
Block a user