The league has its court: the tournament setup shows the home venue, not a choice
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
1 parent
d4780de76d
commit
041827c4dc
3 files changed
+24
-4
No files matched your search
+13
-2
@@ -342,11 +342,21 @@ function syncSetup() {
|
||||
document.getElementById('s01').textContent = leagueMode ? '01 · YOUR LEAGUE' : '01 · PLAYER';
|
||||
if (leagueMode) buildLeaguePanel();
|
||||
if (!courtUnlocked(picked)) picked = leagueOf(profile.prof.lg).court;
|
||||
// ...and the COURT section stops pretending to be a choice on the league modes (Oliver: a
|
||||
// league HAS its court — start() has forced it all along): only the league's own row shows,
|
||||
// ringed, as the venue. Every other mode gets the full pickable list. This runs AFTER the
|
||||
// generic repaint below would, so it has the last word on .on/.lock.
|
||||
const homeCourt = leagueOf(profile.prof.lg).court;
|
||||
document.getElementById('s02').innerHTML = leagueMode
|
||||
? '02 · HOME COURT<span>SET BY YOUR LEAGUE</span>' : '02 · COURT';
|
||||
courtList.classList.toggle('fixed', leagueMode);
|
||||
for (const el of courtList.children) {
|
||||
const c = COURTS.find(x => x.id === el.dataset.id), l = courtLeague(el.dataset.id);
|
||||
const open = courtUnlocked(el.dataset.id);
|
||||
el.classList.toggle('lock', !open);
|
||||
el.classList.toggle('on', open && el.dataset.id === picked);
|
||||
el.classList.toggle('lock', !open && !leagueMode);
|
||||
el.classList.toggle('on', leagueMode ? el.dataset.id === homeCourt
|
||||
: open && el.dataset.id === picked);
|
||||
el.style.display = leagueMode && el.dataset.id !== homeCourt ? 'none' : '';
|
||||
// the sub line carries the lock and names the price — the tile stays visible, as a goal should
|
||||
el.querySelector('i').textContent = open ? c.sub : 'LOCKED — REACH ' + l.name;
|
||||
}
|
||||
@@ -430,6 +440,7 @@ for (const c of COURTS) {
|
||||
// Tapping a tile SELECTS it and nothing more. It used to start the match on the spot, which gave
|
||||
// you no way to look at the three of them and no way back out of the screen.
|
||||
b.addEventListener('click', () => {
|
||||
if (pickedMode === 'zombie' || pickedMode === 'cup') return; // the league picks the venue
|
||||
if (!courtUnlocked(c.id)) return; // locked: the row itself says which league opens it
|
||||
picked = c.id;
|
||||
for (const el of courtList.children) el.classList.toggle('on', el === b);
|
||||
|
||||
Reference in new issue
Block a user