refactor: update ikonis features injection to use array-based storage instead of object assignment
This commit is contained in:
parent
d7fd36d24e
commit
689a9ec2ff
1 changed files with 5 additions and 5 deletions
|
|
@ -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;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue