Warn on the placement confirm when placing ends undo for the turn
A placement that crosses a commit boundary mid-turn, such as a second tile whose merger pays bonuses, now shows the same note as the merger confirmations.
This commit is contained in:
parent
dc8d0f4d85
commit
9d76acba21
1 changed files with 11 additions and 0 deletions
|
|
@ -17,6 +17,11 @@
|
|||
store.state?.phase === "place" && store.moves.length > 0 && !store.sending ? store.selected : undefined
|
||||
);
|
||||
|
||||
// Placing can cross a commit boundary mid-turn (e.g. paying merger bonuses), ending undo.
|
||||
const final = $derived(
|
||||
tile !== undefined && store.drafting && !!store.outcome({ type: "place", tile: tileLabel(tile) })?.commits
|
||||
);
|
||||
|
||||
let row = $state<HTMLElement>();
|
||||
// Bring the confirmation into view when it opens below a rack at the bottom of the screen.
|
||||
$effect(() => {
|
||||
|
|
@ -37,6 +42,7 @@
|
|||
>{t("place.button", { tile: tileLabel(tile) })}</button
|
||||
>
|
||||
<button type="button" class="actionable" onclick={() => (store.selected = undefined)}>{t("place.another")}</button>
|
||||
{#if final}<p class="final-note">{t("turn.finalStep")}</p>{/if}
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
|
|
@ -49,6 +55,11 @@
|
|||
p {
|
||||
margin: 0 0 8px;
|
||||
}
|
||||
.final-note {
|
||||
margin: 4px 0 0;
|
||||
font-size: 13px;
|
||||
color: var(--ink-muted);
|
||||
}
|
||||
button {
|
||||
margin-block: 4px;
|
||||
margin-inline: 0 8px;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue