···5050}
51515252function decompressStringNoBase64(compressed) {
5353- compressed = Uint8Array.from(compressed, (c) =>
5454- c.charCodeAt(0)
5555- );
5353+ compressed = Uint8Array.from(compressed, (c) => c.charCodeAt(0));
5654 const decompressed = pako.inflate(compressed);
5755 const decompressedString = new TextDecoder().decode(decompressed);
5856 return decompressedString;
···7573 a.click();
7674 document.body.removeChild(a);
7775 URL.revokeObjectURL(url);
7878-}
7979-7676+}
80778178async function openAndLoadFileAsBytes() {
8279 return new Promise((resolve, reject) => {
···10198}
10299103100async function fileToLevelData() {
104104- return "=" + compressString(decompressStringFromBytes(await openAndLoadFileAsBytes())); // i hate this and want to fix it but its 4 am and i need to sleep. fuck text encoding
101101+ return (
102102+ "=" +
103103+ compressString(
104104+ decompressStringFromBytes(await openAndLoadFileAsBytes())
105105+ )
106106+ ); // i hate this and want to fix it but its 4 am and i need to sleep. fuck text encoding
105107}
106106-107108108109function cloneFromPlants(name, sun, screenshot) {
109110 name = name
+1-1
game/level/izombiecustommenu.js
···5858 let levelData = await fileToLevelData();
5959 inputDataElement.value = levelData;
6060 buttonElement.click();
6161- }
6161+ };
6262 $("dAll").appendChild(buttonElementUpload);
6363 buttonElement.onclick = function () {
6464 // store the input value and disable it, then make it say "Loading..."
+9-5
game/level/izombieleveleditor.js
···307307 );
308308 closeButton.id = "btnNextLevel"; // not actually a next level button, but it's the same style
309309 closeButton.style.top = "60%";
310310- closeButton.style.left = "calc(50% - 120px)"; // "calc(33.333% - 56.5px)";
310310+ closeButton.style.left =
311311+ "calc(50% - 120px)"; // "calc(33.333% - 56.5px)";
311312 closeButton.onclick = function () {
312313 $("dAll").style.zIndex = "";
313314 let oldLv = oS.Lvl;
···332333 );
333334 uploadButton.id = "btnNextLevel"; // not actually a next level button, but it's the same style
334335 uploadButton.style.top = "60%";
335335- uploadButton.style.left = "calc(50% - 56.5px)";
336336+ uploadButton.style.left =
337337+ "calc(50% - 56.5px)";
336338 uploadButton.onclick = function () {
337339 // nothing for now
338340 };
···351353 );
352354 downloadButton.id = "btnNextLevel"; // not actually a next level button, but it's the same style
353355 downloadButton.style.top = "60%";
354354- downloadButton.style.left = "calc(50% + 5px)"; // "calc(66.666% - 56.5px)";
356356+ downloadButton.style.left =
357357+ "calc(50% + 5px)"; // "calc(66.666% - 56.5px)";
355358 downloadButton.onclick = function () {
356359 downloadBytesAsFile(
357360 compressStringAsBytes(
358361 tinyifyClone(
359362 cloneFromPlants(l, f)
360363 )
361361- ), l + ".izl2"
362362- )
364364+ ),
365365+ l + ".izl2"
366366+ );
363367 };
364368 downloadButton.style.zIndex = "1000";
365369