This commit is contained in:
33333-33333 2026-07-18 13:06:02 +09:00
commit f657b6a4a4
94 changed files with 3970 additions and 1241 deletions

View file

@ -16,8 +16,21 @@ function ensureWorldBootstrap() {
let world = ensureWorldBootstrap();
let last = nowSec();
let statsTimer = 0;
let statsRefreshPending = false;
window.__tarinaiFps = 0;
function scheduleStatsRefresh() {
if (statsRefreshPending) return;
if (typeof colonyStatsUiVisible === "function" && !colonyStatsUiVisible()) return;
statsRefreshPending = true;
const run = () => {
statsRefreshPending = false;
if (!document.hidden) renderStats();
};
if (typeof window.requestIdleCallback === "function") window.requestIdleCallback(run, { timeout: 900 });
else window.setTimeout(run, 0);
}
const LOADING_SPRITES = SPRITES
.filter(asset => asset && !asset.actionOnly)
.slice(0, 11)
@ -96,7 +109,7 @@ function loop() {
statsTimer += dt;
const statsInterval = 2.5;
if (statsTimer > statsInterval) {
renderStats();
scheduleStatsRefresh();
statsTimer = 0;
}
requestAnimationFrame(loop);