diff --git a/package.json b/package.json index 5328cc2..f8fb0c0 100644 --- a/package.json +++ b/package.json @@ -1,4 +1,5 @@ { + "license": "CC-BY-4.0", "scripts": { "build": "rollup -c", "dev": "rollup -wcm" @@ -13,4 +14,4 @@ "rollup": "^2.56.3", "rollup-plugin-terser": "^7.0.2" } -} \ No newline at end of file +} diff --git a/scripts/action-handler.js b/scripts/action-handler.js index f2e6183..686aaf0 100644 --- a/scripts/action-handler.js +++ b/scripts/action-handler.js @@ -1455,11 +1455,20 @@ Hooks.once('tokenActionHudCoreApiReady', async (coreModule) => { const strikeId = `${strike.item.id}-${strike.slug}` const strikeGroupId = `strikes+${strikeId}` let strikeGroupName = strike.label - if (this.showStrikeNames && this.showStrikeTraits && strike.weaponTraits.length) { - strikeGroupName += ' - ' - strike.weaponTraits.forEach((t) => { - strikeGroupName += '[' + t.label + ']' - }) + if (this.showStrikeTraits && this.showStrikeNames) { + let strikeTraits = null + if (this.actor.type === 'character') { + strikeTraits = strike.weaponTraits + } + else { + strikeTraits = strike.traits + } + if (strikeTraits.length > 0) { + strikeGroupName += ' - ' + for (let trait of strikeTraits) { + strikeGroupName += '[' + trait.label + ']' + } + } } const strikeGroupListName = `${coreModule.api.Utils.i18n(ACTION_TYPE[actionType])}: ${strike.label} (${strike.item.id})` const image = strike.imageUrl ?? strike.item?.img