feedback5 WE2: the briefing and the 本局信息 views name a 自选 piece the match leaves out of the shop (#11)
m.private.diyBanned (every bond of the operator off this match) is shown under 本局禁用干员 in the INFO_CHECK briefing, the strategy draft's 本局信息 dialog and the in-game 本局信息 tab: ui/gameLogic/diy.js diyBannedPieces, ui/matchInfo.js matchInfoModel diyBanned + DiyBannedLine (t() with English in public/i18n/en.json). Client only; golden unchanged.
This commit is contained in:
1 parent
7b83028139
commit
d31de31e31
13 files changed
+146
-17
No files matched your search
@@ -92,3 +92,23 @@ export function pickGetter(getChess, pick, data) {
|
||||
|
||||
/** Whether a record is a composed 自选 record. */
|
||||
export const isDiyRecord = (rec) => isObj(rec) && typeof rec.diyFor === 'string';
|
||||
|
||||
/**
|
||||
* The player's slotted 自选 pieces this match leaves out of the shop because every bond of the operator is switched off
|
||||
* (m.private.diyBanned — the server's initDiyStock: no stock), in slot order: [{ slotId, charId, name }] (the operator's
|
||||
* name from its composed record; the charId when the data lacks it). [] without any.
|
||||
* @param {any} priv m.private @param {(id: string) => any} getChess @param {{ chess?: any, backups?: any }} data
|
||||
*/
|
||||
export function diyBannedPieces(priv, getChess, data) {
|
||||
const ids = Array.isArray(priv?.diyBanned) ? priv.diyBanned.filter((id) => typeof id === 'string') : [];
|
||||
const picks = diyPicks(priv);
|
||||
const out = [];
|
||||
for (const slotId of ids) {
|
||||
const pick = picks[slotId];
|
||||
if (!isObj(pick) || typeof pick.charId !== 'string') continue;
|
||||
const chess = getChess(slotId);
|
||||
const rec = chess ? diyRecordFor(chess, pick, data) : null;
|
||||
out.push({ slotId, charId: pick.charId, name: rec?.name || pick.charId });
|
||||
}
|
||||
return out;
|
||||
}
|
||||
Reference in new issue
Block a user