feat: redemption codes, world count, den visitor count and more fixes

- codes made in the admin panel (Messages) give an item, gems or
  diamonds through the game's Redeem Code window, which was never
  answered; its "need help?" says what codes are here
- the number of worlds is set in the admin panel (Debug), live
- a den's owner is told how many are in it: the HUD's count and doorbell
- the map counts the player's buddies in each land of their world
- gifts whose item no longer exists, or with a nonsense amount, are no
  gift at all, rather than a window that will not close
- custom item pictures are 256 pixels and 100 KB at most
- the account page's buddies and den visitors fold away
- shops no longer count down "X days left"
This commit is contained in:
Burrowdev committed 2026-10-23 22:25:35 +03:00
1 parent 15f321fb00
commit 7de41ceed5
14 files changed
+707 -27

No files matched your search

+16 -5
View File
@@ -265,7 +265,11 @@
<section>
<h2>Buddies</h2>
<div id="buddies"></div>
<!-- closed at first: a long list made the page slow to scroll -->
<details id="buddies-box" hidden>
<summary id="buddies-summary">Buddies</summary>
<div id="buddies"></div>
</details>
<p class="hint" id="no-buddies" hidden>No buddies yet.</p>
<p class="status" id="buddy-status" role="status"></p>
</section>
@@ -316,7 +320,10 @@
<section>
<h2>Den visitors</h2>
<div id="visits"></div>
<details id="visits-box" hidden>
<summary id="visits-summary">Visitors</summary>
<div id="visits"></div>
</details>
<p class="hint" id="no-visits" hidden>No visitors yet.</p>
</section>
@@ -863,8 +870,8 @@
// moving), else drawn into a PNG that fits, smaller until it is small
// enough. any picture this browser can open will do (WebP, AVIF, BMP...).
// null when it cannot be read at all.
const PICTURE_SIDE = 512;
const PICTURE_BYTES = 300 * 1024;
const PICTURE_SIDE = 256;
const PICTURE_BYTES = 100 * 1024;
const preparePicture = async file => {
const kept = ["image/png", "image/jpeg", "image/gif"].includes(file.type);
let image = null;
@@ -878,7 +885,7 @@
image.close();
return file;
}
for (const side of [PICTURE_SIDE, 384, 256, 128]) {
for (const side of [PICTURE_SIDE, 192, 128, 96]) {
const scale = Math.min(1, side / image.width, side / image.height);
const canvas = document.createElement("canvas");
canvas.width = Math.max(1, Math.round(image.width * scale));
@@ -1022,6 +1029,8 @@
}));
}
$("no-buddies").hidden = account.buddyList.length > 0;
$("buddies-box").hidden = account.buddyList.length === 0;
$("buddies-summary").textContent = `Show ${account.buddyList.length.toLocaleString()} ${account.buddyList.length === 1 ? "buddy" : "buddies"}`;
$("blocked").replaceChildren(...account.blocked.map(name => {
const row = el("div", undefined, "switch");
@@ -1067,6 +1076,8 @@
return entry;
}));
$("no-visits").hidden = account.denVisits.length > 0;
$("visits-box").hidden = account.denVisits.length === 0;
$("visits-summary").textContent = `Show ${account.denVisits.length.toLocaleString()} ${account.denVisits.length === 1 ? "visit" : "visits"}`;
$("achievement-summary").textContent = `${account.achievements.earned} of ${account.achievements.of} earned.`;
$("achievements").replaceChildren(...account.achievements.counted.map(counted => {