diff --git a/module/actor/actor-sheet.js b/module/actor/actor-sheet.js index 8ad614b..e8ab8de 100644 --- a/module/actor/actor-sheet.js +++ b/module/actor/actor-sheet.js @@ -27,6 +27,7 @@ export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) { toggleBondDamage: DeltaGreenActorSheet._toggleBondDamage, clearBondDamage: DeltaGreenActorSheet._clearBondDamage, toggleItemSortMode: DeltaGreenActorSheet._toggleItemSortMode, + toggleShowUntrained: DeltaGreenActorSheet._toggleShowUntrained, }, }); @@ -762,6 +763,12 @@ export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) { }); } + static toggleShowUntrained() { + const targetProp = "system.showUntrainedSkills"; + const currentVal = foundry.utils.getProperty(this.actor, targetProp); + this.actor.update({ [targetProp]: !currentVal }); + } + /** @override */ activateListeners(html) { super.activateListeners(html); @@ -772,12 +779,6 @@ export default class DeltaGreenActorSheet extends DGSheetMixin(ActorSheetV2) { // Rollable abilities - bind to everything with the 'Rollable' class html.find(".rollable").contextmenu(this._onRoll.bind(this)); // this is for right-click, which triggers the roll modifier dialogue for most rolls - html.find(".toggle-untrained").click(() => - this.actor.update({ - "system.showUntrainedSkills": !this.actor.system.showUntrainedSkills, - }), - ); - // Macro for toggling an item's equipped state html .find(".equipped-item") diff --git a/templates/actor/npc-sheet.html b/templates/actor/npc-sheet.html index 60584ad..70cac45 100644 --- a/templates/actor/npc-sheet.html +++ b/templates/actor/npc-sheet.html @@ -1,67 +1,113 @@ -