From 021fb5000bb2b700dc419b70cf4c69960026efac Mon Sep 17 00:00:00 2001 From: Silvertower Date: Fri, 10 May 2024 16:09:01 +0000 Subject: [PATCH] Fix https://github.com/Larkinabout/fvtt-token-action-hud-pf2e/issues/142 --- scripts/action-handler.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/action-handler.js b/scripts/action-handler.js index a0842a3..bd552d6 100644 --- a/scripts/action-handler.js +++ b/scripts/action-handler.js @@ -662,7 +662,7 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => { const actions = [] if (this.actorType !== 'hazard') { - const perception = this.actor ? this.actor.system.perception : coreModule.api.Utils.i18n('PF2E.PerceptionLabel') + const initiative = this.actor ? this.actor.system.initiative : coreModule.api.Utils.i18n('PF2E.PerceptionLabel') const fullName = coreModule.api.Utils.i18n('PF2E.PerceptionLabel') const name = this.abbreviatedSkills ? SKILL_ABBREVIATION.perception ?? fullName : fullName const actionTypeName = `${coreModule.api.Utils.i18n(ACTION_TYPE[actionType])}: ` ?? '' @@ -670,12 +670,12 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => { const encodedValue = [actionType, 'perception'].join(this.delimiter) const active = (initiativeStatistic === 'perception') ? ' active' : '' const cssClass = `toggle${active}` - const modifier = coreModule.api.Utils.getModifier(perception?.totalModifier) + const modifier = coreModule.api.Utils.getModifier(initiative?.totalModifier) const info1 = this.actor ? { text: modifier } : '' const tooltipName = `${fullName}${(this.actor && modifier) ? ` ${modifier}` : ''}` const tooltipData = { name: tooltipName, - modifiers: perception?.modifiers + modifiers: initiative?.modifiers } const tooltip = this.actor ? await this.#getTooltip(actionType, tooltipData) : null