simple-loading-screen/public/events.js

64 lines
1.5 KiB
JavaScript
Raw Permalink Normal View History

2024-03-28 20:30:51 +00:00
const element = document.getElementsByTagName("html")[0];
function GameDetails(servername, serverurl, mapname, maxplayers, steamid, gamemode, volume, lang, gamemodeNice) {
setInterval(() => {
element.dispatchEvent(
new CustomEvent("gameDetails", {
detail: {
servername,
serverurl,
mapname,
maxplayers,
steamid,
gamemode,
volume,
lang,
gamemodeNice,
},
})
);
}, 1000);
}
function DownloadingFile(file) {
element.dispatchEvent(
new CustomEvent("downloadingFile", {
detail: {
file,
},
})
);
}
function SetStatusChanged(status) {
element.dispatchEvent(
new CustomEvent("statusChanged", {
detail: {
status,
},
})
);
}
2024-09-02 05:19:30 +00:00
function SetFilesTotal(total) {
element.dispatchEvent(
new CustomEvent("setFilesTotal", {
detail: {
total,
},
})
);
}
function SetFilesNeeded(needed) {
element.dispatchEvent(
new CustomEvent("setFilesNeeded", {
detail: {
needed,
},
})
);
}
2024-09-02 05:21:10 +00:00
// GameDetails("cirro's sandbox / FASTDL WIRE PAC3 ARC9 LVS", null, "gm_construct", null, null, "sandbox", null, null, null);