[PR] [Feature] Beastform Wildcards (#1247)

* Added support for wildcard paths in beastform token paths

* Fixed browse dataSource
This commit is contained in:
WBHarry 2025-11-10 16:30:04 +01:00 committed by GitHub
parent 2d6390248f
commit 7055591a76
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 176 additions and 2 deletions

View file

@ -844,6 +844,23 @@ export default class CharacterSheet extends DHBaseActorSheet {
itemData.system.inVault = true;
}
if (item.type === 'beastform') {
if (this.document.effects.find(x => x.type === 'beastform')) {
return ui.notifications.warn(
game.i18n.localize('DAGGERHEART.UI.Notifications.beastformAlreadyApplied')
);
}
const data = await game.system.api.data.items.DHBeastform.getWildcardImage(this.document, itemData);
if (data) {
if (!data.selectedImage) return;
else {
if (data.usesDynamicToken) itemData.system.tokenRingImg = data.selectedImage;
else itemData.system.tokenImg = data.selectedImage;
}
}
}
if (this.document.uuid === item.parent?.uuid) return this._onSortItem(event, itemData);
const createdItem = await this._onDropItemCreate(itemData);