Compare commits
No commits in common. "86830adc4708ecc537d6727e57c17f1646d57f37" and "29ce672646f346ad3c6f5bdcb62744ff85e2c51d" have entirely different histories.
86830adc47
...
29ce672646
@ -1,4 +1,5 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<svg width="48" height="48" version="1.1" viewBox="0 0 48 48" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect fill="#111111" width="48" height="48"/>
|
||||
<path fill="#ffffff" d="m21.225 29.383c-0.09826-0.28968-0.22135-0.65379-0.3125-1.1086-0.09115-0.45481-0.13672-0.90394-0.13672-1.3474 0-0.69359 0.15625-1.319 0.46875-1.8761 0.32552-0.56852 0.72266-1.0972 1.1914-1.5862 0.48177-0.48892 0.99609-0.96079 1.543-1.4156 0.5599-0.45481 1.0742-0.89826 1.543-1.3303 0.48177-0.43207 0.87891-0.88688 1.1914-1.3644 0.32552-0.47755 0.48828-1.1434 0.48828-1.7944 0-0.58594-0.11719-1.0937-0.35156-1.5234-0.23438-0.44271-0.5599-0.80729-0.97656-1.0937-0.40364-0.29948-0.8724-0.52083-1.4062-0.66406-0.52083-0.14323-1.0807-0.21484-1.6797-0.21484-1.9401 0-3.7484 0.9081-5.5469 2.5977-0.56753 0.53317-1.5583-3.5623 0-4.5117 2.113-1.2875 4.349-1.875 6.6406-1.875 1.0547 0 2.0508 0.13672 2.9883 0.41016 0.9375 0.27344 1.7578 0.67708 2.4609 1.2109 0.70312 0.53386 1.2565 1.1979 1.6602 1.9922s0.60547 1.7187 0.60547 2.7734c0 1.0026-0.16927 1.9936-0.50781 2.6758-0.33854 0.68222-0.76823 1.3133-1.2891 1.8932-0.50781 0.56852-1.0612 1.0745-1.6602 1.5179-0.58594 0.44344-1.1393 0.88688-1.6602 1.3303-0.50781 0.44344-0.93099 0.90394-1.2695 1.3815-0.33854 0.47755-0.50781 1.0063-0.50781 1.5862 0 0.48892 0.07162 0.93236 0.21484 1.3303 0.14323 0.39796 0.29303 0.73083 0.42969 1.0063 0.31581 0.63652-3.8048 0.93258-4.1211-2e-6zm2.2266 8.3427c-0.74219 0-1.3997-0.25391-1.9727-0.76172-0.54688-0.49479-0.82031-1.1068-0.82031-1.8359 0-0.74219 0.27344-1.3542 0.82031-1.8359 0.5599-0.52083 1.2174-0.78125 1.9727-0.78125 0.74219 0 1.3932 0.26042 1.9531 0.78125 0.54688 0.48177 0.82031 1.0938 0.82031 1.8359 0 0.72917-0.27344 1.3411-0.82031 1.8359-0.57292 0.50781-1.224 0.76172-1.9531 0.76172z"/>
|
||||
</svg>
|
||||
|
||||
|
Before Width: | Height: | Size: 190 B After Width: | Height: | Size: 1.8 KiB |
18
index.css
18
index.css
@ -99,8 +99,7 @@ body.loading #requestOverlay {
|
||||
|
||||
#requestList {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
list-style: none;
|
||||
padding-left: 2.2rem;
|
||||
font-size: 1.5rem;
|
||||
line-height: 1.25;
|
||||
}
|
||||
@ -123,20 +122,7 @@ body.loading #requestOverlay {
|
||||
}
|
||||
|
||||
.request-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 0.5rem;
|
||||
flex-wrap: wrap;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.request-cover {
|
||||
width: 2em;
|
||||
height: 2em;
|
||||
flex-shrink: 0;
|
||||
object-fit: cover;
|
||||
border-radius: 0.15em;
|
||||
vertical-align: middle;
|
||||
display: list-item;
|
||||
}
|
||||
|
||||
.request-title {
|
||||
|
||||
@ -46,7 +46,7 @@
|
||||
</div>
|
||||
<div id="requestOverlay" aria-live="polite">
|
||||
<div id="requestHeader">Song requests</div>
|
||||
<ul id="requestList"></ul>
|
||||
<ol id="requestList"></ol>
|
||||
<div id="requestEmpty">No pending requests</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -84,7 +84,6 @@
|
||||
</select></label>
|
||||
<label>Scale (%): <input id="scaleInput" type="number" min="10" max="1000" step="5"></label>
|
||||
<label>Fade (ms): <input id="fadeInput" type="number" min="0" max="5000" step="10"></label>
|
||||
<label>Debug: use history for Song requests: <input id="debugUseHistoryForRequestsInput" type="checkbox"></label>
|
||||
<label>Debug BSR ID: <span class="debugSongIdRow">
|
||||
<span class="debugSongIdHint">e.g. <button type="button" id="debugSongIdExample" title="Fill with next example BSR id (cycles)">43239</button></span>
|
||||
<input id="debugSongIdInput" class="debugSongIdInput" type="text" placeholder="e.g. 4f4e4 or 40-char hash" spellcheck="false" autocomplete="off">
|
||||
|
||||
46
index.js
46
index.js
@ -12,8 +12,7 @@ var OVERLAY_SETTINGS_INITIAL = {
|
||||
bottom: true,
|
||||
scale: 1,
|
||||
fade: 300,
|
||||
debugSongId: "",
|
||||
debugUseHistoryForRequests: false
|
||||
debugSongId: ""
|
||||
};
|
||||
|
||||
// src/client/beatsaver.ts
|
||||
@ -650,11 +649,8 @@ async function refreshMapFriendScores() {
|
||||
window.onhashchange = () => {
|
||||
loadSettings();
|
||||
void refreshConfiguredPlayerAvatar();
|
||||
void loadRequestQueue();
|
||||
const debugEl = document.getElementById("debugSongIdInput");
|
||||
if (debugEl) debugEl.value = settings.debugSongId;
|
||||
const debugHistoryEl = document.getElementById("debugUseHistoryForRequestsInput");
|
||||
if (debugHistoryEl) debugHistoryEl.checked = settings.debugUseHistoryForRequests;
|
||||
if (settings.debugSongId.trim()) void applyDebugSong();
|
||||
else {
|
||||
mapInfoRequestId += 1;
|
||||
@ -680,7 +676,7 @@ var debugBsrExampleIndex = 0;
|
||||
var requestListEl = must("requestList");
|
||||
var requestOverlayEl = must("requestOverlay");
|
||||
var requestEmptyEl = must("requestEmpty");
|
||||
var requestBeatSaverCache = /* @__PURE__ */ new Map();
|
||||
var requestTitleCache = /* @__PURE__ */ new Map();
|
||||
var requestTitleMisses = /* @__PURE__ */ new Set();
|
||||
function loadChatRequestJson() {
|
||||
const base = new URL("ChatRequest.json", location.href);
|
||||
@ -700,12 +696,10 @@ function requesterLine(item) {
|
||||
].filter(Boolean);
|
||||
return parts.length ? parts.join(" ") : item.rqn || "";
|
||||
}
|
||||
async function enrichRequestFromBeatSaver(key, titleEl, coverEl) {
|
||||
async function enrichRequestTitle(key, titleEl) {
|
||||
if (requestTitleMisses.has(key)) return;
|
||||
const cached = requestBeatSaverCache.get(key);
|
||||
if (cached) {
|
||||
titleEl.textContent = cached.title;
|
||||
coverEl.src = cached.coverUrl || "images/unknown.svg";
|
||||
if (requestTitleCache.has(key)) {
|
||||
titleEl.textContent = requestTitleCache.get(key) ?? "";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@ -715,19 +709,12 @@ async function enrichRequestFromBeatSaver(key, titleEl, coverEl) {
|
||||
return;
|
||||
}
|
||||
const name = map.metadata?.songName ?? map.name;
|
||||
const title2 = name && typeof name === "string" ? name : "";
|
||||
if (!title2) {
|
||||
requestTitleMisses.add(key);
|
||||
if (name && typeof name === "string") {
|
||||
requestTitleCache.set(key, name);
|
||||
titleEl.textContent = name;
|
||||
return;
|
||||
}
|
||||
const rawCover = map.versions?.[0]?.coverURL?.trim();
|
||||
const coverUrl = rawCover && /^https?:\/\//i.test(rawCover) ? rawCover : "";
|
||||
requestBeatSaverCache.set(key, {
|
||||
title: title2,
|
||||
coverUrl
|
||||
});
|
||||
titleEl.textContent = title2;
|
||||
if (coverUrl) coverEl.src = coverUrl;
|
||||
requestTitleMisses.add(key);
|
||||
} catch {
|
||||
requestTitleMisses.add(key);
|
||||
}
|
||||
@ -738,12 +725,6 @@ function renderRequestList(items) {
|
||||
for (const item of items) {
|
||||
const li = document.createElement("li");
|
||||
li.className = "request-item";
|
||||
const coverEl = document.createElement("img");
|
||||
coverEl.className = "request-cover";
|
||||
coverEl.src = "images/unknown.svg";
|
||||
coverEl.alt = "";
|
||||
coverEl.decoding = "async";
|
||||
li.appendChild(coverEl);
|
||||
const titleEl = document.createElement("span");
|
||||
titleEl.className = "request-title";
|
||||
titleEl.textContent = `!bsr ${item.key}`;
|
||||
@ -756,7 +737,7 @@ function renderRequestList(items) {
|
||||
li.appendChild(meta);
|
||||
}
|
||||
requestListEl.appendChild(li);
|
||||
void enrichRequestFromBeatSaver(item.key, titleEl, coverEl);
|
||||
void enrichRequestTitle(item.key, titleEl);
|
||||
}
|
||||
}
|
||||
async function loadRequestQueue() {
|
||||
@ -764,8 +745,7 @@ async function loadRequestQueue() {
|
||||
const data = await loadChatRequestJson();
|
||||
requestEmptyEl.textContent = "No pending requests";
|
||||
requestOverlayEl.classList.remove("request-load-failed");
|
||||
const source = settings.debugUseHistoryForRequests ? data.history ?? [] : data.queue ?? [];
|
||||
const items = source.slice(0, MAX_REQUESTS);
|
||||
const items = (data.queue ?? []).slice(0, MAX_REQUESTS);
|
||||
renderRequestList(items);
|
||||
} catch {
|
||||
requestEmptyEl.textContent = "Request queue unavailable";
|
||||
@ -797,8 +777,7 @@ async function bootstrap() {
|
||||
"time",
|
||||
"score",
|
||||
"friends",
|
||||
"bsr",
|
||||
"debugUseHistoryForRequests"
|
||||
"bsr"
|
||||
]) {
|
||||
const input = must(`${key}Input`);
|
||||
input.checked = settings[key];
|
||||
@ -806,7 +785,6 @@ async function bootstrap() {
|
||||
settings[key] = input.checked;
|
||||
saveSettings();
|
||||
if (key === "friends") void refreshMapFriendScores();
|
||||
if (key === "debugUseHistoryForRequests") void loadRequestQueue();
|
||||
};
|
||||
}
|
||||
const friendModeInput = must("friendModeInput");
|
||||
|
||||
@ -1,283 +0,0 @@
|
||||
{
|
||||
"queue": [],
|
||||
"history": [
|
||||
{
|
||||
"key": "4cc2b",
|
||||
"rqt": 1775779098,
|
||||
"rqn": "timmyboi101",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "41d0a",
|
||||
"rqt": 1775088648,
|
||||
"rqn": "raverbeandk",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4eabc",
|
||||
"rqt": 1773187529,
|
||||
"rqn": "whizlol_",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4ea5c",
|
||||
"rqt": 1771109245,
|
||||
"rqn": "kacy121",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4c351",
|
||||
"rqt": 1772402287,
|
||||
"rqn": "blasted246",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "3ecc7",
|
||||
"rqt": 1772402477,
|
||||
"rqn": "danielduel",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4f0fd",
|
||||
"rqt": 1772402471,
|
||||
"rqn": "kitties",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4a978",
|
||||
"rqt": 1772402365,
|
||||
"rqn": "blasted246",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "49be2",
|
||||
"rqt": 1772401977,
|
||||
"rqn": "danielduel",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4dc91",
|
||||
"rqt": 1772401902,
|
||||
"rqn": "simpliftr",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4e932",
|
||||
"rqt": 1771109684,
|
||||
"rqn": "kacy121",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4edb9",
|
||||
"rqt": 1772401613,
|
||||
"rqn": "blasted246",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "42b69",
|
||||
"rqt": 1772401712,
|
||||
"rqn": "danielduel",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "3a007",
|
||||
"rqt": 1772140150,
|
||||
"rqn": "morlis1002",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4dd71",
|
||||
"rqt": 1771109448,
|
||||
"rqn": "softmonkeh",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4ea0b",
|
||||
"rqt": 1771109231,
|
||||
"rqn": "kacy121",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "722f",
|
||||
"rqt": 1771108991,
|
||||
"rqn": "kacy121",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4ea9e",
|
||||
"rqt": 1771108667,
|
||||
"rqn": "kacy121",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "219cc",
|
||||
"rqt": 1770861875,
|
||||
"rqn": "rosa_360",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "ae0e",
|
||||
"rqt": 1770686841,
|
||||
"rqn": "unigamerplays",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "3bbb0",
|
||||
"rqt": 1770685631,
|
||||
"rqn": "unigamerplays",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4d158",
|
||||
"rqt": 1770686339,
|
||||
"rqn": "unigamerplays",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4ddac",
|
||||
"rqt": 1770685592,
|
||||
"rqn": "unigamerplays",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "e298",
|
||||
"rqt": 1757616827,
|
||||
"rqn": "$MenuMusic",
|
||||
"npr": "🎵",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "3ccc5",
|
||||
"rqt": 1757215085,
|
||||
"rqn": "666isbetter",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "3df54",
|
||||
"rqt": 1757213869,
|
||||
"rqn": "mirageplayzzz",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "3769c",
|
||||
"rqt": 1757212949,
|
||||
"rqn": "mirageplayzzz",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "345d9",
|
||||
"rqt": 1757212854,
|
||||
"rqn": "666isbetter",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4347c",
|
||||
"rqt": 1757212771,
|
||||
"rqn": "mirageplayzzz",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "1f3bb",
|
||||
"rqt": 1757212225,
|
||||
"rqn": "666isbetter",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "26d75",
|
||||
"rqt": 1757211488,
|
||||
"rqn": "mirageplayzzz",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "44330",
|
||||
"rqt": 1757211481,
|
||||
"rqn": "nowahou",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "312c6",
|
||||
"rqt": 1757211158,
|
||||
"rqn": "666isbetter",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "2c2c6",
|
||||
"rqt": 1757210672,
|
||||
"rqn": "666isbetter",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "2e8a",
|
||||
"rqt": 1757209938,
|
||||
"rqn": "666isbetter",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4a345",
|
||||
"rqt": 1757210190,
|
||||
"rqn": "abe_vs_theworld",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4a329",
|
||||
"rqt": 1757209712,
|
||||
"rqn": "mrstacker27",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "4a00b",
|
||||
"rqt": 1756592415,
|
||||
"rqn": "mrstacker27",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
},
|
||||
{
|
||||
"key": "46a3e",
|
||||
"rqt": 1748810448,
|
||||
"rqn": "sabersammy0",
|
||||
"npr": "",
|
||||
"msg": ""
|
||||
}
|
||||
],
|
||||
"allowlist": [],
|
||||
"blocklist": [],
|
||||
"bannedusers": [],
|
||||
"bannedmappers": [],
|
||||
"remaps": []
|
||||
}
|
||||
@ -534,11 +534,8 @@ async function refreshMapFriendScores() {
|
||||
window.onhashchange = () => {
|
||||
loadSettings();
|
||||
void refreshConfiguredPlayerAvatar();
|
||||
void loadRequestQueue();
|
||||
const debugEl = document.getElementById("debugSongIdInput") as HTMLInputElement | null;
|
||||
if (debugEl) debugEl.value = settings.debugSongId;
|
||||
const debugHistoryEl = document.getElementById("debugUseHistoryForRequestsInput") as HTMLInputElement | null;
|
||||
if (debugHistoryEl) debugHistoryEl.checked = settings.debugUseHistoryForRequests;
|
||||
if (settings.debugSongId.trim()) void applyDebugSong();
|
||||
else {
|
||||
mapInfoRequestId += 1;
|
||||
@ -567,10 +564,10 @@ const DEBUG_BSR_EXAMPLE_IDS = [
|
||||
] as const;
|
||||
let debugBsrExampleIndex = 0;
|
||||
|
||||
const requestListEl = must<HTMLUListElement>("requestList");
|
||||
const requestListEl = must<HTMLOListElement>("requestList");
|
||||
const requestOverlayEl = must<HTMLElement>("requestOverlay");
|
||||
const requestEmptyEl = must<HTMLElement>("requestEmpty");
|
||||
const requestBeatSaverCache = new Map<string, { title: string; coverUrl: string }>();
|
||||
const requestTitleCache = new Map<string, string>();
|
||||
const requestTitleMisses = new Set<string>();
|
||||
|
||||
function loadChatRequestJson() {
|
||||
@ -588,12 +585,10 @@ function requesterLine(item: ChatRequestEntry) {
|
||||
return parts.length ? parts.join(" ") : item.rqn || "";
|
||||
}
|
||||
|
||||
async function enrichRequestFromBeatSaver(key: string, titleEl: HTMLElement, coverEl: HTMLImageElement) {
|
||||
async function enrichRequestTitle(key: string, titleEl: HTMLElement) {
|
||||
if (requestTitleMisses.has(key)) return;
|
||||
const cached = requestBeatSaverCache.get(key);
|
||||
if (cached) {
|
||||
titleEl.textContent = cached.title;
|
||||
coverEl.src = cached.coverUrl || "images/unknown.svg";
|
||||
if (requestTitleCache.has(key)) {
|
||||
titleEl.textContent = requestTitleCache.get(key) ?? "";
|
||||
return;
|
||||
}
|
||||
try {
|
||||
@ -603,16 +598,12 @@ async function enrichRequestFromBeatSaver(key: string, titleEl: HTMLElement, cov
|
||||
return;
|
||||
}
|
||||
const name = map.metadata?.songName ?? map.name;
|
||||
const title = name && typeof name === "string" ? name : "";
|
||||
if (!title) {
|
||||
requestTitleMisses.add(key);
|
||||
if (name && typeof name === "string") {
|
||||
requestTitleCache.set(key, name);
|
||||
titleEl.textContent = name;
|
||||
return;
|
||||
}
|
||||
const rawCover = map.versions?.[0]?.coverURL?.trim();
|
||||
const coverUrl = rawCover && /^https?:\/\//i.test(rawCover) ? rawCover : "";
|
||||
requestBeatSaverCache.set(key, { title, coverUrl });
|
||||
titleEl.textContent = title;
|
||||
if (coverUrl) coverEl.src = coverUrl;
|
||||
requestTitleMisses.add(key);
|
||||
} catch {
|
||||
requestTitleMisses.add(key);
|
||||
}
|
||||
@ -624,12 +615,6 @@ function renderRequestList(items: ChatRequestEntry[]) {
|
||||
for (const item of items) {
|
||||
const li = document.createElement("li");
|
||||
li.className = "request-item";
|
||||
const coverEl = document.createElement("img");
|
||||
coverEl.className = "request-cover";
|
||||
coverEl.src = "images/unknown.svg";
|
||||
coverEl.alt = "";
|
||||
coverEl.decoding = "async";
|
||||
li.appendChild(coverEl);
|
||||
const titleEl = document.createElement("span");
|
||||
titleEl.className = "request-title";
|
||||
titleEl.textContent = `!bsr ${item.key}`;
|
||||
@ -642,7 +627,7 @@ function renderRequestList(items: ChatRequestEntry[]) {
|
||||
li.appendChild(meta);
|
||||
}
|
||||
requestListEl.appendChild(li);
|
||||
void enrichRequestFromBeatSaver(item.key, titleEl, coverEl);
|
||||
void enrichRequestTitle(item.key, titleEl);
|
||||
}
|
||||
}
|
||||
|
||||
@ -651,8 +636,7 @@ async function loadRequestQueue() {
|
||||
const data = await loadChatRequestJson();
|
||||
requestEmptyEl.textContent = "No pending requests";
|
||||
requestOverlayEl.classList.remove("request-load-failed");
|
||||
const source = settings.debugUseHistoryForRequests ? (data.history ?? []) : (data.queue ?? []);
|
||||
const items = source.slice(0, MAX_REQUESTS);
|
||||
const items = (data.queue ?? []).slice(0, MAX_REQUESTS);
|
||||
renderRequestList(items);
|
||||
} catch {
|
||||
requestEmptyEl.textContent = "Request queue unavailable";
|
||||
@ -681,14 +665,13 @@ async function bootstrap() {
|
||||
|
||||
// Settings UI
|
||||
|
||||
for (const key of ["cover", "mapInfo", "time", "score", "friends", "bsr", "debugUseHistoryForRequests"] as const) {
|
||||
for (const key of ["cover", "mapInfo", "time", "score", "friends", "bsr"] as const) {
|
||||
const input = must<HTMLInputElement>(`${key}Input`);
|
||||
input.checked = settings[key];
|
||||
input.oninput = () => {
|
||||
settings[key] = input.checked;
|
||||
saveSettings();
|
||||
if (key === "friends") void refreshMapFriendScores();
|
||||
if (key === "debugUseHistoryForRequests") void loadRequestQueue();
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@ -18,8 +18,6 @@ export interface OverlaySettings {
|
||||
fade: number;
|
||||
/** Frontend-only: BeatSaver map key or 40-char hash; when set, map UI + BeatLeader use this instead of BS+ WebSocket map info. */
|
||||
debugSongId: string;
|
||||
/** When true, show `history` from ChatRequest/Database JSON as the request list instead of `queue`. */
|
||||
debugUseHistoryForRequests: boolean;
|
||||
}
|
||||
|
||||
export const OVERLAY_SETTINGS_INITIAL: Readonly<OverlaySettings> = {
|
||||
@ -36,7 +34,6 @@ export const OVERLAY_SETTINGS_INITIAL: Readonly<OverlaySettings> = {
|
||||
scale: 1,
|
||||
fade: 300,
|
||||
debugSongId: "",
|
||||
debugUseHistoryForRequests: false,
|
||||
};
|
||||
|
||||
export interface HandshakeEvent {
|
||||
@ -120,7 +117,6 @@ export interface ChatRequestEntry {
|
||||
|
||||
export interface ChatRequestPayload {
|
||||
queue: ChatRequestEntry[];
|
||||
history?: ChatRequestEntry[];
|
||||
}
|
||||
|
||||
export interface BeatLeaderDifficulty {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user