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 Dec 8, 2020
2 parents 7cf3eaa + 94a1aef commit 2166e5f
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 5 deletions.
7 changes: 7 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## [0.10.3] 2020-12-07
### Bugfix
- PF2E - Passive actions should correctly show when setting is disabled

### Changed
- PF1E - swapped icons for immediate and swift actions

## [0.10.2] 2020-12-07
### Changed
- PF2E - Check for null actions just in cases
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[![Support me on Patreon](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dcaret_and_stick%26type%3Dpledges%26suffix%3D%252Fmo%2520wasted&style=flat)](https://patreon.com/caret_and_stick)
[![Support this project on Patreon](https://img.shields.io/badge/Patreon-donate-red.svg)](https://patreon.com/caret_and_stick) Patreon donations welcome.

# Token Action HUD
This module populates a repositionable HUD showing the most common basic actions for a selected token. Currently the HUD supports DND5e, WFRP4e, Dungeon World, Pathfinder 2E, Pathfinder 1E, Star Wars 5e, Shadow of the Demonlord (thanks to Xacus#7239) and SFRPG (thanks to Rainer#5041).
Expand Down
4 changes: 2 additions & 2 deletions scripts/actions/pf1/pf1-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,8 +768,8 @@ export class ActionHandlerPf1 extends ActionHandler {
_getActionIcon(action) {
const img = {
//standard: `<i class="fas fa-fist-raised"></i>`,
immediate: `<i class="fas fa-plus"></i>`,
swift: `<i class="fas fa-bolt"></i>`,
immediate: `<i class="fas fa-bolt"></i>`,
swift: `<i class="fas fa-plus"></i>`,
full: `<i class="far fa-circle"></i>`,
round: `<i class="fas fa-hourglass-start"></i>`,
minute: `<i class="fas fa-hourglass-half"></i>`,
Expand Down
9 changes: 7 additions & 2 deletions scripts/actions/pf2e/pf2e-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,19 +147,24 @@ export class ActionHandlerPf2e extends ActionHandler {

let reactions = this.initializeEmptySubcategory();
reactions.actions = this._produceActionMap(tokenId, (filteredActions ?? []).filter(a => a.data.data.actionType.value === 'reaction' && this._actionIsShort(a)), macroType);

let free = this.initializeEmptySubcategory();
free.actions = this._produceActionMap(tokenId, (filteredActions ?? []).filter(a => a.data.data.actionType.value === 'free' && this._actionIsShort(a)), macroType);

let passive = this.initializeEmptySubcategory();
passive.actions = this._produceActionMap(tokenId, (filteredActions ?? []).filter(a => a.data.data.actionType.value === 'passive' && this._actionIsShort(a)), macroType);

let exploration = this.initializeEmptySubcategory();
exploration.actions = this._produceActionMap(tokenId, (filteredActions ?? []).filter(a => a.data.data.traits?.value.includes('exploration')), macroType);

let downtime = this.initializeEmptySubcategory();
downtime.actions = this._produceActionMap(tokenId, (filteredActions ?? []).filter(a => a.data.data.traits?.value.includes('downtime')), macroType);


this._combineSubcategoryWithCategory(result, this.i18n('tokenactionhud.actions'), actions);
this._combineSubcategoryWithCategory(result, this.i18n('tokenactionhud.reactions'), reactions);
this._combineSubcategoryWithCategory(result, this.i18n('tokenactionhud.free'), free);
this._combineSubcategoryWithCategory(result, this.i18n('tokenactionhud.passive'), passive);
this._combineSubcategoryWithCategory(result, this.i18n('tokenactionhud.exploration'), exploration);
this._combineSubcategoryWithCategory(result, this.i18n('tokenactionhud.downtime'), downtime);

Expand Down Expand Up @@ -422,7 +427,7 @@ export class ActionHandlerPf2e extends ActionHandler {
let result = this.initializeEmptyCategory('feats');

let filter = [macroType];
let items = (actor.items ?? []).filter(a => filter.includes(a.type)).sort(this._foundrySort);;
let items = (actor.items ?? []).filter(a => filter.includes(a.type)).sort(this._foundrySort);

let active = this.initializeEmptySubcategory();
active.actions = this._produceActionMap(tokenId, (items ?? []).filter(a => a.data.data.actionType.value !== 'passive'), macroType);
Expand Down

0 comments on commit 2166e5f

Please sign in to comment.