mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
58 lines
1.8 KiB
JavaScript
58 lines
1.8 KiB
JavaScript
import DaggerheartSheet from '../daggerheart-sheet.mjs';
|
|
|
|
const { ItemSheetV2 } = foundry.applications.sheets;
|
|
export default class WeaponSheet extends DaggerheartSheet(ItemSheetV2) {
|
|
static DEFAULT_OPTIONS = {
|
|
tag: 'form',
|
|
classes: ['daggerheart', 'sheet', 'dh-style', 'weapon'],
|
|
position: { width: 600 },
|
|
form: {
|
|
handler: this.updateForm,
|
|
submitOnChange: true,
|
|
closeOnSubmit: false
|
|
}
|
|
};
|
|
|
|
static PARTS = {
|
|
header: { template: 'systems/daggerheart/templates/sheets/items/weapon/header.hbs' },
|
|
tabs: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-navigation.hbs' },
|
|
description: { template: 'systems/daggerheart/templates/sheets/global/tabs/tab-description.hbs' },
|
|
settings: {
|
|
template: 'systems/daggerheart/templates/sheets/items/weapon/settings.hbs',
|
|
scrollable: ['.settings']
|
|
}
|
|
};
|
|
|
|
static TABS = {
|
|
description: {
|
|
active: true,
|
|
cssClass: '',
|
|
group: 'primary',
|
|
id: 'description',
|
|
icon: null,
|
|
label: 'DAGGERHEART.Sheets.Feature.Tabs.Description'
|
|
},
|
|
settings: {
|
|
active: false,
|
|
cssClass: '',
|
|
group: 'primary',
|
|
id: 'settings',
|
|
icon: null,
|
|
label: 'DAGGERHEART.Sheets.Feature.Tabs.Settings'
|
|
}
|
|
};
|
|
|
|
async _prepareContext(_options) {
|
|
const context = await super._prepareContext(_options);
|
|
context.document = this.document;
|
|
context.config = CONFIG.daggerheart;
|
|
context.tabs = super._getTabs(this.constructor.TABS);
|
|
|
|
return context;
|
|
}
|
|
|
|
static async updateForm(event, _, formData) {
|
|
await this.document.update(formData.object);
|
|
this.render();
|
|
}
|
|
}
|