Skip to content

Commit bbb7142

Browse files
committed
Fix tooltip rendering issues based on user settings
1 parent c51141a commit bbb7142

File tree

3 files changed

+17
-8
lines changed

3 files changed

+17
-8
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## v0.1.1
4+
- Fixed Rich tooltips not showing despite setting
5+
36
## v0.1.0
47
- Initial Release
58

dist/token-action-hud-bf.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
454454
#displayActivityIcon = defaults.displayActivityIcon;
455455
#showOnlyPrepared = defaults.showOnlyPrepared;
456456
#showPreparedness = defaults.showPreparedness;
457+
#tooltipsSetting;
457458

458459
#findGroup(data = {}) {
459460
if (data?.nestId) {
@@ -481,6 +482,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
481482
this.#displayActivityIcon = getSetting(settings.displayActivityIcon);
482483
this.#showOnlyPrepared = getSetting(settings.showOnlyPrepared);
483484
this.#showPreparedness = getSetting(settings.showPreparedness);
485+
this.#tooltipsSetting = game.settings.get("token-action-hud-core", "tooltips");
484486

485487
if (this.actor) {
486488
const physicalItems = this.actor.items.filter(i => i.system.isPhysical);
@@ -1229,9 +1231,10 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
12291231
}
12301232

12311233
#getTooltip(item) {
1232-
if (this.tooltipsSetting === "none") return "";
1234+
debugger;
1235+
if (this.#tooltipsSetting === "none") return "";
12331236

1234-
if (this.tooltipsSetting === "full" && foundry.utils.getType(item.system.richTooltip) === "function") {
1237+
if (this.#tooltipsSetting === "full" && foundry.utils.getType(item.system.richTooltip) === "function") {
12351238
const tooltip = {};
12361239
tooltip.content = `<section class="loading" data-uuid="${item.uuid}"><i class="fas fa-spinner fa-spin-pulse"></i></section>`;
12371240
tooltip.class = "black-flag black-flag-tooltip item-tooltip";
@@ -1304,11 +1307,11 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
13041307
}
13051308

13061309
#getConditionTooltipData(id, name) {
1307-
if (this.tooltipsSetting === "none") return "";
1310+
if (this.#tooltipsSetting === "none") return "";
13081311

13091312
const condition = CONFIG.BlackFlag.conditions[id];
13101313

1311-
if (this.tooltipsSetting === "nameOnly" || !condition?.reference) return name;
1314+
if (this.#tooltipsSetting === "nameOnly" || !condition?.reference) return name;
13121315

13131316
const tooltip = {};
13141317
tooltip.content = `<section class="loading" data-uuid="${condition.reference}"><i class="fas fa-spinner fa-spin-pulse"></i></section>`;

src/modules/ActionHandler.mjs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
1515
#displayActivityIcon = defaults.displayActivityIcon;
1616
#showOnlyPrepared = defaults.showOnlyPrepared;
1717
#showPreparedness = defaults.showPreparedness;
18+
#tooltipsSetting;
1819

1920
#findGroup(data = {}) {
2021
if (data?.nestId) {
@@ -42,6 +43,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
4243
this.#displayActivityIcon = getSetting(settings.displayActivityIcon);
4344
this.#showOnlyPrepared = getSetting(settings.showOnlyPrepared);
4445
this.#showPreparedness = getSetting(settings.showPreparedness);
46+
this.#tooltipsSetting = game.settings.get("token-action-hud-core", "tooltips");
4547

4648
if (this.actor) {
4749
const physicalItems = this.actor.items.filter(i => i.system.isPhysical);
@@ -799,9 +801,10 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
799801
}
800802

801803
#getTooltip(item) {
802-
if (this.tooltipsSetting === "none") return "";
804+
debugger;
805+
if (this.#tooltipsSetting === "none") return "";
803806

804-
if (this.tooltipsSetting === "full" && foundry.utils.getType(item.system.richTooltip) === "function") {
807+
if (this.#tooltipsSetting === "full" && foundry.utils.getType(item.system.richTooltip) === "function") {
805808
const tooltip = {};
806809
tooltip.content = `<section class="loading" data-uuid="${item.uuid}"><i class="fas fa-spinner fa-spin-pulse"></i></section>`;
807810
tooltip.class = "black-flag black-flag-tooltip item-tooltip";
@@ -874,11 +877,11 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => {
874877
}
875878

876879
#getConditionTooltipData(id, name) {
877-
if (this.tooltipsSetting === "none") return "";
880+
if (this.#tooltipsSetting === "none") return "";
878881

879882
const condition = CONFIG.BlackFlag.conditions[id];
880883

881-
if (this.tooltipsSetting === "nameOnly" || !condition?.reference) return name;
884+
if (this.#tooltipsSetting === "nameOnly" || !condition?.reference) return name;
882885

883886
const tooltip = {};
884887
tooltip.content = `<section class="loading" data-uuid="${condition.reference}"><i class="fas fa-spinner fa-spin-pulse"></i></section>`;

0 commit comments

Comments
 (0)