mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Temp
This commit is contained in:
parent
ad9e0aa558
commit
29ce21d606
11 changed files with 198 additions and 65 deletions
|
|
@ -37,6 +37,12 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat
|
|||
}
|
||||
};
|
||||
|
||||
// _attachPartListeners(partId, htmlElement, options) {
|
||||
// super._attachPartListeners(partId, htmlElement, options);
|
||||
|
||||
// htmlElement.querySelector('');
|
||||
// }
|
||||
|
||||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
|
||||
|
|
@ -60,8 +66,15 @@ export default class BeastformDialog extends HandlebarsApplicationMixin(Applicat
|
|||
this.render();
|
||||
}
|
||||
|
||||
static selectBeastform(_, target) {
|
||||
static async selectBeastform(_, target) {
|
||||
this.selected = this.selected === target.dataset.uuid ? null : target.dataset.uuid;
|
||||
const beastform = this.selected ? await foundry.utils.fromUuid(this.selected) : null;
|
||||
if (beastform && beastform.system.beastformType !== CONFIG.DH.ITEM.beastformTypes.normal.id) {
|
||||
this.element.classList.add('expanded');
|
||||
} else {
|
||||
this.element.classList.remove('expanded');
|
||||
}
|
||||
|
||||
this.render();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,6 +15,7 @@ export default class BeastformSheet extends DHBaseItemSheet {
|
|||
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-features.hbs',
|
||||
scrollable: ['.features']
|
||||
},
|
||||
advanced: { template: 'systems/daggerheart/templates/sheets/items/beastform/advanced.hbs' },
|
||||
effects: {
|
||||
template: 'systems/daggerheart/templates/sheets/global/tabs/tab-effects.hbs',
|
||||
scrollable: ['.effects']
|
||||
|
|
@ -23,7 +24,7 @@ export default class BeastformSheet extends DHBaseItemSheet {
|
|||
|
||||
static TABS = {
|
||||
primary: {
|
||||
tabs: [{ id: 'settings' }, { id: 'features' }, { id: 'effects' }],
|
||||
tabs: [{ id: 'settings' }, { id: 'features' }, { id: 'advanced' }, { id: 'effects' }],
|
||||
initial: 'settings',
|
||||
labelPrefix: 'DAGGERHEART.GENERAL.Tabs'
|
||||
}
|
||||
|
|
@ -33,7 +34,14 @@ export default class BeastformSheet extends DHBaseItemSheet {
|
|||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
|
||||
context.document = context.document.toObject();
|
||||
const data = { ...context.document.toObject() };
|
||||
context.document = {
|
||||
...data,
|
||||
system: {
|
||||
...data.system,
|
||||
features: this.document.system.features
|
||||
}
|
||||
};
|
||||
context.document.effects = this.document.effects.map(effect => {
|
||||
const data = effect.toObject();
|
||||
data.id = effect.id;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue