mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 03:31:07 +01:00
Added DhTooltipManager aswell as placeholder rendering for Armor/Weapon/DomainCard (#245)
This commit is contained in:
parent
750282aeec
commit
ee8a48f73d
7 changed files with 34 additions and 1 deletions
|
|
@ -15,5 +15,6 @@ export { default as DhpChatMessage } from './chatMessage.mjs';
|
|||
export { default as DhpEnvironment } from './sheets/actors/environment.mjs';
|
||||
export { default as DhActiveEffectConfig } from './sheets/activeEffectConfig.mjs';
|
||||
export { default as DhContextMenu } from './contextMenu.mjs';
|
||||
export { default as DhTooltipManager } from './tooltipManager.mjs';
|
||||
|
||||
export * as api from './sheets/api/_modules.mjs';
|
||||
|
|
|
|||
16
module/applications/tooltipManager.mjs
Normal file
16
module/applications/tooltipManager.mjs
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
export default class DhTooltipManager extends TooltipManager {
|
||||
async activate(element, options = {}) {
|
||||
let html = options.html;
|
||||
if (element.dataset.tooltip.startsWith('#item#')) {
|
||||
const item = await foundry.utils.fromUuid(element.dataset.tooltip.slice(6));
|
||||
if (item) {
|
||||
html = await foundry.applications.handlebars.renderTemplate(
|
||||
`systems/daggerheart/templates/tooltip/${item.type}.hbs`,
|
||||
item
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
super.activate(element, { ...options, html: html });
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue