| 412 | // ============================================================================ |
| 413 | |
| 414 | export function displayInitialScreen (engine: VisualNovelEngine): void { |
| 415 | // Preload all the game assets |
| 416 | engine.preload ().then (() => { |
| 417 | |
| 418 | }).catch ((e) => { |
| 419 | console.error (e); |
| 420 | }).finally (() => { |
| 421 | if (engine.label ()) { |
| 422 | showSplashScreen (engine); |
| 423 | } else { |
| 424 | const scriptData = engine.script () as Record<string, unknown> | undefined; |
| 425 | FancyError.show ('engine:script:label_not_found', { |
| 426 | startLabel: engine.setting ('Label'), |
| 427 | availableLabels: Object.keys (scriptData ?? {}) |
| 428 | }); |
| 429 | } |
| 430 | }); |
| 431 | } |