174 character context menu (#189)

* Set up the contextMenues properly
* Fixed double item generation on drop
This commit is contained in:
WBHarry 2025-06-28 10:05:53 +02:00 committed by GitHub
parent 30ab18d683
commit b4fff7b9e6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
11 changed files with 197 additions and 62 deletions

View file

@ -141,4 +141,32 @@ export default class DhpItem extends Item {
// Display Item Card in chat
return response;
}
async toChat(origin) {
const cls = getDocumentClass('ChatMessage');
const systemData = {
title:
this.type === 'ancestry'
? game.i18n.localize('DAGGERHEART.Chat.FoundationCard.AncestryTitle')
: this.type === 'community'
? game.i18n.localize('DAGGERHEART.Chat.FoundationCard.CommunityTitle')
: game.i18n.localize('DAGGERHEART.Chat.FoundationCard.SubclassFeatureTitle'),
origin: origin,
img: this.img,
name: this.name,
description: this.system.description,
actions: []
};
const msg = new cls({
type: 'abilityUse',
user: game.user.id,
system: systemData,
content: await foundry.applications.handlebars.renderTemplate(
'systems/daggerheart/templates/chat/ability-use.hbs',
systemData
)
});
cls.create(msg.toObject());
}
}