background data stuff
This commit is contained in:
parent
66d0642006
commit
3d55d03097
2 changed files with 38 additions and 27 deletions
11
js/tile.js
11
js/tile.js
|
@ -62,6 +62,7 @@ function TileManager(row, row2) {
|
||||||
this.row = row;
|
this.row = row;
|
||||||
this.row2 = row2;
|
this.row2 = row2;
|
||||||
this.sel = 0;
|
this.sel = 0;
|
||||||
|
this.usedAnon = {};
|
||||||
|
|
||||||
this.used = {};
|
this.used = {};
|
||||||
|
|
||||||
|
@ -106,6 +107,16 @@ TileManager.prototype.loadSet = function (namespace, tiles) {
|
||||||
|
|
||||||
elem.addEventListener('click', () => {
|
elem.addEventListener('click', () => {
|
||||||
this.sel = tile.number;
|
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;
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue