diff --git a/lang/en.json b/lang/en.json index 32717fcb..cedf8102 100755 --- a/lang/en.json +++ b/lang/en.json @@ -1033,6 +1033,12 @@ "description": "" } }, + "FeatureForm":{ + "label": "Feature Form", + "passive": "Passive", + "action":"Action", + "reaction":"Reaction" + }, "Gold": { "title": "Gold", "coins": "Coins", diff --git a/module/applications/sheets/items/feature.mjs b/module/applications/sheets/items/feature.mjs index 1575067b..6ff98ca7 100644 --- a/module/applications/sheets/items/feature.mjs +++ b/module/applications/sheets/items/feature.mjs @@ -31,4 +31,11 @@ export default class FeatureSheet extends DHBaseItemSheet { labelPrefix: 'DAGGERHEART.GENERAL.Tabs' } }; +//Might be wrong location but testing out if here is okay. + /**@override */ + async _prepareContext(options) { + const context = await super._prepareContext(options); + context.featureFormChoices = CONFIG.DH.ITEM.featureForm; + return context; + } } diff --git a/module/config/itemConfig.mjs b/module/config/itemConfig.mjs index a9ad1d68..0b64a4be 100644 --- a/module/config/itemConfig.mjs +++ b/module/config/itemConfig.mjs @@ -1458,6 +1458,12 @@ export const orderedWeaponFeatures = () => { return Object.values(all).sort((a, b) => game.i18n.localize(a.label).localeCompare(game.i18n.localize(b.label))); }; +export const featureForm = { + passive: "DAGGERHEART.CONFIG.FeatureForm.passive", + action: "DAGGERHEART.CONFIG.FeatureForm.action", + reaction: "DAGGERHEART.CONFIG.FeatureForm.reaction" +}; + export const featureTypes = { ancestry: { id: 'ancestry', diff --git a/module/data/item/feature.mjs b/module/data/item/feature.mjs index 3b8fe064..be6da223 100644 --- a/module/data/item/feature.mjs +++ b/module/data/item/feature.mjs @@ -30,7 +30,13 @@ export default class DHFeature extends BaseDataItem { initial: null }), multiclassOrigin: new fields.BooleanField({ initial: false }), - identifier: new fields.StringField() + identifier: new fields.StringField(), + featureForm: new fields.StringField({ + required: true, + initial: "passive", + choices: CONFIG.DH.ITEM.featureForm, + label: "DAGGERHEART.CONFIG.featureForm.label", + }) }; } } diff --git a/templates/sheets/global/partials/inventory-item-V2.hbs b/templates/sheets/global/partials/inventory-item-V2.hbs index cd9626e3..6565d9f1 100644 --- a/templates/sheets/global/partials/inventory-item-V2.hbs +++ b/templates/sheets/global/partials/inventory-item-V2.hbs @@ -49,6 +49,19 @@ Parameters: {{tag}} {{/each}} + + {{!-- Feature Form Tag Start --}} + {{#if (eq ../type 'feature')}} + {{#if (or (eq @root.document.type 'adversary') (eq @root.document.type 'environment'))}} + {{#if system.featureForm}} +
+ {{localize (concat "DAGGERHEART.CONFIG.FeatureForm." system.featureForm)}} +
+ {{/if}} + {{/if}} + {{/if}} + {{!-- Feature Form Tag End --}} + {{/if}} {{/with}} diff --git a/templates/sheets/global/partials/inventory-item.hbs b/templates/sheets/global/partials/inventory-item.hbs index b239e226..d69b0abb 100644 --- a/templates/sheets/global/partials/inventory-item.hbs +++ b/templates/sheets/global/partials/inventory-item.hbs @@ -67,6 +67,21 @@ {{/if}} {{/if}} + + + {{#if (eq type 'feature')}} + {{#if (or (eq @root.document.type 'adversary') (eq @root.document.type 'environment'))}} + {{#if item.system.featureForm}} +
+
+ {{localize "DAGGERHEART.CONFIG.FeatureForm.label"}}: + {{localize (concat "DAGGERHEART.CONFIG.FeatureForm." item.system.featureForm)}} +
+
+ {{/if}} + {{/if}} + {{/if}} + {{#if (eq type 'domainCard')}} {{#if isSidebar}}
diff --git a/templates/sheets/items/feature/settings.hbs b/templates/sheets/items/feature/settings.hbs index c2ecb3fe..5e2a20f7 100644 --- a/templates/sheets/items/feature/settings.hbs +++ b/templates/sheets/items/feature/settings.hbs @@ -4,4 +4,8 @@ data-group='{{tabs.settings.group}}' > {{> "systems/daggerheart/templates/sheets/global/partials/resource-section/resource-section.hbs" }} +
+ {{localize "DAGGERHEART.CONFIG.FeatureForm.label"}} + {{formInput document.system.schema.fields.featureForm value=system.featureForm choices=featureFormChoices localize=true}} +
\ No newline at end of file