Skip to content
This repository has been archived by the owner on Jul 10, 2021. It is now read-only.

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
espositos committed Nov 14, 2020
2 parents 3906a60 + 570e52e commit 5335671
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.9.6] 2020-11-14
### Bugfix
- PF1 - Non-GM players now see the unidentified item name in their HUD until item is identified.

## [0.9.5] 2020-11-14
### Bugfix
- Magic Items now correctly hide themselves if they do not meet attuned or equipped requirement.
Expand Down
17 changes: 16 additions & 1 deletion scripts/actions/pf1/pf1-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,8 @@ export class ActionHandlerPf1 extends ActionHandler {
let encodedValue = [macroType, tokenId, item._id].join(this.delimiter);
let img = this._getImage(item);
let icon = this._getActionIcon(item.data?.activation?.type);
let result = { name: item.name, id: item._id, encodedValue: encodedValue, img: img, icon: icon }
let name = this._getItemName(item);
let result = { name: name, id: item._id, encodedValue: encodedValue, img: img, icon: icon }

if (item.data.recharge && !item.data.recharge.charged && item.data.recharge.value) {
result.name += ` (${this.i18n('tokenactionhud.recharge')})`;
Expand All @@ -612,6 +613,20 @@ export class ActionHandlerPf1 extends ActionHandler {
return result;
}

_getItemName(item) {
let name;

if (item.data.identified || game.user.isGM)
name = item.data.identifiedName
else
name = item.data.unidentified?.name;

if (!name)
name = item.name;

return name;
}

_getImage(item) {
let result = '';
if (settings.get('showIcons'))
Expand Down

0 comments on commit 5335671

Please sign in to comment.