Profectus/assets/gameLoop.a8546739.js

1 line
2.1 KiB
JavaScript

import{_ as d,s as u,p as e,a as l,l as T,D as a,b as m,g as p}from"./index.04ca4790.js";import"./vue.359c6955.js";import{b2 as c}from"./@vue.6f8187b0.js";/* empty css */import"./lz-string.bfbf8ec3.js";import"./nanoevents.1080beb7.js";import"./unofficial-galaxy-sdk.21372393.js";import"./vue-textarea-autosize.35804eaf.js";import"./vue-next-select.68e0c605.js";import"./vuedraggable.055200e5.js";import"./sortablejs.20039f18.js";import"./vue-toastification.45d39007.js";let n=null,f=null;function o(){const t=Date.now();let i=(t-e.time)/1e3;e.time=t;const r=i;if(l.lastTenTicks.push(r),l.lastTenTicks.length>10&&(l.lastTenTicks=l.lastTenTicks.slice(1)),!((f==null?void 0:f.value)&&!e.keepGoing)&&!l.hasNaN&&(i=Math.max(i,0),e.devSpeed!==0)){if(T.value=!1,e.offlineTime!=null){if(a.gt(e.offlineTime,m.offlineLimit*3600)&&(e.offlineTime=m.offlineLimit*3600),a.gt(e.offlineTime,0)&&e.devSpeed!==0){const s=Math.max(e.offlineTime/10,i);e.offlineTime=e.offlineTime-s,i+=s}else e.devSpeed===0&&(e.offlineTime+=i);(!e.offlineProd||a.lt(e.offlineTime,0))&&(e.offlineTime=null)}i=Math.min(i,m.maxTickLength),e.devSpeed!=null&&(i*=e.devSpeed),Number.isFinite(i)||(i=1e308),!a.eq(i,0)&&(e.timePlayed+=i,Number.isFinite(e.timePlayed)||(e.timePlayed=1e308),p.emit("update",i,r),u.unthrottled?(requestAnimationFrame(o),n!=null&&(clearInterval(n),n=null)):n==null&&(n=setInterval(o,50)))}}async function w(){f=(await d(()=>import("./index.04ca4790.js").then(function(t){return t.c}),["assets/index.04ca4790.js","assets/index.e930493e.css","assets/@fontsource.f66d05e7.css","assets/vue.359c6955.js","assets/lz-string.bfbf8ec3.js","assets/@vue.6f8187b0.js","assets/nanoevents.1080beb7.js","assets/unofficial-galaxy-sdk.21372393.js","assets/vue-textarea-autosize.35804eaf.js","assets/vue-next-select.68e0c605.js","assets/vue-next-select.9e6f4164.css","assets/vuedraggable.055200e5.js","assets/sortablejs.20039f18.js","assets/vue-toastification.45d39007.js","assets/vue-toastification.4b5f8ac8.css"])).hasWon,c(f,t=>{t&&p.emit("gameWon")}),u.unthrottled?requestAnimationFrame(o):n=setInterval(o,50)}export{w as startGameLoop};