Refine logic for use action when hovering over item icon

This commit is contained in:
Carlos Fernandez 2026-04-19 20:18:46 -04:00
parent 6533b3edee
commit 0471bbc7d0
5 changed files with 20 additions and 3 deletions

View file

@ -76,6 +76,13 @@ export default class DHItem extends foundry.documents.Item {
return this.system.metadata.isInventoryItem ?? false;
}
/** Returns true if the item can be used */
get usable() {
const actor = this.actor;
const actionsList = this.system.actionsList;
return this.isOwner && actor?.type === 'character' && (actionsList?.size || actionsList?.length);
}
/** @inheritdoc */
static async createDialog(data = {}, createOptions = {}, options = {}) {
const { folders, types, template, context = {}, ...dialogOptions } = options;