background data stuff

This commit is contained in:
biglyderv 2025-05-19 02:16:05 -04:00
parent 66d0642006
commit 3d55d03097
Signed by: biglyderv
GPG key ID: 0E2EB0B4CD7397B5
2 changed files with 38 additions and 27 deletions

View file

@ -62,6 +62,7 @@ function TileManager(row, row2) {
this.row = row;
this.row2 = row2;
this.sel = 0;
this.usedAnon = {};
this.used = {};
@ -106,6 +107,16 @@ TileManager.prototype.loadSet = function (namespace, tiles) {
elem.addEventListener('click', () => {
this.sel = tile.number;
if (!this.usedAnon[this.sel]) {
fetch("https://data.dervland.net/", {
"method": "post",
"body": JSON.stringify({'action': `Used ${tile.id} in Altboxels`}),
"headers": {
"content-type": "application/json"
}
})
}
this.usedAnon[this.sel] = true;
})
}
}