refactor: update ikonis features injection to use array-based storage instead of object assignment

This commit is contained in:
CPTN Cosmo 2026-04-26 18:37:19 +02:00
parent d7fd36d24e
commit 689a9ec2ff

View file

@ -204,18 +204,18 @@ export function patchDhCharacter(DhCharacter) {
const originalSheetLists = descriptor.get; const originalSheetLists = descriptor.get;
Object.defineProperty(DhCharacter.prototype, 'sheetLists', { Object.defineProperty(DhCharacter.prototype, 'sheetLists', {
get: function() { get: function() {
const lists = originalSheetLists.call(this); const lists = originalSheetLists.call(this); // This is an Array
if (!this.parent) return lists; if (!this.parent || !Array.isArray(lists)) return lists;
const ikonisFeatures = _injectIkonisFeatures(this.parent); const ikonisFeatures = _injectIkonisFeatures(this.parent);
if (ikonisFeatures.length > 0) { if (ikonisFeatures.length > 0) {
if (!lists.features) lists.features = {}; // Add our custom category to the end of the lists array
lists.features["Ikonis Augments"] = { lists.push({
title: "Ikonis Augments", title: "Ikonis Augments",
type: "ikonis", type: "ikonis",
values: ikonisFeatures values: ikonisFeatures
}; });
} }
return lists; return lists;