feedback5 WG: 补位 in the browser — the 干员持有 tab next to 干员调配 (the 53 NORMAL chess by tier, operator → stand-in, a switch each, 全部持有, export / import, localStorage + room.ownership through the shared sync engine), 「替补:X」 on shop / reward cards and own prep pieces, the stand-in's model on the board, its body on the detail card (own pieces, cards, any unit with standInFor), placement and ranges by the stand-in

This commit is contained in:
sganggs committed 2026-10-05 19:34:52 +08:00
1 parent 24205581e1
commit 4b57f8120c
23 files changed
+1227 -126

No files matched your search

+17
View File
@@ -1,6 +1,7 @@
// public/js/render/app/host.js — asset lookup, data lookup and GL teardown for one field view.
import { createAssets, assets as defaultAssets } from '../../assets.js';
import { standInRecord } from '../../../../shared/standIn.js';
function withTimeout(p, ms) {
return Promise.race([p, new Promise((resolve) => setTimeout(resolve, ms))]);
@@ -24,9 +25,25 @@ function makeData(src) {
} catch { /* ignore */ }
return null;
};
// 0.2.0 补位: the composed stand-in record of a chess (shared/standIn.js over data/backups.json), cached per chess
const standIns = new Map();
const backups = () => {
try { return (src && typeof src.get === 'function' ? src.get('backups') : src && src.backups) || null; } catch { return null; }
};
const standIn = (id) => {
const c = look('chess', id);
const b = backups();
if (!c || !b) return null;
if (standIns.has(c)) return standIns.get(c);
let rec;
try { rec = standInRecord(c, b); } catch { rec = null; }
standIns.set(c, rec);
return rec;
};
return {
chess: (id) => look('chess', id), token: (id) => look('tokens', id), item: (id) => look('items', id),
enemy: (id) => look('enemies', id), stage: (id) => look('stages', id), bond: (id) => look('bonds', id),
standIn,
};
}