mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-15 05:01:08 +01:00
FIX: class tagify selector
FEAT: add tagifyCOnfig on weapon sheet FIX: prettier format
This commit is contained in:
parent
474177f7d0
commit
5eab093ac4
8 changed files with 30 additions and 166 deletions
|
|
@ -23,7 +23,7 @@ export default class ClassSheet extends DHBaseItemSheet {
|
|||
},
|
||||
tagifyConfigs: [
|
||||
{
|
||||
selector: 'domain-input',
|
||||
selector: '.domain-input',
|
||||
choices: () => CONFIG.daggerheart.DOMAIN.domains,
|
||||
callback: ClassSheet.#onDomainSelect
|
||||
}
|
||||
|
|
@ -62,14 +62,19 @@ export default class ClassSheet extends DHBaseItemSheet {
|
|||
}
|
||||
};
|
||||
|
||||
/**@inheritdoc */
|
||||
async _prepareContext(_options) {
|
||||
const context = await super._prepareContext(_options);
|
||||
context.domains = this.document.system.domains;
|
||||
return context;
|
||||
}
|
||||
|
||||
static async #onDomainSelect(domains) {
|
||||
await this.document.update({ 'system.domains': domains.map(x => x.value) });
|
||||
/**
|
||||
* Callback function used by `tagifyElement`.
|
||||
* @param {Array<Object>} selectedOptions - The currently selected tag objects.
|
||||
*/
|
||||
static async #onDomainSelect(selectedOptions) {
|
||||
await this.document.update({ 'system.domains': selectedOptions.map(x => x.value) });
|
||||
}
|
||||
|
||||
static async removeSubclass(_, button) {
|
||||
|
|
@ -125,9 +130,9 @@ export default class ClassSheet extends DHBaseItemSheet {
|
|||
|
||||
async selectActionType() {
|
||||
const content = await foundry.applications.handlebars.renderTemplate(
|
||||
'systems/daggerheart/templates/views/actionType.hbs',
|
||||
{ types: SYSTEM.ACTIONS.actionTypes }
|
||||
),
|
||||
'systems/daggerheart/templates/views/actionType.hbs',
|
||||
{ types: SYSTEM.ACTIONS.actionTypes }
|
||||
),
|
||||
title = 'Select Action Type',
|
||||
type = 'form',
|
||||
data = {};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue