mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
* BeastformEffect is editable. Added SubjectTexture field. * Using handlebars disabled helper
47 lines
1.5 KiB
JavaScript
47 lines
1.5 KiB
JavaScript
import DHBaseItemSheet from '../api/base-item.mjs';
|
|
|
|
export default class BeastformSheet extends DHBaseItemSheet {
|
|
/**@inheritdoc */
|
|
static DEFAULT_OPTIONS = {
|
|
classes: ['beastform']
|
|
};
|
|
|
|
/**@override */
|
|
static PARTS = {
|
|
header: { template: 'systems/daggerheart/templates/sheets/items/beastform/header.hbs' },
|
|
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
|
settings: { template: 'systems/daggerheart/templates/sheets/items/beastform/settings.hbs' },
|
|
features: {
|
|
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs',
|
|
scrollable: ['.features']
|
|
},
|
|
effects: {
|
|
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs',
|
|
scrollable: ['.effects']
|
|
}
|
|
};
|
|
|
|
static TABS = {
|
|
primary: {
|
|
tabs: [{ id: 'settings' }, { id: 'features' }, { id: 'effects' }],
|
|
initial: 'settings',
|
|
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
|
}
|
|
};
|
|
|
|
/**@inheritdoc */
|
|
async _prepareContext(_options) {
|
|
const context = await super._prepareContext(_options);
|
|
|
|
context.document = context.document.toObject();
|
|
context.document.effects = this.document.effects.map(effect => {
|
|
const data = effect.toObject();
|
|
data.id = effect.id;
|
|
if (effect.type === 'beastform') data.mandatory = true;
|
|
|
|
return data;
|
|
});
|
|
|
|
return context;
|
|
}
|
|
}
|