enabledMods.includes("mods/libpacman-v1.js") || (enabledMods.push("mods/libpacman-v1.js"), localStorage.setItem("enabledMods", JSON.stringify(enabledMods)), location.reload());
let realTps = 0;
let lastTps = 0;
window.addEventListener("load", ()=>{
requireMods(["mods/libhooktick.js"], () => {
beforeEveryTick(()=>{
lastTps++;
});
setInterval(()=>{
realTps = lastTps;
lastTps = 0;
}, 1000);
});
});
function updateStatsNew() {
var statsDiv = document.getElementById("stats");
var stats = "x"+mousePos.x+",y"+mousePos.y+"";
stats += "Pxls:" + currentPixels.length+"";
stats += "" + tps+"tps";
stats += "" + realTps + "tps";
stats += "" + pixelTicks+"";
if ((typeof pixelMap).length === 9) { return; }
if (pixelMap[mousePos.x] !== undefined) {
var currentPixel = pixelMap[mousePos.x][mousePos.y];
if (currentPixel !== undefined) {
stats += "Elem:"+(elements[currentPixel.element].name || currentPixel.element).toUpperCase()+"";
stats += "Temp:"+formatTemp(currentPixel.temp)+"";
if (currentPixel.charge) {
stats += "C"+parseFloat(currentPixel.charge)+"";
}
if (currentPixel.burning) {
stats += "Burning";
}
if (elements[currentPixel.element].hoverStat) {
stats += ""+elements[currentPixel.element].hoverStat(currentPixel).toString().replaceAll("<","<")+"";
}
else if (currentPixel.clone) {
stats += ""+currentPixel.clone.toString().toUpperCase().replaceAll("<","<")+"";
}
else if (currentPixel.con && currentPixel.con.element) {
stats += ""+currentPixel.con.element.toString().toUpperCase().replaceAll("<","<")+"";
}
}
}
if (shiftDown) {
stats += ""+shiftDownTypes[shiftDown]+"";
}
// If the view is not null, show the view in all caps
if (view !== null) {
stats += ""+(viewInfo[view] ? viewInfo[view].name : view)+"";
}
statsDiv.innerHTML = stats;
}
updateStats = updateStatsNew;