Optimize initial loading performance

This commit is contained in:
2026-06-27 07:49:38 +09:00
parent 88207c3b6f
commit b74332973b
14 changed files with 552 additions and 533 deletions

View File

@@ -159,13 +159,7 @@ async function setupBattle(page, battle) {
}, battle.selected);
await page.reload({ waitUntil: 'domcontentloaded' });
await page.waitForFunction(() => window.__HEROS_GAME__ !== undefined && window.__HEROS_DEBUG__ !== undefined, undefined, { timeout: 90000 });
await page.evaluate((battleId) => {
const game = window.__HEROS_GAME__;
for (const scene of game.scene.getScenes(true)) {
game.scene.stop(scene.scene.key);
}
game.scene.start('BattleScene', { battleId });
}, battle.id);
await page.evaluate((battleId) => window.__HEROS_DEBUG__.goToBattle(battleId), battle.id);
await page.waitForFunction(
(battleId) => {
const state = window.__HEROS_DEBUG__?.battle();