mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Fixed so custom domains can be selected in levelup when multiclassing
This commit is contained in:
parent
6c258c6853
commit
e64a6593dc
5 changed files with 19 additions and 20 deletions
|
|
@ -351,6 +351,17 @@ export default class DhCharacter extends BaseDataActor {
|
|||
return [...classDomains, ...multiclassDomains];
|
||||
}
|
||||
|
||||
get domainData() {
|
||||
const allDomainData = CONFIG.DH.DOMAIN.allDomains();
|
||||
return this.domains.map(key => {
|
||||
const domain = allDomainData[key];
|
||||
return {
|
||||
...domain,
|
||||
label: game.i18n.localize(domain.label)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
get domainCards() {
|
||||
const domainCards = this.parent.items.filter(x => x.type === 'domainCard');
|
||||
const loadout = domainCards.filter(x => !x.system.inVault);
|
||||
|
|
|
|||
|
|
@ -60,17 +60,6 @@ export default class DHClass extends BaseDataItem {
|
|||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
get domainData() {
|
||||
const allDomainData = CONFIG.DH.DOMAIN.allDomains();
|
||||
return this.domains.map(key => {
|
||||
const domain = allDomainData[key];
|
||||
return {
|
||||
...domain,
|
||||
label: game.i18n.localize(domain.label)
|
||||
};
|
||||
});
|
||||
}
|
||||
|
||||
get hopeFeatures() {
|
||||
return this.features.filter(x => x.type === CONFIG.DH.ITEM.featureSubTypes.hope).map(x => x.item);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default class DHSubclass extends BaseDataItem {
|
|||
async _preCreate(data, options, user) {
|
||||
if (this.actor?.type === 'character') {
|
||||
const dataUuid =
|
||||
data.uuid ?? data._stats?.compendiumSource ?? `Compendium.daggerheart.subclasses.Item.${data._id}`;
|
||||
(data.uuid ?? data.folder) ? `Compendium.daggerheart.subclasses.Item.${data._id}` : `Item.${data._id}`;
|
||||
if (this.actor.system.class.subclass) {
|
||||
if (this.actor.system.multiclass.subclass) {
|
||||
ui.notifications.warn(game.i18n.localize('DAGGERHEART.UI.Notifications.subclassesAlreadyPresent'));
|
||||
|
|
|
|||
|
|
@ -85,13 +85,12 @@ export const chunkify = (array, chunkSize, mappingFunc) => {
|
|||
|
||||
export const tagifyElement = (element, baseOptions, onChange, tagifyOptions = {}) => {
|
||||
const { maxTags } = tagifyOptions;
|
||||
const options =
|
||||
typeof baseOptions === 'object'
|
||||
? Object.keys(baseOptions).map(optionKey => ({
|
||||
const options = Array.isArray(baseOptions)
|
||||
? baseOptions
|
||||
: Object.keys(baseOptions).map(optionKey => ({
|
||||
...baseOptions[optionKey],
|
||||
id: optionKey
|
||||
}))
|
||||
: baseOptions;
|
||||
}));
|
||||
|
||||
const tagifyElement = new Tagify(element, {
|
||||
tagTextProp: 'name',
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
</div>
|
||||
{{#if document.system.class.value}}
|
||||
<div class="domains-section">
|
||||
{{#each document.system.class.value.system.domainData as |data|}}
|
||||
{{#each document.system.domainData as |data|}}
|
||||
<div class="domain">
|
||||
<img src="{{data.src}}" alt="" data-tooltip="{{data.label}}" />
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue