summaryrefslogtreecommitdiff
path: root/web/src/lib/ui/decks
diff options
context:
space:
mode:
authorJoel Klinghed <the_jk@spawned.biz>2026-11-19 08:53:51 +0100
committerJoel Klinghed <the_jk@spawned.biz>2026-11-19 08:53:51 +0100
commitb884441ba0d10bdd3559748507a0991888f66194 (patch)
tree074321d353c1153e8d95191eecf5a61b2eec1096 /web/src/lib/ui/decks
parentd64cf3514e5ff1ddb1c7f3ddac9a769db3e7dde0 (diff)
Phase 6: settings, saves, localization parity (M6)
Diffstat (limited to 'web/src/lib/ui/decks')
-rw-r--r--web/src/lib/ui/decks/DeckArea.svelte23
1 files changed, 19 insertions, 4 deletions
diff --git a/web/src/lib/ui/decks/DeckArea.svelte b/web/src/lib/ui/decks/DeckArea.svelte
index 6e32dea..e06b0e5 100644
--- a/web/src/lib/ui/decks/DeckArea.svelte
+++ b/web/src/lib/ui/decks/DeckArea.svelte
@@ -15,6 +15,7 @@
import { isCharacter } from '$lib/protocol/types';
import type { CampaignData, ClassData } from '$lib/data/gameData';
import { t } from '$lib/i18n';
+ import { clientSettings, serverSettings } from '$lib/settings';
import {
currentCharacterId,
modifierDeckByName,
@@ -125,12 +126,26 @@
onAmdZoom(card, name, char ? perksFor(char) : null);
}
- const showAmds = $derived(campaignData != null && charsWithPerks.length > 0);
+ const showAmds = $derived(
+ // Phase 6 visibility gates: the server-side `showAmdDeck` hides all
+ // AMD decks; the client-side `showCharacterAMD` hides the characters'
+ // personal ones (the reference mutual gating).
+ $serverSettings?.showAmdDeck !== false &&
+ $clientSettings.showCharacterAMD &&
+ campaignData != null &&
+ charsWithPerks.length > 0
+ );
+
+ /** The shared + ally decks are gated by the server `showAmdDeck` alone. */
+ const showSharedDecks = $derived($serverSettings?.showAmdDeck !== false);
+
+ /** The loot deck is hidden by the server `hideLootDeck`. */
+ const showLoot = $derived($serverSettings?.hideLootDeck !== true);
</script>
<div class="deckarea">
<div class="deckarea__loot">
- {#if $gameState}
+ {#if showLoot && $gameState}
<LootDeckWidget {session} deck={$gameState.lootDeck} onOpenMenu={onOpenLoot} />
{/if}
</div>
@@ -165,7 +180,7 @@
{/if}
{/if}
- {#if $gameState && shouldShowAlliesDeck($gameState)}
+ {#if showSharedDecks && $gameState && shouldShowAlliesDeck($gameState)}
<ModifierDeckWidget
{session}
deck={$gameState.modifierDeckAllies}
@@ -176,7 +191,7 @@
/>
{/if}
- {#if $gameState}
+ {#if showSharedDecks && $gameState}
<ModifierDeckWidget
{session}
deck={$gameState.modifierDeck}