Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#725] Character Feature Tab - Active / Passive / Custom section - Feature Type Column #963

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/features/sections/CharacterSheetSections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ export class CharacterSheetSections {
dataset: {
type: CONSTANTS.ITEM_TYPE_FEAT,
},
showFeatureTypeColumn: true,
showRequirementsColumn: true,
showUsagesColumn: true,
showUsesColumn: true,
Expand All @@ -81,6 +82,7 @@ export class CharacterSheetSections {
items: feats.filter((feat) => !feat.system.activities?.size),
hasActions: false,
dataset: { type: CONSTANTS.ITEM_TYPE_FEAT },
showFeatureTypeColumn: true,
showRequirementsColumn: true,
showUsesColumn: true,
canCreate: true,
Expand Down Expand Up @@ -147,6 +149,7 @@ export class CharacterSheetSections {
canCreate: true,
showUsesColumn: true,
showUsagesColumn: true,
showFeatureTypeColumn: true,
showRequirementsColumn: true,
key: customSectionName,
custom: {
Expand Down
2 changes: 1 addition & 1 deletion src/foundry/config.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3532,7 +3532,7 @@ export type CONFIG = {
epicBoon: string;
};
};
};
} & Record<string, { label: string }>;
itemProperties: {
ada: {
label: string;
Expand Down
15 changes: 15 additions & 0 deletions src/sheets/classic/character/tabs/CharacterFeaturesTab.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@
{localize('DND5E.Level')}
</ItemTableColumn>
{/if}
{#if section.showFeatureTypeColumn}
<ItemTableColumn baseWidth="7.5rem">
{localize('DND5E.Type')}
</ItemTableColumn>
{/if}
{#if section.showRequirementsColumn}
<ItemTableColumn baseWidth="7.5rem">
{localize('DND5E.Requirements')}
Expand Down Expand Up @@ -288,6 +293,16 @@
{/if}
</ItemTableCell>
{/if}
{#if section.showFeatureTypeColumn}
{@const label =
CONFIG.DND5E.featureTypes[item.system.type.value]
?.label ?? item.system.type.value}
<ItemTableCell baseWidth="7.5rem">
<span class="truncate" title={item.system.type ?? ''}
>{label ?? ''}</span
>
</ItemTableCell>
{/if}
{#if section.showRequirementsColumn}
<ItemTableCell baseWidth="7.5rem">
<span
Expand Down
1 change: 0 additions & 1 deletion src/sheets/classic/item/tabs/ItemFeatDetailsTab.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@

{#if context.itemSubtypes}
{@const category =
// @ts-expect-error
context.config.featureTypes[context.system.type.value]?.label}

<div class="form-group">
Expand Down
1 change: 1 addition & 0 deletions src/types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export type CharacterFeatureSection = {
showUsesColumn?: boolean;
showUsagesColumn?: boolean;
showLevelColumn?: boolean;
showFeatureTypeColumn?: boolean;
showRequirementsColumn?: boolean;
canCreate: boolean;
custom?: CustomSectionOptions;
Expand Down
Loading