let gameRuntimeModule: Promise | null = null; let loadedGameRuntime: typeof import("../GameRuntime")["default"] | null = null; let partyManagementPanelModule: Promise | null = null; let loadedPartyManagementPanel: typeof import("./PartyManagementPanel")["PartyManagementPanel"] | null = null; let bossGuidePanelModule: Promise | null = null; let loadedBossGuidePanel: typeof import("./BossGuidePanel")["BossGuidePanel"] | null = null; export function loadGameRuntime() { if (!gameRuntimeModule) { gameRuntimeModule = import("../GameRuntime") .then((module) => { loadedGameRuntime = module.default; return module; }) .catch((error: unknown) => { gameRuntimeModule = null; throw error; }); } return gameRuntimeModule; } export function getLoadedGameRuntime() { return loadedGameRuntime; } export function loadPartyManagementPanel() { if (!partyManagementPanelModule) { partyManagementPanelModule = import("./PartyManagementPanel") .then((module) => { loadedPartyManagementPanel = module.PartyManagementPanel; return module; }) .catch((error: unknown) => { partyManagementPanelModule = null; throw error; }); } return partyManagementPanelModule; } export function getLoadedPartyManagementPanel() { return loadedPartyManagementPanel; } export function loadBossGuidePanel() { if (!bossGuidePanelModule) { bossGuidePanelModule = import("./BossGuidePanel") .then((module) => { loadedBossGuidePanel = module.BossGuidePanel; return module; }) .catch((error: unknown) => { bossGuidePanelModule = null; throw error; }); } return bossGuidePanelModule; } export function getLoadedBossGuidePanel() { return loadedBossGuidePanel; } export async function preloadSharedGameplayResources(originalMediaEnabled: boolean): Promise { await Promise.all([ loadGameRuntime(), loadPartyManagementPanel(), loadBossGuidePanel(), ]); if (!originalMediaEnabled) return; const { ensureCombatMediaPack } = await import("../game/combatMediaPack"); if (!await ensureCombatMediaPack()) return; const { preloadCombatEffectManifest } = await import("../game/combatPresentation"); await preloadCombatEffectManifest(); }