add unlimited raids with 7 character slots
This commit is contained in:
parent
29142ab901
commit
e1fe9810ce
8 changed files with 51 additions and 9 deletions
|
|
@ -12,7 +12,8 @@
|
|||
{#if row.hl}<span class="flag hl">HL</span>{/if}
|
||||
{#if row.extra}<span class="flag extra">Extra</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>
|
||||
{/if}
|
||||
</div>
|
||||
|
|
@ -47,6 +48,11 @@
|
|||
background: #28a745;
|
||||
color: white;
|
||||
}
|
||||
|
||||
&.unlimited {
|
||||
background: #fd7e14;
|
||||
color: white;
|
||||
}
|
||||
}
|
||||
|
||||
.no-flags {
|
||||
|
|
|
|||
|
|
@ -13,15 +13,20 @@
|
|||
mainWeaponElement?: number | null | undefined
|
||||
partyElement?: number | null | undefined
|
||||
container?: string | undefined
|
||||
unlimited?: boolean
|
||||
}
|
||||
|
||||
let {
|
||||
characters = [],
|
||||
mainWeaponElement = undefined,
|
||||
partyElement = undefined,
|
||||
container = 'main-characters'
|
||||
container = 'main-characters',
|
||||
unlimited = false
|
||||
}: Props = $props()
|
||||
|
||||
// Dynamic slot count based on unlimited flag
|
||||
const slotCount = $derived(unlimited ? 7 : 5)
|
||||
|
||||
import CharacterUnit from '$lib/components/units/CharacterUnit.svelte'
|
||||
|
||||
const ctx = getContext<PartyContext>('party')
|
||||
|
|
@ -29,9 +34,9 @@
|
|||
|
||||
// Create array with proper empty slots
|
||||
let characterSlots = $derived.by(() => {
|
||||
const slots: (GridCharacter | undefined)[] = Array(5).fill(undefined)
|
||||
const slots: (GridCharacter | undefined)[] = Array(slotCount).fill(undefined)
|
||||
characters.forEach(char => {
|
||||
if (char.position >= 0 && char.position < 5) {
|
||||
if (char.position >= 0 && char.position < slotCount) {
|
||||
slots[char.position] = char
|
||||
}
|
||||
})
|
||||
|
|
@ -42,6 +47,7 @@
|
|||
<div class="wrapper">
|
||||
<ul
|
||||
class="characters"
|
||||
class:unlimited
|
||||
aria-label="Character Grid"
|
||||
>
|
||||
{#each characterSlots as character, i}
|
||||
|
|
@ -95,6 +101,10 @@
|
|||
grid-template-columns: repeat(5, minmax(0, 1fr));
|
||||
gap: $unit-3x;
|
||||
|
||||
&.unlimited {
|
||||
grid-template-columns: repeat(7, minmax(0, 1fr));
|
||||
}
|
||||
|
||||
& > li {
|
||||
list-style: none;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -999,6 +999,7 @@
|
|||
characters={party.characters}
|
||||
{mainWeaponElement}
|
||||
{partyElement}
|
||||
unlimited={(party as any)?.raid?.group?.unlimited}
|
||||
/>
|
||||
</div>
|
||||
{/if}
|
||||
|
|
|
|||
1
src/lib/types/RaidGroup.d.ts
vendored
1
src/lib/types/RaidGroup.d.ts
vendored
|
|
@ -12,4 +12,5 @@ export interface RaidGroup {
|
|||
extra: boolean
|
||||
guidebooks: boolean
|
||||
hl: boolean
|
||||
unlimited: boolean
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,6 +29,7 @@ export interface RaidGroupFlat {
|
|||
hl: boolean
|
||||
extra: boolean
|
||||
guidebooks: boolean
|
||||
unlimited: boolean
|
||||
}
|
||||
|
||||
// Full RaidGroup (from :full view, includes raids)
|
||||
|
|
@ -65,6 +66,7 @@ export interface CreateRaidGroupInput {
|
|||
hl: boolean
|
||||
extra: boolean
|
||||
guidebooks: boolean
|
||||
unlimited: boolean
|
||||
}
|
||||
|
||||
export interface UpdateRaidGroupInput {
|
||||
|
|
@ -76,6 +78,7 @@ export interface UpdateRaidGroupInput {
|
|||
hl?: boolean
|
||||
extra?: boolean
|
||||
guidebooks?: boolean
|
||||
unlimited?: boolean
|
||||
}
|
||||
|
||||
// Filter types for raid queries
|
||||
|
|
@ -86,4 +89,5 @@ export interface RaidFilters {
|
|||
hl?: boolean
|
||||
extra?: boolean
|
||||
guidebooks?: boolean
|
||||
unlimited?: boolean
|
||||
}
|
||||
|
|
|
|||
|
|
@ -96,6 +96,9 @@
|
|||
<DetailItem label="Guidebooks">
|
||||
<span class="badge" class:active={group.guidebooks}>{group.guidebooks ? 'Yes' : 'No'}</span>
|
||||
</DetailItem>
|
||||
<DetailItem label="Unlimited">
|
||||
<span class="badge" class:active={group.unlimited}>{group.unlimited ? 'Yes' : 'No'}</span>
|
||||
</DetailItem>
|
||||
</DetailsContainer>
|
||||
|
||||
{#if group.raids && group.raids.length > 0}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,8 @@
|
|||
difficulty: 1,
|
||||
hl: false,
|
||||
extra: false,
|
||||
guidebooks: false
|
||||
guidebooks: false,
|
||||
unlimited: false
|
||||
})
|
||||
|
||||
// Sync edit data when group changes
|
||||
|
|
@ -58,7 +59,8 @@
|
|||
difficulty: group.difficulty ?? 1,
|
||||
hl: group.hl ?? false,
|
||||
extra: group.extra ?? false,
|
||||
guidebooks: group.guidebooks ?? false
|
||||
guidebooks: group.guidebooks ?? false,
|
||||
unlimited: group.unlimited ?? false
|
||||
}
|
||||
}
|
||||
})
|
||||
|
|
@ -84,7 +86,8 @@
|
|||
difficulty: editData.difficulty,
|
||||
hl: editData.hl,
|
||||
extra: editData.extra,
|
||||
guidebooks: editData.guidebooks
|
||||
guidebooks: editData.guidebooks,
|
||||
unlimited: editData.unlimited
|
||||
})
|
||||
|
||||
// Invalidate queries
|
||||
|
|
@ -181,6 +184,12 @@
|
|||
editable={true}
|
||||
type="checkbox"
|
||||
/>
|
||||
<DetailItem
|
||||
label="Unlimited"
|
||||
bind:value={editData.unlimited}
|
||||
editable={true}
|
||||
type="checkbox"
|
||||
/>
|
||||
</DetailsContainer>
|
||||
</section>
|
||||
{:else}
|
||||
|
|
|
|||
|
|
@ -31,7 +31,8 @@
|
|||
difficulty: 1,
|
||||
hl: false,
|
||||
extra: false,
|
||||
guidebooks: false
|
||||
guidebooks: false,
|
||||
unlimited: false
|
||||
})
|
||||
|
||||
// Validation
|
||||
|
|
@ -55,7 +56,8 @@
|
|||
difficulty: editData.difficulty,
|
||||
hl: editData.hl,
|
||||
extra: editData.extra,
|
||||
guidebooks: editData.guidebooks
|
||||
guidebooks: editData.guidebooks,
|
||||
unlimited: editData.unlimited
|
||||
})
|
||||
|
||||
// Invalidate queries
|
||||
|
|
@ -147,6 +149,12 @@
|
|||
editable={true}
|
||||
type="checkbox"
|
||||
/>
|
||||
<DetailItem
|
||||
label="Unlimited"
|
||||
bind:value={editData.unlimited}
|
||||
editable={true}
|
||||
type="checkbox"
|
||||
/>
|
||||
</DetailsContainer>
|
||||
</section>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue