add unlimited raids with 7 character slots

This commit is contained in:
Justin Edmund 2025-12-20 01:58:11 -08:00
parent 29142ab901
commit e1fe9810ce
8 changed files with 51 additions and 9 deletions

View file

@ -12,7 +12,8 @@
{#if row.hl}<span class="flag hl">HL</span>{/if} {#if row.hl}<span class="flag hl">HL</span>{/if}
{#if row.extra}<span class="flag extra">Extra</span>{/if} {#if row.extra}<span class="flag extra">Extra</span>{/if}
{#if row.guidebooks}<span class="flag guidebooks">Guidebooks</span>{/if} {#if row.guidebooks}<span class="flag guidebooks">Guidebooks</span>{/if}
{#if !row.hl && !row.extra && !row.guidebooks} {#if row.unlimited}<span class="flag unlimited">Unlimited</span>{/if}
{#if !row.hl && !row.extra && !row.guidebooks && !row.unlimited}
<span class="no-flags"></span> <span class="no-flags"></span>
{/if} {/if}
</div> </div>
@ -47,6 +48,11 @@
background: #28a745; background: #28a745;
color: white; color: white;
} }
&.unlimited {
background: #fd7e14;
color: white;
}
} }
.no-flags { .no-flags {

View file

@ -13,15 +13,20 @@
mainWeaponElement?: number | null | undefined mainWeaponElement?: number | null | undefined
partyElement?: number | null | undefined partyElement?: number | null | undefined
container?: string | undefined container?: string | undefined
unlimited?: boolean
} }
let { let {
characters = [], characters = [],
mainWeaponElement = undefined, mainWeaponElement = undefined,
partyElement = undefined, partyElement = undefined,
container = 'main-characters' container = 'main-characters',
unlimited = false
}: Props = $props() }: Props = $props()
// Dynamic slot count based on unlimited flag
const slotCount = $derived(unlimited ? 7 : 5)
import CharacterUnit from '$lib/components/units/CharacterUnit.svelte' import CharacterUnit from '$lib/components/units/CharacterUnit.svelte'
const ctx = getContext<PartyContext>('party') const ctx = getContext<PartyContext>('party')
@ -29,9 +34,9 @@
// Create array with proper empty slots // Create array with proper empty slots
let characterSlots = $derived.by(() => { let characterSlots = $derived.by(() => {
const slots: (GridCharacter | undefined)[] = Array(5).fill(undefined) const slots: (GridCharacter | undefined)[] = Array(slotCount).fill(undefined)
characters.forEach(char => { characters.forEach(char => {
if (char.position >= 0 && char.position < 5) { if (char.position >= 0 && char.position < slotCount) {
slots[char.position] = char slots[char.position] = char
} }
}) })
@ -42,6 +47,7 @@
<div class="wrapper"> <div class="wrapper">
<ul <ul
class="characters" class="characters"
class:unlimited
aria-label="Character Grid" aria-label="Character Grid"
> >
{#each characterSlots as character, i} {#each characterSlots as character, i}
@ -95,6 +101,10 @@
grid-template-columns: repeat(5, minmax(0, 1fr)); grid-template-columns: repeat(5, minmax(0, 1fr));
gap: $unit-3x; gap: $unit-3x;
&.unlimited {
grid-template-columns: repeat(7, minmax(0, 1fr));
}
& > li { & > li {
list-style: none; list-style: none;
} }

View file

@ -999,6 +999,7 @@
characters={party.characters} characters={party.characters}
{mainWeaponElement} {mainWeaponElement}
{partyElement} {partyElement}
unlimited={(party as any)?.raid?.group?.unlimited}
/> />
</div> </div>
{/if} {/if}

View file

@ -12,4 +12,5 @@ export interface RaidGroup {
extra: boolean extra: boolean
guidebooks: boolean guidebooks: boolean
hl: boolean hl: boolean
unlimited: boolean
} }

View file

@ -29,6 +29,7 @@ export interface RaidGroupFlat {
hl: boolean hl: boolean
extra: boolean extra: boolean
guidebooks: boolean guidebooks: boolean
unlimited: boolean
} }
// Full RaidGroup (from :full view, includes raids) // Full RaidGroup (from :full view, includes raids)
@ -65,6 +66,7 @@ export interface CreateRaidGroupInput {
hl: boolean hl: boolean
extra: boolean extra: boolean
guidebooks: boolean guidebooks: boolean
unlimited: boolean
} }
export interface UpdateRaidGroupInput { export interface UpdateRaidGroupInput {
@ -76,6 +78,7 @@ export interface UpdateRaidGroupInput {
hl?: boolean hl?: boolean
extra?: boolean extra?: boolean
guidebooks?: boolean guidebooks?: boolean
unlimited?: boolean
} }
// Filter types for raid queries // Filter types for raid queries
@ -86,4 +89,5 @@ export interface RaidFilters {
hl?: boolean hl?: boolean
extra?: boolean extra?: boolean
guidebooks?: boolean guidebooks?: boolean
unlimited?: boolean
} }

View file

@ -96,6 +96,9 @@
<DetailItem label="Guidebooks"> <DetailItem label="Guidebooks">
<span class="badge" class:active={group.guidebooks}>{group.guidebooks ? 'Yes' : 'No'}</span> <span class="badge" class:active={group.guidebooks}>{group.guidebooks ? 'Yes' : 'No'}</span>
</DetailItem> </DetailItem>
<DetailItem label="Unlimited">
<span class="badge" class:active={group.unlimited}>{group.unlimited ? 'Yes' : 'No'}</span>
</DetailItem>
</DetailsContainer> </DetailsContainer>
{#if group.raids && group.raids.length > 0} {#if group.raids && group.raids.length > 0}

View file

@ -44,7 +44,8 @@
difficulty: 1, difficulty: 1,
hl: false, hl: false,
extra: false, extra: false,
guidebooks: false guidebooks: false,
unlimited: false
}) })
// Sync edit data when group changes // Sync edit data when group changes
@ -58,7 +59,8 @@
difficulty: group.difficulty ?? 1, difficulty: group.difficulty ?? 1,
hl: group.hl ?? false, hl: group.hl ?? false,
extra: group.extra ?? false, extra: group.extra ?? false,
guidebooks: group.guidebooks ?? false guidebooks: group.guidebooks ?? false,
unlimited: group.unlimited ?? false
} }
} }
}) })
@ -84,7 +86,8 @@
difficulty: editData.difficulty, difficulty: editData.difficulty,
hl: editData.hl, hl: editData.hl,
extra: editData.extra, extra: editData.extra,
guidebooks: editData.guidebooks guidebooks: editData.guidebooks,
unlimited: editData.unlimited
}) })
// Invalidate queries // Invalidate queries
@ -181,6 +184,12 @@
editable={true} editable={true}
type="checkbox" type="checkbox"
/> />
<DetailItem
label="Unlimited"
bind:value={editData.unlimited}
editable={true}
type="checkbox"
/>
</DetailsContainer> </DetailsContainer>
</section> </section>
{:else} {:else}

View file

@ -31,7 +31,8 @@
difficulty: 1, difficulty: 1,
hl: false, hl: false,
extra: false, extra: false,
guidebooks: false guidebooks: false,
unlimited: false
}) })
// Validation // Validation
@ -55,7 +56,8 @@
difficulty: editData.difficulty, difficulty: editData.difficulty,
hl: editData.hl, hl: editData.hl,
extra: editData.extra, extra: editData.extra,
guidebooks: editData.guidebooks guidebooks: editData.guidebooks,
unlimited: editData.unlimited
}) })
// Invalidate queries // Invalidate queries
@ -147,6 +149,12 @@
editable={true} editable={true}
type="checkbox" type="checkbox"
/> />
<DetailItem
label="Unlimited"
bind:value={editData.unlimited}
editable={true}
type="checkbox"
/>
</DetailsContainer> </DetailsContainer>
</section> </section>
</div> </div>