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 Feb 18, 2021
2 parents d1af903 + aa01882 commit 473f6fc
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 6 deletions.
4 changes: 4 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## [0.10.35] 2020-02-18
### Changed
- Add new options for the Item Macro to choose between keeping the original item, only the item macro item, or showing both.

## [0.10.34] 2020-02-18
### Added
- SW5e class features thanks to Therasin/Zasshem
Expand Down
10 changes: 7 additions & 3 deletions lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@
"tokenactionhud.settings.dnd5e.showAllNpcItems.hint": "If enabled, all items are shown for NPCs, not just equipped items.",
"tokenactionhud.settings.dnd5e.showEmptyItems.name": "Show empty items (includes items and spells)",
"tokenactionhud.settings.dnd5e.showEmptyItems.hint": "If enabled, items are shown in the HUD even if they have no remaining charges.",
"tokenactionhud.settings.dnd5e.itemMacroReplace.name": "Item-Macro: overwrite original item",
"tokenactionhud.settings.dnd5e.itemMacroReplace.hint": "If enabled, items with an item macro will overwrite their original, otherwise both options will be shown.",
"tokenactionhud.settings.dnd5e.itemMacroReplace.name": "Item-Macro: item macro, original item, or both",
"tokenactionhud.settings.dnd5e.itemMacroReplace.hint": "Select which of the items will be shown in the inventory.",
"tokenactionhud.settings.dnd5e.showConditionsCategory.name": "Show Conditions Category",
"tokenactionhud.settings.dnd5e.showConditionsCategory.hint": "If enabled, the HUD will present a category showing the available token conditions and status effects normally available in the regular Token HUD.",

Expand Down Expand Up @@ -252,5 +252,9 @@
"tokenactionhud.settings.swade.abbreviateAttributes.hint": "If enabled, skills and abilities will use a three-character abbreviation.",

"tokenactionhud.d35e.grapple" : "Grapple",
"tokenactionhud.crewActions" : "Crew Actions"
"tokenactionhud.crewActions" : "Crew Actions",

"tokenactionhud.settings.itemMacroReplace.showBoth": "Show both original item and item macro item",
"tokenactionhud.settings.itemMacroReplace.showItemMacro": "Show the item macro item",
"tokenactionhud.settings.itemMacroReplace.showOriginal": "Show the original item"
}
7 changes: 6 additions & 1 deletion scripts/actions/itemMacroExtender.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ export class ItemMacroActionListExtender extends ActionListExtender {
if (itemIds.length === 0)
return;

let replace = settings.get('itemMacroReplace');
let itemMacroSetting = settings.get('itemMacroReplace');

if (itemMacroSetting === 'showOriginal')
return actionList;

let replace = itemMacroSetting === 'showItemMacro';

actionList.categories.forEach(category => {
category.subcategories.forEach(subcategory => {
Expand Down
10 changes: 8 additions & 2 deletions scripts/settings.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Logger } from './logger.js';
import { ItemMacroOptions } from './settings/dnd5e/itemMacroOptions.js';
export { Logger } from './logger.js';

const updateFunc = (value) => { Logger.debug('Settings updated. Refreshing HUD'); if (game.tokenActionHUD)game.tokenActionHUD.updateSettings(); }
Expand Down Expand Up @@ -96,8 +97,13 @@ export const registerSettings = function(app, systemManager, rollHandlers) {
hint: game.i18n.localize('tokenactionhud.settings.dnd5e.itemMacroReplace.hint'),
scope: "client",
config: true,
type: Boolean,
default: true,
type: String,
choices: {
showBoth: game.i18n.localize(ItemMacroOptions.SHOW_BOTH),
showItemMacro: game.i18n.localize(ItemMacroOptions.SHOW_ITEM_MACRO),
showOriginal: game.i18n.localize(ItemMacroOptions.SHOW_ORIGINAL_ITEM)
},
default: 'showBoth',
onChange: value => { updateFunc(value); }
});
}
Expand Down
5 changes: 5 additions & 0 deletions scripts/settings/dnd5e/itemMacroOptions.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const ItemMacroOptions = {
SHOW_BOTH: 'tokenactionhud.settings.itemMacroReplace.showBoth',
SHOW_ITEM_MACRO: 'tokenactionhud.settings.itemMacroReplace.showItemMacro',
SHOW_ORIGINAL_ITEM: 'tokenactionhud.settings.itemMacroReplace.showOriginal'
}

0 comments on commit 473f6fc

Please sign in to comment.