mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-13 04:01:06 +01:00
.
This commit is contained in:
parent
1d068a380d
commit
0d967a2fe4
2 changed files with 9 additions and 12 deletions
|
|
@ -65,17 +65,6 @@ export default class DHDomainCard extends BaseDataItem {
|
|||
return matchingDomainCards < this.parent.system.domainTouched;
|
||||
}
|
||||
|
||||
get cannotUse() {
|
||||
if (this.isDomainTouchedSuppressed) {
|
||||
return ui.notifications.warn(
|
||||
game.i18n.format('DAGGERHEART.UI.Notifications.domainTouchRequirement', {
|
||||
nr: this.domainTouched,
|
||||
domain: game.i18n.localize(CONFIG.DH.DOMAIN.allDomains()[this.domain].label)
|
||||
})
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/* -------------------------------------------- */
|
||||
|
||||
/**@override */
|
||||
|
|
|
|||
|
|
@ -146,7 +146,15 @@ export default class DHItem extends foundry.documents.Item {
|
|||
/* -------------------------------------------- */
|
||||
|
||||
async use(event) {
|
||||
if (this.system.cannotUse) return;
|
||||
/* DomainCard check. Can be expanded or made neater */
|
||||
if (this.system.isDomainTouchedSuppressed) {
|
||||
return ui.notifications.warn(
|
||||
game.i18n.format('DAGGERHEART.UI.Notifications.domainTouchRequirement', {
|
||||
nr: this.domainTouched,
|
||||
domain: game.i18n.localize(CONFIG.DH.DOMAIN.allDomains()[this.domain].label)
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const actions = new Set(this.system.actionsList);
|
||||
if (actions?.size) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue