Fix: StripOverlayLayer initialization timing issue
Moved StripOverlayLayer and ConfirmationBar initialization to occur AFTER ScryingPoolStrip is created (via roleRenderer.openStrip()). This fixes the console warning: 'StripOverlayLayer: ScryingPoolStrip not found, appending to body' The issue was that StripOverlayLayer.init() was trying to find .scrying-pool__roster-strip before it was created. ScryingPoolStrip is created lazily when roleRenderer.openStrip() is called. Additionally, made both components GM-only since: - ConfirmationBar is in src/ui/gm/ and is only useful for GMs - StripOverlayLayer is currently only used by ConfirmationBar - ScryingPoolStrip is only created for GMs This ensures proper positioning of ConfirmationBar relative to ScryingPoolStrip. Generated by Mistral Vibe. Co-Authored-By: Mistral Vibe <vibe@mistral.ai>
This commit is contained in:
@@ -199,14 +199,6 @@ Hooks.once("ready", () => {
|
||||
portraitFallbackHandler = new PortraitFallbackHandler(adapter, playerPrivacyManager);
|
||||
portraitFallbackHandler.init();
|
||||
|
||||
// Story 3.2: Create StripOverlayLayer (shared infrastructure for UI components)
|
||||
stripOverlayLayer = new StripOverlayLayer(adapter);
|
||||
stripOverlayLayer.init();
|
||||
|
||||
// Story 3.2: Create ConfirmationBar for preset apply feedback
|
||||
confirmationBar = new ConfirmationBar(adapter, visibilityManager, socketHandler, stripOverlayLayer);
|
||||
confirmationBar.init();
|
||||
|
||||
// Story 3.2: Register updateScene hook for auto-apply
|
||||
adapter.hooks.on('updateScene', (scene) => {
|
||||
if (adapter.users.isGM()) {
|
||||
@@ -239,7 +231,17 @@ Hooks.once("ready", () => {
|
||||
roleRenderer.init();
|
||||
if (adapter.users.isGM() && game.webrtc !== null) {
|
||||
roleRenderer.openStrip();
|
||||
|
||||
// Story 3.2: Create StripOverlayLayer AFTER ScryingPoolStrip is created
|
||||
// (ScryingPoolStrip is created lazily in roleRenderer.openStrip() above)
|
||||
stripOverlayLayer = new StripOverlayLayer(adapter);
|
||||
stripOverlayLayer.init();
|
||||
|
||||
// Story 3.2: Create ConfirmationBar for preset apply feedback (GM only)
|
||||
confirmationBar = new ConfirmationBar(adapter, visibilityManager, socketHandler, stripOverlayLayer);
|
||||
confirmationBar.init();
|
||||
}
|
||||
|
||||
if (!adapter.users.isGM()) {
|
||||
visibilityBadge = new VisibilityBadge(stateStore, scryingPoolController, avTileAdapter, adapter);
|
||||
visibilityBadge.init();
|
||||
|
||||
Reference in New Issue
Block a user