Character Setup Rework (#315)

* Updated to make use of setup tabs. Ancestry now has primary/secondary features

* Changed so ancestry uses a single Features field

* Revert "Changed so ancestry uses a single Features field"

This reverts commit 0bda6b5dbe.

* Reapply "Changed so ancestry uses a single Features field"

This reverts commit 1febafd441.

* Made it work again the bad way \._./

* Changed so that Feature(Item) has a primary field

* Feature(Item) now has subtype instead of primary as a field

* Fixed experience/evasion

* Moved light styling to appTheme mixing

* Added svg and style rules
This commit is contained in:
WBHarry 2025-07-14 01:58:16 +02:00 committed by GitHub
parent 4be3e6179c
commit a768b1dfdb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
24 changed files with 756 additions and 144 deletions

View file

@ -18,4 +18,20 @@ export default class DHAncestry extends BaseDataItem {
features: new ForeignDocumentUUIDArrayField({ type: 'Item' })
};
}
get primaryFeature() {
return (
this.features.find(x => x?.system?.subType === CONFIG.DH.ITEM.featureSubTypes.primary) ??
(this.features.filter(x => !x).length > 0 ? {} : null)
);
}
get secondaryFeature() {
return (
this.features.find(x => x?.system?.subType === CONFIG.DH.ITEM.featureSubTypes.secondary) ??
(this.features.filter(x => !x || x.system.subType === CONFIG.DH.ITEM.featureSubTypes.primary).length > 1
? {}
: null)
);
}
}

View file

@ -22,6 +22,7 @@ export default class DHFeature extends BaseDataItem {
nullable: true,
initial: null
}),
subType: new fields.StringField({ choices: CONFIG.DH.ITEM.featureSubTypes, nullable: true, initial: null }),
originId: new fields.StringField({ nullable: true, initial: null }),
identifier: new fields.StringField(),
actions: new fields.ArrayField(new ActionField())