fix(offline): scope the medal treatment to hotseat only
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m7s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m40s
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Has been skipped
CI / integration (pull_request) Has been skipped
CI / ui (pull_request) Successful in 1m7s
CI / conformance (pull_request) Successful in 10s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m40s
Per owner: a vs_ai game (one human) keeps its 'you won/lost' status text AND its lobby medal — the hidden-status + per-seat-medal treatment applies only to hotseat, where 2-4 local players make a single 'you' meaningless. isLocalGameId -> game.hotseat at the three call sites (statusBlock, seat plaque, lobby card).
This commit is contained in:
@@ -1497,7 +1497,7 @@
|
|||||||
{#if badge}<span class="unread-dot sbadge-dot" class:nudge={badge === 'nudge'}></span>{/if}
|
{#if badge}<span class="unread-dot sbadge-dot" class:nudge={badge === 'nudge'}></span>{/if}
|
||||||
{#each view.game.seats as s (s.seat)}
|
{#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="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]}>
|
<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}
|
{#if blockConfirm[s.seat]}{t('game.blockShort')}{:else if addConfirm[s.seat]}{t('game.addFriendShort')}{:else}{s.score}{/if}
|
||||||
</div>
|
</div>
|
||||||
@@ -1623,9 +1623,10 @@
|
|||||||
<div class="status">
|
<div class="status">
|
||||||
<span>{view.bagLen === 0 ? t('game.bagEmpty') : t('game.bag', { n: view.bagLen })}</span>
|
<span>{view.bagLen === 0 ? t('game.bagEmpty') : t('game.bag', { n: view.bagLen })}</span>
|
||||||
{#if gameOver}
|
{#if gameOver}
|
||||||
<!-- A local (offline) game shows its result as per-seat medals on the plaques (below), not a
|
<!-- A hotseat 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". -->
|
viewer-centric "you won/lost" — with 2-4 local players there is no single "you". A vs_ai
|
||||||
{#if !isLocalGameId(id)}<strong class="over">{resultText()}</strong>{/if}
|
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}
|
{: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>
|
<span class="turn-ind">{view.game.hotseat ? t('hotseat.turnOf', { name: hotseatName(view.game.toMove) }) : isMyTurn ? t('game.yourTurn') : turnLabel()}</span>
|
||||||
{/if}
|
{/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),
|
* 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
|
* so a hotseat game can show each player's medal on their plaque instead of a single viewer-centric
|
||||||
* viewer-centric "you won/lost". The winner takes the trophy; the rest place by score (a draw — no
|
* "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.
|
* winner — gives every seat the medal). Mirrors the ranking in resultBadge, keyed by seat not viewer.
|
||||||
*/
|
*/
|
||||||
export function seatMedal(game: GameView, seat: number): string {
|
export function seatMedal(game: GameView, seat: number): string {
|
||||||
|
|||||||
@@ -354,10 +354,11 @@
|
|||||||
>
|
>
|
||||||
</span>
|
</span>
|
||||||
<!-- Re-key on the per-card blink nonce so a repeat blink restarts the fade. A
|
<!-- 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
|
hotseat game shows no lobby medal — its result lives on the in-game seat
|
||||||
seat plaques, and resultBadge is viewer-centric (no seat matches the account). -->
|
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}
|
{#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}
|
{/key}
|
||||||
</button>
|
</button>
|
||||||
{#if group.finished || g.hotseat}
|
{#if group.finished || g.hotseat}
|
||||||
|
|||||||
Reference in New Issue
Block a user