Skip to content

Commit

Permalink
Fix condition tooltip links
Browse files Browse the repository at this point in the history
  • Loading branch information
Larkinabout committed Jun 17, 2024
1 parent 6a70845 commit 1741a68
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions scripts/action-handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -1543,9 +1543,11 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {

const journalEntry = (CONDITION[id]) ? (CONDITION[id]?.uuid) ? await fromUuid(CONDITION[id].uuid) : null : null
const description = journalEntry?.text?.content ?? ''
const relativeTo = journalEntry
return {
name,
description
description,
relativeTo
}
}

Expand All @@ -1564,8 +1566,10 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {

const nameHtml = `<h3>${name}</h3>`

const relativeTo = tooltipData.relativeTo ?? this.actor

const description = tooltipData?.descriptionLocalised ??
await TextEditor.enrichHTML(coreModule.api.Utils.i18n(tooltipData?.description ?? ''), { async: true, relativeTo: this.actor, secrets: true })
await TextEditor.enrichHTML(coreModule.api.Utils.i18n(tooltipData?.description ?? ''), { async: true, relativeTo, secrets: true })

const rarityHtml = tooltipData?.rarity
? `<span class="tah-tag ${tooltipData.rarity}">${coreModule.api.Utils.i18n(RARITY[tooltipData.rarity])}</span>`
Expand Down
2 changes: 1 addition & 1 deletion scripts/token-action-hud-dnd5e.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion scripts/token-action-hud-dnd5e.min.js.map

Large diffs are not rendered by default.

0 comments on commit 1741a68

Please sign in to comment.