nest Ikonis augments under features tab and fix data access path for individual features

This commit is contained in:
CPTN Cosmo 2026-04-26 18:15:58 +02:00
parent f9c1eceb6f
commit 1931bdb239

View file

@ -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;
}