nest Ikonis augments under features tab and fix data access path for individual features
This commit is contained in:
parent
f9c1eceb6f
commit
1931bdb239
1 changed files with 5 additions and 3 deletions
|
|
@ -201,7 +201,9 @@ export function patchDhCharacter(DhCharacter) {
|
|||
const uniqueFeatures = Array.from(new Set(ikonisFeatures));
|
||||
console.log(`DH-Ikonis | Injecting ${uniqueFeatures.length} features for ${this.parent.name}`);
|
||||
|
||||
lists.ikonis = {
|
||||
// Nest within features so they show up on the Features tab
|
||||
if (!lists.features) lists.features = {};
|
||||
lists.features["Ikonis Augments"] = {
|
||||
title: "Ikonis Augments",
|
||||
type: "ikonis",
|
||||
values: uniqueFeatures
|
||||
|
|
@ -229,7 +231,7 @@ foundry.utils.fromUuid = async function(uuid, options) {
|
|||
const actor = await _fromUuid(`Actor.${parts[1]}`, options);
|
||||
if (actor) {
|
||||
// Access the character data model where sheetLists resides
|
||||
const augments = actor.system.sheetLists?.features?.["Ikonis Augments"];
|
||||
const augments = actor.system.sheetLists?.features?.["Ikonis Augments"]?.values;
|
||||
const feature = augments?.find(f => f.id === parts[3]);
|
||||
if (feature) return feature;
|
||||
}
|
||||
|
|
@ -243,7 +245,7 @@ foundry.utils.fromUuidSync = function(uuid, options) {
|
|||
const actor = _fromUuidSync(`Actor.${parts[1]}`, options);
|
||||
if (actor) {
|
||||
// Access the character data model where sheetLists resides
|
||||
const augments = actor.system.sheetLists?.features?.["Ikonis Augments"];
|
||||
const augments = actor.system.sheetLists?.features?.["Ikonis Augments"]?.values;
|
||||
const feature = augments?.find(f => f.id === parts[3]);
|
||||
if (feature) return feature;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue