Keep reference panels and journal accessible during replay
This commit is contained in:
parent
92c19b1bba
commit
9ff8ac321b
12 changed files with 127 additions and 80 deletions
|
|
@ -97,3 +97,6 @@ Component styles are bundled into the viewer script because BGS does not load a
|
|||
# Viewer 0.1.49 / engine 0.4.53
|
||||
|
||||
Fanaticism's free infantry now requires losing a battle fought in a city with a Temple. The engine records the Temple condition before capture, so it still applies when that city changes hands. The destination may be any eligible city you own. The advance text now says “If you lose that battle” to make the shared condition explicit. Source: official Monumental Edition rulebook, page 31.
|
||||
# Viewer 0.1.50
|
||||
|
||||
Replay keeps the action toolbar and Journal/Chat controls visible. Research, city management, collection, movement, happiness and available abilities can be opened for inspection; submitting actions, undoing and ending the turn remain disabled. Replay transport and the journal have separate space above the bottom controls on desktop and mobile.
|
||||
|
|
|
|||
4
web-client/package-lock.json
generated
4
web-client/package-lock.json
generated
|
|
@ -1,12 +1,12 @@
|
|||
{
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.49",
|
||||
"version": "0.1.50",
|
||||
"lockfileVersion": 3,
|
||||
"requires": true,
|
||||
"packages": {
|
||||
"": {
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.49",
|
||||
"version": "0.1.50",
|
||||
"dependencies": {
|
||||
"@boardgamers/protocol": "0.9.0",
|
||||
"lucide-svelte": "^0.577.0",
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "@boardgamers/clash-web-client",
|
||||
"version": "0.1.49",
|
||||
"version": "0.1.50",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
{:else}<span class="movement-hint">Choose a highlighted city.</span>{/if}
|
||||
<button
|
||||
class="primary"
|
||||
disabled={!selected || $session.pending}
|
||||
disabled={!!$session.playback || !selected || $session.pending}
|
||||
onclick={() => selected && controller.submit(selected.action, selected.cost)}
|
||||
>
|
||||
Use {active.offer.name}
|
||||
|
|
@ -90,7 +90,7 @@
|
|||
{#if city && city.activations > 0}<ActivationStatus {city} warning />{/if}
|
||||
<button
|
||||
class="primary wide"
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onclick={() =>
|
||||
action.position
|
||||
? controller.chooseAbility(group.key)
|
||||
|
|
@ -126,7 +126,7 @@
|
|||
<p>Choose a target, then the city to influence from. Only one successful attempt per turn.</p>
|
||||
<button
|
||||
class="primary wide"
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onclick={() => controller.chooseInfluence()}>Choose target<ArrowRight size={16} /></button
|
||||
>
|
||||
{:else}<p class="settler-empty">No eligible targets.</p>{/if}
|
||||
|
|
|
|||
|
|
@ -293,37 +293,39 @@
|
|||
!!$session.view?.influence?.length ||
|
||||
!!($session.view && controller.shogunateDraftOffers().length),
|
||||
);
|
||||
let objectiveDecision = $derived($session.view?.objectiveDecision);
|
||||
let choiceDecision = $derived($session.view?.choiceDecision);
|
||||
let objectiveDecision = $derived($session.playback ? null : $session.view?.objectiveDecision);
|
||||
let choiceDecision = $derived($session.playback ? null : $session.view?.choiceDecision);
|
||||
let activeMovementBonus = $derived(movementBonus($session.game));
|
||||
let actionTitle = $derived(
|
||||
$session.pending
|
||||
? 'Confirming…'
|
||||
: waiting
|
||||
? `Waiting for ${$session.view?.players.find((p) => p.index === waiting.player)?.civilization ?? 'another player'}`
|
||||
: $session.seat === undefined
|
||||
? 'Spectating'
|
||||
: $session.game?.state === 'Finished'
|
||||
? 'Game over'
|
||||
: $session.view?.decision
|
||||
? $session.view.decision.endOfAge
|
||||
? 'End of age'
|
||||
: $session.view.decision.name
|
||||
: $session.view?.explorationDecision
|
||||
? 'Place explored terrain'
|
||||
: choiceDecision
|
||||
? 'Choose a bonus'
|
||||
: objectiveDecision
|
||||
? 'Objective available'
|
||||
: $session.view?.stopMovement
|
||||
? activeMovementBonus
|
||||
? `${activeMovementBonus.source} moves`
|
||||
: 'Moving units'
|
||||
: readyToEnd
|
||||
? 'Ready to end turn'
|
||||
: $session.view?.canPlay
|
||||
? 'Your turn'
|
||||
: `${$session.view?.players.find((p) => p.index === $session.view?.activePlayer)?.civilization ?? 'Opponent'}’s turn`,
|
||||
$session.playback
|
||||
? 'Replay · Browse game details'
|
||||
: $session.pending
|
||||
? 'Confirming…'
|
||||
: waiting
|
||||
? `Waiting for ${$session.view?.players.find((p) => p.index === waiting.player)?.civilization ?? 'another player'}`
|
||||
: $session.seat === undefined
|
||||
? 'Spectating'
|
||||
: $session.game?.state === 'Finished'
|
||||
? 'Game over'
|
||||
: $session.view?.decision
|
||||
? $session.view.decision.endOfAge
|
||||
? 'End of age'
|
||||
: $session.view.decision.name
|
||||
: $session.view?.explorationDecision
|
||||
? 'Place explored terrain'
|
||||
: choiceDecision
|
||||
? 'Choose a bonus'
|
||||
: objectiveDecision
|
||||
? 'Objective available'
|
||||
: $session.view?.stopMovement
|
||||
? activeMovementBonus
|
||||
? `${activeMovementBonus.source} moves`
|
||||
: 'Moving units'
|
||||
: readyToEnd
|
||||
? 'Ready to end turn'
|
||||
: $session.view?.canPlay
|
||||
? 'Your turn'
|
||||
: `${$session.view?.players.find((p) => p.index === $session.view?.activePlayer)?.civilization ?? 'Opponent'}’s turn`,
|
||||
);
|
||||
onMount(() => {
|
||||
fullscreenEnabled = document.fullscreenEnabled;
|
||||
|
|
@ -763,8 +765,14 @@
|
|||
</div>
|
||||
<nav class="header-actions">
|
||||
{#if $session.view?.activeEffects?.length}
|
||||
<button class="text-button effects-button" aria-label={`Active effects: ${$session.view.activeEffects.length}`} onclick={() => effectsOpen = true}>
|
||||
<Sparkles size={17} /><span>Effects</span><span class="card-count">{$session.view.activeEffects.length}</span>
|
||||
<button
|
||||
class="text-button effects-button"
|
||||
aria-label={`Active effects: ${$session.view.activeEffects.length}`}
|
||||
onclick={() => (effectsOpen = true)}
|
||||
>
|
||||
<Sparkles size={17} /><span>Effects</span><span class="card-count"
|
||||
>{$session.view.activeEffects.length}</span
|
||||
>
|
||||
</button>
|
||||
{/if}
|
||||
{#if $session.seat !== undefined}
|
||||
|
|
@ -1138,7 +1146,7 @@
|
|||
>{waiting.action}{waiting.source ? ` · ${waiting.source}` : ''}</span
|
||||
>{/if}
|
||||
</div>
|
||||
{#if !waiting && !objectiveDecision && !$session.view?.decision?.endOfAge && ($session.playback?.frame?.round ?? $session.game?.round ?? 1) <= 3}<span
|
||||
{#if !$session.playback && !waiting && !objectiveDecision && !$session.view?.decision?.endOfAge && ($session.game?.round ?? 1) <= 3}<span
|
||||
class="action-markers"
|
||||
role="img"
|
||||
aria-label={`${totalActions} ${totalActions === 1 ? 'action' : 'actions'} remaining`}
|
||||
|
|
@ -1171,7 +1179,9 @@
|
|||
: (city?.reason ?? 'No city can collect resources')}
|
||||
data-tutorial="collect"
|
||||
aria-label="Collect resources"
|
||||
disabled={!$session.view?.canPlay || !collectAvailable || $session.pending}
|
||||
disabled={$session.playback
|
||||
? !city
|
||||
: !$session.view?.canPlay || !collectAvailable || $session.pending}
|
||||
onclick={() => {
|
||||
confirmEnd = false;
|
||||
controller.beginCollect();
|
||||
|
|
@ -1215,7 +1225,7 @@
|
|||
data-tutorial="recruit"
|
||||
aria-label="Recruit units"
|
||||
title="Recruit units · 1 action"
|
||||
disabled={!$session.view?.canPlay || !city || $session.pending}
|
||||
disabled={!city || (!$session.playback && (!$session.view?.canPlay || $session.pending))}
|
||||
onclick={() => {
|
||||
confirmEnd = false;
|
||||
controller.openCities(undefined, 'recruit');
|
||||
|
|
@ -1227,7 +1237,7 @@
|
|||
data-tutorial="happiness"
|
||||
aria-label="Increase happiness"
|
||||
title="Increase happiness · Select cities on the map"
|
||||
disabled={!$session.view?.canPlay || !city || $session.pending}
|
||||
disabled={!city || (!$session.playback && (!$session.view?.canPlay || $session.pending))}
|
||||
onclick={() => {
|
||||
confirmEnd = false;
|
||||
controller.beginHappiness();
|
||||
|
|
@ -1271,13 +1281,13 @@
|
|||
title="Undo last action"
|
||||
data-tutorial="undo"
|
||||
aria-label="Undo last action"
|
||||
disabled={!$session.view?.canUndo || $session.pending}
|
||||
disabled={!!$session.playback || !$session.view?.canUndo || $session.pending}
|
||||
onclick={() => controller.submit('Undo')}><Undo2 size={19} /><span>Undo</span></button
|
||||
>
|
||||
{#if $session.view?.canRedo}<button
|
||||
title="Redo last undone action"
|
||||
aria-label="Redo last undone action"
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onclick={() => controller.submit('Redo')}><Redo2 size={19} /><span>Redo</span></button
|
||||
>{/if}
|
||||
<button
|
||||
|
|
@ -1286,7 +1296,7 @@
|
|||
title="End turn"
|
||||
data-tutorial="end"
|
||||
aria-label="End turn"
|
||||
disabled={!$session.view?.canEndTurn || $session.pending}
|
||||
disabled={!!$session.playback || !$session.view?.canEndTurn || $session.pending}
|
||||
onclick={() => {
|
||||
controller.closeActivity();
|
||||
controller.patch({ mode: 'overview', tilePanel: false });
|
||||
|
|
@ -1340,7 +1350,7 @@
|
|||
><Shapes size={19} /></button
|
||||
>
|
||||
</nav>
|
||||
{#if choiceDecision || objectiveDecision || ($session.game && !$session.view?.supportedPhase && $session.seat === $session.view?.activePlayer) || $session.mode === 'collect' || confirmEnd || ($session.error && $session.mode === 'overview')}
|
||||
{#if choiceDecision || objectiveDecision || (!$session.playback && $session.game && !$session.view?.supportedPhase && $session.seat === $session.view?.activePlayer) || $session.mode === 'collect' || confirmEnd || ($session.error && $session.mode === 'overview')}
|
||||
<section
|
||||
class="action-panel floating-panel"
|
||||
class:board-collection={$session.mode === 'collect'}
|
||||
|
|
@ -1362,11 +1372,17 @@
|
|||
/>{:else}<h2>{printedCardName(choiceDecision.name)}</h2>{/if}
|
||||
{#if choiceDecision.preview}
|
||||
<section class="decision-card-preview" aria-label="Card rules">
|
||||
{#if choiceDecision.preview.wonder}<button class="text-button" onclick={() => wonderReference = choiceDecision.preview!.wonder!}><Landmark size={17} />{printedCardName(choiceDecision.preview.wonder.name)}<BookOpen size={15} /></button>{:else}
|
||||
<h3>{printedCardName(choiceDecision.preview.name)}</h3>
|
||||
{#if choiceDecision.preview.affected}<small>Affects: {choiceDecision.preview.affected}</small
|
||||
>{/if}
|
||||
{#each choiceDecision.preview.rules as rule}<p><ResourceText text={rule} /></p>{/each}
|
||||
{#if choiceDecision.preview.wonder}<button
|
||||
class="text-button"
|
||||
onclick={() => (wonderReference = choiceDecision.preview!.wonder!)}
|
||||
><Landmark size={17} />{printedCardName(choiceDecision.preview.wonder.name)}<BookOpen
|
||||
size={15}
|
||||
/></button
|
||||
>{:else}
|
||||
<h3>{printedCardName(choiceDecision.preview.name)}</h3>
|
||||
{#if choiceDecision.preview.affected}<small>Affects: {choiceDecision.preview.affected}</small
|
||||
>{/if}
|
||||
{#each choiceDecision.preview.rules as rule}<p><ResourceText text={rule} /></p>{/each}
|
||||
{/if}
|
||||
</section>
|
||||
{/if}
|
||||
|
|
@ -1464,7 +1480,7 @@
|
|||
/>{/if}{#if !variant.free}<Zap size={12} />1{/if}</button
|
||||
>{/each}
|
||||
</div>{/if}
|
||||
<ContextualCards {controller} context="collect" />
|
||||
{#if !$session.playback}<ContextualCards {controller} context="collect" />{/if}
|
||||
{#if city && !city.reason}<CollectionBonusHints {city} selection={$session.selection} />{/if}
|
||||
{#if city?.ballcourts}<label class="ballcourts-toggle"
|
||||
><input
|
||||
|
|
@ -1619,7 +1635,7 @@
|
|||
</div>{/if}
|
||||
<button
|
||||
class="primary wide collect-submit"
|
||||
disabled={!$session.preview || $session.pending}
|
||||
disabled={!!$session.playback || !$session.preview || $session.pending}
|
||||
title={`${collectionCostLabel} · Activates this city`}
|
||||
aria-label={`Collect resources${$session.preview ? `: ${pileText($session.preview.total)}` : ''} · ${collectionCostLabel}`}
|
||||
aria-describedby={Object.values($session.preview?.waste ?? {}).some(Boolean)
|
||||
|
|
@ -1663,11 +1679,11 @@
|
|||
{#if $session.error}<p class="inline-error" role="alert">{$session.error}</p>{/if}
|
||||
</section>
|
||||
{/if}
|
||||
{#if $session.mode === 'happiness' && !$session.view?.explorationDecision && !$session.view?.decision && !choiceDecision && !objectiveDecision}<HappinessPanel
|
||||
{#if $session.mode === 'happiness' && ($session.playback || (!$session.view?.explorationDecision && !$session.view?.decision)) && !choiceDecision && !objectiveDecision}<HappinessPanel
|
||||
{controller}
|
||||
onHighlight={(position) => world?.highlightCoordinate(position)}
|
||||
/>{/if}
|
||||
{#if $session.mode === 'settlers' && !$session.view?.explorationDecision && !$session.view?.decision && !choiceDecision && !objectiveDecision}<SettlerPanel
|
||||
{#if $session.mode === 'settlers' && ($session.playback || (!$session.view?.explorationDecision && !$session.view?.decision)) && !choiceDecision && !objectiveDecision}<SettlerPanel
|
||||
{controller}
|
||||
onHighlight={(position) => world?.highlightCoordinate(position)}
|
||||
/>{/if}
|
||||
|
|
@ -1743,7 +1759,10 @@
|
|||
<BattlePlayback {controller} />
|
||||
</div>{/if}
|
||||
</main>
|
||||
{#if wonderReference}<WonderReferenceDialog card={wonderReference} onClose={() => wonderReference = null} />{/if}
|
||||
{#if wonderReference}<WonderReferenceDialog
|
||||
card={wonderReference}
|
||||
onClose={() => (wonderReference = null)}
|
||||
/>{/if}
|
||||
{#if cardReference}<CardReferenceDialog
|
||||
card={cardReference}
|
||||
onDismiss={() => (cardReference = null)}
|
||||
|
|
@ -1753,8 +1772,8 @@
|
|||
reference={researchReference}
|
||||
onDismiss={() => (researchReference = null)}
|
||||
/>
|
||||
{:else if !$session.playback && $session.mode === 'research'}<ResearchTree {controller} />{/if}
|
||||
{#if !$session.playback && $session.mode === 'city'}<CityPanel {controller} />{/if}
|
||||
{:else if $session.mode === 'research'}<ResearchTree {controller} />{/if}
|
||||
{#if $session.mode === 'city'}<CityPanel {controller} />{/if}
|
||||
{#if $session.scorePlayer !== null}<ScoreDialog
|
||||
{controller}
|
||||
onLocate={(position) => world?.locateCoordinate(position)}
|
||||
|
|
@ -1764,7 +1783,13 @@
|
|||
{#if !$session.playback}<CardReveal {controller} />{/if}
|
||||
<PlaybackPanel {controller} />
|
||||
<PublicEffects {controller} />
|
||||
{#if effectsOpen}<ActiveEffectsDialog effects={$session.view?.activeEffects ?? []} players={$session.view?.players ?? []} events={$session.view?.eventCatalog ?? []} cards={$session.view?.cardCatalog ?? []} onClose={() => effectsOpen = false} />{/if}
|
||||
{#if effectsOpen}<ActiveEffectsDialog
|
||||
effects={$session.view?.activeEffects ?? []}
|
||||
players={$session.view?.players ?? []}
|
||||
events={$session.view?.eventCatalog ?? []}
|
||||
cards={$session.view?.cardCatalog ?? []}
|
||||
onClose={() => (effectsOpen = false)}
|
||||
/>{/if}
|
||||
{#if $session.toast}<div class="toast" role="status"><Check size={16} />{$session.toast}</div>{/if}
|
||||
{#if $session.objectivesOpen && $session.seat !== undefined}
|
||||
<dialog
|
||||
|
|
|
|||
|
|
@ -194,7 +194,7 @@
|
|||
{#if tab !== 'happiness'}<AvailabilityFilter {controller} />{/if}
|
||||
</nav>
|
||||
<div class="city-content" bind:this={content}>
|
||||
<ContextualCards {controller} context={tab} />
|
||||
{#if !$session.playback}<ContextualCards {controller} context={tab} />{/if}
|
||||
{#if city && (tab === 'recruit' || (tab === 'build' && buildActivatesCity))}<ActivationStatus
|
||||
{city}
|
||||
warning={tab === 'recruit' || (tab === 'build' && !!selected?.moodWillDecrease)}
|
||||
|
|
@ -392,7 +392,7 @@
|
|||
<div class="port-choices">
|
||||
{#each selected.choices as choice}<button
|
||||
class="primary"
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onclick={() => submitBuild(choice.action)}
|
||||
>Build {selected.name}{choice.position ? ` at ${choice.position}` : ''}</button
|
||||
>{/each}
|
||||
|
|
@ -419,7 +419,7 @@
|
|||
/>{/if}
|
||||
<button
|
||||
class="primary"
|
||||
disabled={!$session.recruitPreview || $session.pending}
|
||||
disabled={!!$session.playback || !$session.recruitPreview || $session.pending}
|
||||
onclick={() => $session.recruitPreview && controller.submit($session.recruitPreview.action)}
|
||||
>{$session.pending
|
||||
? 'Confirming…'
|
||||
|
|
|
|||
|
|
@ -54,12 +54,12 @@
|
|||
onclick={() => controller.patch({ mode: 'overview', error: '' })}><X size={18} /></button
|
||||
>
|
||||
</header>
|
||||
<ContextualCards {controller} context="happiness" />
|
||||
{#if !$session.playback}<ContextualCards {controller} context="happiness" />{/if}
|
||||
{#if choices.length > 1}<div class="variant-picker" aria-label="Happiness action">
|
||||
{#each choices as choice, i}<button
|
||||
class:selected={($session.happinessVariant ?? 0) === i}
|
||||
aria-pressed={($session.happinessVariant ?? 0) === i}
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onclick={() => controller.switchHappinessVariant(i)}
|
||||
>
|
||||
{choice.name}<span
|
||||
|
|
@ -114,7 +114,7 @@
|
|||
class="icon-button"
|
||||
aria-label={`Remove ${cityName(focused.position)} from happiness selection`}
|
||||
title="Remove city"
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onclick={() => controller.setHappinessCity(focused.position, 0)}><X size={15} /></button
|
||||
>{/if}
|
||||
</div>
|
||||
|
|
@ -136,7 +136,7 @@
|
|||
</span>
|
||||
<button
|
||||
class="primary"
|
||||
disabled={!preview.action || $session.pending}
|
||||
disabled={!!$session.playback || !preview.action || $session.pending}
|
||||
onclick={() => preview.action && controller.submit(preview.action)}
|
||||
>
|
||||
{selected.length
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@
|
|||
} = $props();
|
||||
const session = $derived(controller.session);
|
||||
const view = $derived(reference?.view ?? $session.view);
|
||||
const choice = $derived(!reference && researchDecision(view) ? view!.decision : null);
|
||||
const choice = $derived(!reference && !$session.playback && researchDecision(view) ? view!.decision : null);
|
||||
const freeResearch = $derived(!!choice && choice.advanceMode === 'free');
|
||||
const borrowing = $derived(choice?.advanceMode === 'borrow');
|
||||
let query = $state('');
|
||||
|
|
@ -267,7 +267,7 @@
|
|||
/></label
|
||||
>
|
||||
</header>
|
||||
{#if !choice && !reference}<ContextualCards {controller} context="research" />{/if}
|
||||
{#if !choice && !reference && !$session.playback}<ContextualCards {controller} context="research" />{/if}
|
||||
<nav class="research-filters" aria-label="Research categories">
|
||||
<select
|
||||
class="research-status-filter"
|
||||
|
|
@ -498,7 +498,7 @@
|
|||
{#if unavailableReason(selected) && !selected.owned}<small>{unavailableReason(selected)}</small>{/if}
|
||||
{#if $session.error && !reference}<p class="inline-error" role="alert">{$session.error}</p>{/if}
|
||||
</div>
|
||||
{#if !reference}<div class="research-payment">
|
||||
{#if !reference && !$session.playback}<div class="research-payment">
|
||||
{#if !choice && !selected.owned && selected.payments.length > 1}
|
||||
<PaymentPicker
|
||||
options={selected.payments.map((option) => ({
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@
|
|||
>{/if}
|
||||
{#if $session.view?.stopMovement}<button
|
||||
class="movement-done"
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
aria-label="Finish moving"
|
||||
onclick={() => $session.view?.stopMovement && controller.submit($session.view.stopMovement)}
|
||||
>Done<Check size={14} /></button
|
||||
|
|
@ -169,7 +169,7 @@
|
|||
<div class="settler-destinations" role="group" aria-label="Choose how to move">
|
||||
{#each $session.moveDestinations as d, i}{#if d.position === $session.moveTarget}
|
||||
<button
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onmouseenter={() => onHighlight(d.position)}
|
||||
onmouseleave={() => onHighlight(null)}
|
||||
onclick={() => controller.patch({ moveDestination: i })}
|
||||
|
|
@ -215,7 +215,7 @@
|
|||
{#if Object.values(destination.payment).some(Boolean)}<ResourceAmount pile={destination.payment} />{/if}
|
||||
<button
|
||||
class="primary wide"
|
||||
disabled={$session.pending}
|
||||
disabled={!!$session.playback || $session.pending}
|
||||
onclick={() => controller.submit(destination.action)}
|
||||
>
|
||||
{destination.breaksDiplomacy
|
||||
|
|
|
|||
|
|
@ -1287,6 +1287,14 @@ test('opponent recap steps animate and pause, replay stays within its turn, and
|
|||
assert.equal(app.session().playback!.index, 1);
|
||||
assert.equal(app.session().playback!.end, 2);
|
||||
assert.equal(app.session().playback!.playing, false);
|
||||
c.openCities();
|
||||
assert.equal(app.session().mode, 'city', 'city reference stays available during replay');
|
||||
c.beginHappiness();
|
||||
assert.equal(app.session().mode, 'happiness', 'happiness reference stays available during replay');
|
||||
c.setTab('journal');
|
||||
assert.equal(app.session().activityOpen, true, 'journal can open without ending replay');
|
||||
c.submit({ Playing: 'EndTurn' });
|
||||
assert.deepEqual(app.sent, [], 'reference panels cannot submit a move during replay');
|
||||
c.stepPlayback(1);
|
||||
assert.equal(app.session().playback!.index, 2);
|
||||
assert.equal(app.session().playback!.animate, true);
|
||||
|
|
|
|||
|
|
@ -1358,7 +1358,7 @@ export class Controller {
|
|||
}
|
||||
beginHappiness(position?: string) {
|
||||
const s = get(this.session);
|
||||
if (s.pending || s.playback || s.seat === undefined) return;
|
||||
if (s.pending || s.seat === undefined) return;
|
||||
this.closeActivity();
|
||||
this.patch({
|
||||
mode: 'happiness',
|
||||
|
|
|
|||
|
|
@ -5345,16 +5345,12 @@ small {
|
|||
}
|
||||
}
|
||||
|
||||
/* Playback leaves the board and camera controls available, hiding live decisions. */
|
||||
/* Keep reference controls and journal/chat available while hiding live decisions. */
|
||||
.playing-back .header-actions,
|
||||
.playing-back .resource-bar,
|
||||
.playing-back:not(.full-replay) .player-list,
|
||||
.playing-back .board-toolbar,
|
||||
.playing-back .city-dock,
|
||||
.playing-back .action-panel,
|
||||
.playing-back .journal-tools,
|
||||
.playing-back .table-tools,
|
||||
.playing-back .activity,
|
||||
.playing-back .action-panel:not(.board-collection):not(.board-movement):not(.happiness-panel):not(.abilities-panel),
|
||||
.playing-back .map-instruction,
|
||||
.playing-back .map-resume,
|
||||
.playing-back .map-minimize,
|
||||
|
|
@ -5364,7 +5360,7 @@ small {
|
|||
.playback-bar {
|
||||
position: absolute;
|
||||
z-index: 80;
|
||||
bottom: 16px;
|
||||
bottom: 126px;
|
||||
left: 50%;
|
||||
transform: translateX(-50%);
|
||||
width: 720px;
|
||||
|
|
@ -5514,7 +5510,7 @@ small {
|
|||
.playback-bar {
|
||||
grid-template-columns: 1fr auto;
|
||||
gap: 8px;
|
||||
bottom: 12px;
|
||||
bottom: 120px;
|
||||
width: calc(100% - 24px);
|
||||
padding: 10px 12px;
|
||||
}
|
||||
|
|
@ -6191,3 +6187,18 @@ small {
|
|||
color: #fff;
|
||||
font: bold 12px/1 sans-serif;
|
||||
}
|
||||
|
||||
.game-shell.playing-back .activity.floating-panel {
|
||||
bottom: 260px;
|
||||
height: min(470px, calc(100% - 280px));
|
||||
}
|
||||
@media (max-width: 600px) {
|
||||
.game-shell.playing-back .activity.floating-panel {
|
||||
bottom: 285px;
|
||||
height: max(120px, calc(100% - 405px));
|
||||
}
|
||||
}
|
||||
|
||||
.playing-back .board-toolbar {
|
||||
display: block;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue