The setup grows a league face: badge, felled tally, the band's roster — and a bigger ribbon

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
wuwiandClaude Fable 5 committed 2026-08-29 16:10:31 +02:00
1 parent 5c34632513
commit d4780de76d
3 files changed
+86 -3

No files matched your search

+35
View File
@@ -303,9 +303,44 @@ swatches('kitRow', 'kitName', KITS, 'kit', () => pickedKit, id => pickedKit = id
swatches('skinRow', 'skinName', SKINS, 'skin', () => pickedSkin, id => pickedSkin = id);
refreshLook();
// THE LEAGUE PANEL (the leagues): the setup's league-mode face — your league writ large and the
// band's roster with your all-time felled counts (stats' per-foe tallies, key 'L'+index). The
// identity block this replaces still shows for every non-league mode; the card owns it anyway.
function buildLeaguePanel() {
const lg = leagueOf(profile.prof.lg);
const badge = document.getElementById('lgBadge');
badge.src = `assets/badge_l${lg.id}.png?v=${SPRV}`;
const name = document.getElementById('lgName');
name.textContent = `LEAGUE ${lg.id} — ${lg.name}`;
name.style.color = lg.color;
const z = stats.read('all', undefined, stats.MODE_MATCH).z;
const foes = document.getElementById('lgFoes');
foes.innerHTML = '';
let felled = 0;
for (let n = lg.band[0]; n <= lg.band[1]; n++) {
const f = matchFoe(n), k = z[f.key] || 0;
if (k) felled++;
const d = document.createElement('div');
d.className = 'lgFoe' + (k ? '' : ' un') + (n === lg.band[1] ? ' fin' : '');
d.innerHTML = `<img src="${foeArt(f)}" alt=""><b>${f.short}</b><i>${k ? '×' + k : '—'}</i>`;
foes.appendChild(d);
}
const size = lg.band[1] - lg.band[0] + 1;
document.getElementById('lgSub').textContent = felled >= size
? 'ALL ' + size + ' FELLED — TAKE THE CUP'
: felled + ' OF ' + size + ' FELLED · THE CUP IS THE WAY UP';
}
// The setup screen's rows, brought up to date with picks made elsewhere (the identity screen).
// Selection state lives in picked*; the rows are just its picture and must be repainted on entry.
// On the LEAGUE MODES the player block steps aside for the league panel (Oliver: the identity is
// on the card now — the setup should show the league and who of it you have already beaten).
function syncSetup() {
const leagueMode = pickedMode === 'zombie' || pickedMode === 'cup';
document.getElementById('who').style.display = leagueMode ? 'none' : 'flex';
document.getElementById('lgPanel').style.display = leagueMode ? 'block' : 'none';
document.getElementById('s01').textContent = leagueMode ? '01 · YOUR LEAGUE' : '01 · PLAYER';
if (leagueMode) buildLeaguePanel();
if (!courtUnlocked(picked)) picked = leagueOf(profile.prof.lg).court;
for (const el of courtList.children) {
const c = COURTS.find(x => x.id === el.dataset.id), l = courtLeague(el.dataset.id);