simple-loading-screen/public/events.js

42 lines
1,004 B
JavaScript
Raw 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,
},
})
);
}