add toggleShowUntrained action;

note, this only affects npc/unnatural sheets, which I have not converted yet, so I wasn't able to actually test this change at the time of this commit
This commit is contained in:
jalensailin
2025-07-18 22:48:02 -04:00
parent 6944381e8f
commit 1f9d19ea3d
3 changed files with 243 additions and 133 deletions
+7 -6
View File
@@ -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")