Fix logic to display gear that can be equipped and editing the equipped attribute

This commit is contained in:
Oliver-Akins 2025-01-26 11:32:14 -07:00
parent a129b364a2
commit aa05cdde46
3 changed files with 3 additions and 1 deletions

View file

@ -92,7 +92,7 @@ export class HeroSkillsCardV1 extends GenericAppMixin(HandlebarsApplicationMixin
for (const item of items) { for (const item of items) {
if (!gameTerms.gearItemTypes.has(item.type)) { continue }; if (!gameTerms.gearItemTypes.has(item.type)) { continue };
if ( `equipped` in item.system && !item.system.equipped) { continue }; if (`equipped` in item.system && item.system.equipped) { continue };
ctx.gear.push({ ctx.gear.push({
index: ctx.gear.length, index: ctx.gear.length,
uuid: item.uuid, uuid: item.uuid,

View file

@ -72,6 +72,7 @@ export class ProtectorData extends foundry.abstract.TypeDataModel {
type: `boolean`, type: `boolean`,
label: `RipCrypt.common.equipped`, label: `RipCrypt.common.equipped`,
value: this.equipped, value: this.equipped,
path: `system.equipped`,
}); });
}; };

View file

@ -133,6 +133,7 @@ export class WeaponData extends foundry.abstract.TypeDataModel {
type: `boolean`, type: `boolean`,
label: `RipCrypt.common.equipped`, label: `RipCrypt.common.equipped`,
value: this.equipped, value: this.equipped,
path: `system.equipped`,
}); });
}; };