feat(offline): local pass-and-play (hotseat) — 2-4 players, seat/host PINs #211
@@ -1497,7 +1497,7 @@
|
||||
{#if badge}<span class="unread-dot sbadge-dot" class:nudge={badge === 'nudge'}></span>{/if}
|
||||
{#each view.game.seats as s (s.seat)}
|
||||
<div class="seat" class:turn={view.game.toMove === s.seat && !gameOver} class:win={s.isWinner}>
|
||||
<div class="nm" class:struck={seatBlocked(s)}>{#if gameOver && isLocalGameId(id)}<span class="medal" aria-hidden="true">{seatMedal(view.game, s.seat)}</span>{/if}{seatName(s)}</div>
|
||||
<div class="nm" class:struck={seatBlocked(s)}>{#if gameOver && view.game.hotseat}<span class="medal" aria-hidden="true">{seatMedal(view.game, s.seat)}</span>{/if}{seatName(s)}</div>
|
||||
<div class="sc" class:blockprompt={blockConfirm[s.seat]}>
|
||||
{#if blockConfirm[s.seat]}{t('game.blockShort')}{:else if addConfirm[s.seat]}{t('game.addFriendShort')}{:else}{s.score}{/if}
|
||||
</div>
|
||||
@@ -1623,9 +1623,10 @@
|
||||
<div class="status">
|
||||
<span>{view.bagLen === 0 ? t('game.bagEmpty') : t('game.bag', { n: view.bagLen })}</span>
|
||||
{#if gameOver}
|
||||
<!-- A local (offline) game shows its result as per-seat medals on the plaques (below), not a
|
||||
viewer-centric "you won/lost" — the outcome is not always about a single "you". -->
|
||||
{#if !isLocalGameId(id)}<strong class="over">{resultText()}</strong>{/if}
|
||||
<!-- A hotseat game shows its result as per-seat medals on the plaques (below), not a
|
||||
viewer-centric "you won/lost" — with 2-4 local players there is no single "you". A vs_ai
|
||||
game keeps the "you won/lost" text (one human). -->
|
||||
{#if !view.game.hotseat}<strong class="over">{resultText()}</strong>{/if}
|
||||
{:else if placement.pending.length === 0}
|
||||
<span class="turn-ind">{view.game.hotseat ? t('hotseat.turnOf', { name: hotseatName(view.game.toMove) }) : isMyTurn ? t('game.yourTurn') : turnLabel()}</span>
|
||||
{/if}
|
||||
|
||||
@@ -33,8 +33,9 @@ export function resultBadge(game: GameView, myId: string): ResultBadge {
|
||||
|
||||
/**
|
||||
* seatMedal returns a per-SEAT place emoji for a finished game (empty while it is still in progress),
|
||||
* so a local (offline) game can show each player's medal on their plaque instead of a single
|
||||
* viewer-centric "you won/lost". The winner takes the trophy; the rest place by score (a draw — no
|
||||
* so a hotseat game can show each player's medal on their plaque instead of a single viewer-centric
|
||||
* "you won/lost" (which is meaningless with 2-4 local players). The winner takes the trophy; the
|
||||
* rest place by score (a draw — no
|
||||
* winner — gives every seat the medal). Mirrors the ranking in resultBadge, keyed by seat not viewer.
|
||||
*/
|
||||
export function seatMedal(game: GameView, seat: number): string {
|
||||
|
||||
@@ -354,10 +354,11 @@
|
||||
>
|
||||
</span>
|
||||
<!-- Re-key on the per-card blink nonce so a repeat blink restarts the fade. A
|
||||
local (offline) game shows no lobby medal — its result lives on the in-game
|
||||
seat plaques, and resultBadge is viewer-centric (no seat matches the account). -->
|
||||
hotseat game shows no lobby medal — its result lives on the in-game seat
|
||||
plaques, and resultBadge is viewer-centric (no seat matches the account). A
|
||||
vs_ai game keeps its medal (one human, a straightforward win/loss). -->
|
||||
{#key blinkNonce.get(g.id) ?? 0}
|
||||
<span class="emoji" class:blink={blinkingIds.has(g.id)}>{isLocalGameId(g.id) ? '' : resultBadge(g, myId).emoji}</span>
|
||||
<span class="emoji" class:blink={blinkingIds.has(g.id)}>{g.hotseat ? '' : resultBadge(g, myId).emoji}</span>
|
||||
{/key}
|
||||
</button>
|
||||
{#if group.finished || g.hotseat}
|
||||
|
||||
Reference in New Issue
Block a user