From 8ff0b8972fb509dee1e68f682919ce2b0ffbd65a Mon Sep 17 00:00:00 2001 From: Christopher Kaster Date: Tue, 10 Dec 2024 23:48:17 +0100 Subject: [PATCH] add ability to hide weapon talents --- src/lib/components/TalentList.svelte | 54 ++++++++++++++++------------ src/lib/state.svelte.ts | 1 + 2 files changed, 33 insertions(+), 22 deletions(-) diff --git a/src/lib/components/TalentList.svelte b/src/lib/components/TalentList.svelte index 145752a..46d4be2 100644 --- a/src/lib/components/TalentList.svelte +++ b/src/lib/components/TalentList.svelte @@ -1,6 +1,7 @@ {#if available}
-
- Talents +
+
Talents
+
- {#each selected.talents as row, rowIndex} - {#if selected.talents[rowIndex].some(v => v)} -
    -
  • - {#if weaponData.talents[rowIndex].name} - {translatableString(weaponData.talents[rowIndex].name)} - {:else} - Talent #{rowIndex + 1} - {/if} -
  • - + {#if $configViewWeaponTalents} + {#each selected.talents as row, rowIndex} + {#if selected.talents[rowIndex].some(v => v)}
      - {#each row as col, colIndex} - {#if col} -
    • - -
    • +
    • + {#if weaponData.talents[rowIndex].name} + {translatableString(weaponData.talents[rowIndex].name)} + {:else} + Talent #{rowIndex + 1} {/if} - {/each} +
    • + +
        + {#each row as col, colIndex} + {#if col} +
      • + +
      • + {/if} + {/each} +
    -
- {/if} - {/each} + {/if} + {/each} + {/if}
{/if} diff --git a/src/lib/state.svelte.ts b/src/lib/state.svelte.ts index a3a2460..688ca95 100644 --- a/src/lib/state.svelte.ts +++ b/src/lib/state.svelte.ts @@ -41,3 +41,4 @@ const storagable = (key: string, defaultValue: T): Writable => { }; export let configViewWeaponAbilities = storagable("config.builder.view-weapon-abilities", true); +export let configViewWeaponTalents = storagable("config.builder.view-weapon-talents", true);