Skip to content

Commit 7b31038

Browse files
committed
update izl thing
1 parent 363ac5f commit 7b31038

File tree

2 files changed

+27
-27
lines changed

2 files changed

+27
-27
lines changed

game/js/Cfunction.js

Lines changed: 27 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2991,8 +2991,33 @@ var deleteCookie = function (key) {
29912991
document.cookie = key + "=0;";
29922992
};
29932993

2994-
var WordUTF8 = `<div id="dLogo" style="position:absolute;width:900px;height:600px;z-index:1"><span id="commit" style="position: absolute;color: #ffffff0f;bottom: 0;user-select: none;"></span><div id="LogoWord" style="position:absolute;color:#FF0;top:300px;width:100%;height:100px"><span style="position:absolute;width:305px;height:150px;left:285px;top:5px;cursor:url(images/interface/Pointer.cur),pointer" onclick="PlaySound2('gravebutton');SetBlock($('dSurface'),$('iSurfaceBackground'));ShowNameDiv();"></span><div style="position:absolute;font-size:14px;left:660px;text-align:center;width:140px;top:185px;line-height:1.5;font-weight:bold"><span style="cursor:url(images/interface/Pointer.cur),pointer"><span id="" style=""></span></span></div></div><div style="position:absolute;width:74px;height:41px;left:807px;top:502px;cursor:url(images/interface/Pointer.cur),pointer;z-index:300" onclick="SetVisible($('dProcess'))"></div><img src="" style="position:absolute;left:550px;top:-40px"></div>`;
2995-
2994+
var WordUTF8 = `<div id="dLogo" style="position:absolute;width:900px;height:600px;z-index:1"><span id="commit" style="position: absolute;color: #ffffff0f;bottom: 0;user-select: none;"></span><div id="LogoWord" style="position:absolute;color:#FF0;top:300px;width:100%;height:100px"><span style="position:absolute;width:305px;height:150px;left:285px;top:5px;cursor:url(images/interface/Pointer.cur),pointer" onclick="PlaySound2('gravebutton');SetBlock($('dSurface'),$('iSurfaceBackground'));ShowNameDiv();CheckIzlParameter();"></span><div style="position:absolute;font-size:14px;left:660px;text-align:center;width:140px;top:185px;line-height:1.5;font-weight:bold"><span style="cursor:url(images/interface/Pointer.cur),pointer"><span id="" style=""></span></span></div></div><div style="position:absolute;width:74px;height:41px;left:807px;top:502px;cursor:url(images/interface/Pointer.cur),pointer;z-index:300" onclick="SetVisible($('dProcess'))"></div><img src="" style="position:absolute;left:550px;top:-40px"></div>`;
2995+
2996+
var CheckIzlParameter = function () {
2997+
// check if izl_id query parameter exists
2998+
let urlParams = new URLSearchParams(window.location.search);
2999+
let izlId = urlParams.get("izl_id");
3000+
if (izlId) {
3001+
fetch(`${$User.Server.URL}/api/levels/${izlId}/download`, {
3002+
method: "GET",
3003+
})
3004+
.then((response) => response.arrayBuffer())
3005+
.then(async (arrayBuffer) => {
3006+
// load the level
3007+
levelDataToLoad = await decodeBytes(new Uint8Array(arrayBuffer));
3008+
// load the izombiecustomlevel level
3009+
if (levelDataToLoad.lfValue[3] === 2) {
3010+
SelectModal("izombiecustomlevelwater");
3011+
} else {
3012+
SelectModal("izombiecustomlevelnormal");
3013+
}
3014+
})
3015+
.catch((e) => {
3016+
console.error(e);
3017+
alert("There was an error loading the level. Please try again later.");
3018+
});
3019+
}
3020+
};
29963021
var ShowNameDiv = function () {
29973022
oSym.Start();
29983023
(function (config) {

game/level/0.js

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -143,31 +143,6 @@ oS.Init({
143143
: console.log("Version", oS.Version) /*$("").innerHTML = 4/* oS.Version */;
144144
})();
145145
$("dServer") && SetBlock($("dServer"));
146-
// check if izl_id query parameter exists
147-
let urlParams = new URLSearchParams(window.location.search);
148-
let izlId = urlParams.get("izl_id");
149-
if (izlId) {
150-
setTimeout(() => {
151-
fetch(`${$User.Server.URL}/api/levels/${izlId}/download`, {
152-
method: "GET",
153-
})
154-
.then((response) => response.arrayBuffer())
155-
.then(async (arrayBuffer) => {
156-
// load the level
157-
levelDataToLoad = await decodeBytes(new Uint8Array(arrayBuffer));
158-
// load the izombiecustomlevel level
159-
if (levelDataToLoad.lfValue[3] === 2) {
160-
SelectModal("izombiecustomlevelwater");
161-
} else {
162-
SelectModal("izombiecustomlevelnormal");
163-
}
164-
})
165-
.catch((e) => {
166-
console.error(e);
167-
alert("There was an error loading the level. Please try again later.");
168-
});
169-
}, 0);
170-
}
171146
},
172147
});
173148
$("ZombieHand").style.display = "none";

0 commit comments

Comments
 (0)