Add preload and scripts

This commit is contained in:
Varun Patil 2020-05-06 13:03:51 +05:30
parent ad9474a6e9
commit 47ee508ae5
6 changed files with 1146 additions and 0 deletions

View file

@ -172,6 +172,20 @@
window.onerror = function() {
alert("An error occured!")
};
window.fileLoadedAsync = function(file) {
if (!(/.*Map.*rxdata/i.test(file))) return;
fetch('preload/' + file + '.json')
.then(function(response) {
return response.json();
})
.then(function(jsonResponse) {
jsonResponse.forEach((f) => {
fetch('gameasync/' + f).then().catch();
});
});
};
</script>
{{{ SCRIPT }}}