Lobby zeigt konkret, was einem Team zum Veto-Start fehlt

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
SPP UserandClaude Opus 5.5 committed 2026-10-25 17:09:31 +01:00
1 parent 568ccf9b09
commit 3999c4b111
3 files changed
+38 -12

No files matched your search

+33 -11
View File
@@ -126,19 +126,26 @@ function Stage(ctx) {
const missing = [A, B].filter((t) => !t.readiness.ready);
return (
<div className="stage-note">
<h2>Warten auf beide Teams</h2>
<p className="muted">
{missing.length === 0
? 'Beide Teams sind bereit.'
: missing.map((t) => `${t.name}: ${t.readiness.count}/${t.teamSize} Spieler, ${t.readiness.allReady ? 'alle bereit' : 'noch nicht alle bereit'}`).join(' – ')}
</p>
<h2>{missing.length === 0 ? 'Beide Teams sind bereit' : 'Warten auf beide Teams'}</h2>
{missing.length > 0 && (
<ul className="missing-list">
{missing.map((t) => <li key={t.key}><strong className={`team-${t.key.toLowerCase()}`}>{t.name}:</strong> {readinessGap(t, state.requireFullTeams)}</li>)}
</ul>
)}
{isOrg ? (
<button className="btn btn-primary btn-lg" disabled={!state.canStartVeto || !!busy}
onClick={() => act('veto/start', null, 'Veto gestartet')}>
Veto starten
</button>
<>
<button className="btn btn-primary btn-lg" disabled={!state.canStartVeto || !!busy}
onClick={() => act('veto/start', null, 'Veto gestartet')}>
Veto starten
</button>
{!state.canStartVeto && <p className="small muted">Der Knopf wird aktiv, sobald beide Teams bereit sind.</p>}
</>
) : (
<p className="small muted">Der Organisator startet das Veto, sobald beide Teams bereit sind.</p>
<p className="small muted">
{missing.length === 0
? 'Der Organisator kann das Veto jetzt starten.'
: 'Sobald beide Teams bereit sind, startet der Organisator das Veto.'}
</p>
)}
<MapPoolPreview maps={state.maps} />
</div>
@@ -153,6 +160,21 @@ function Stage(ctx) {
);
}
/** Sagt konkret, was einem Team noch fehlt, damit es als bereit gilt. */
function readinessGap(team, requireFull) {
const r = team.readiness;
const gaps = [];
if (!r.enough) {
const need = requireFull ? team.teamSize - r.count : 1;
gaps.push(requireFull
? `noch ${need} von ${team.teamSize} Spielern fehlen (Team muss vollständig sein)`
: 'mindestens ein Spieler fehlt');
}
if (r.count > 0 && !r.allReady) gaps.push('noch nicht alle haben „bereit“ geklickt');
if (r.count > 0 && !r.hasCaptain) gaps.push('kein Captain');
return gaps.join(', ');
}
function MapPoolPreview({ maps }) {
return (
<div className="pool-preview" aria-label="Map-Pool">