[Fix] Improve Class-Subclass Linkage (#1846)
Some checks failed
Project CI / build (24.x) (push) Has been cancelled

* Initial thoughts

* .

* Fixed linting

* Continue work on updating identifier

* Change to uuid approach

* Localization and minor fix

* Fixed CompendiumBrowser Class filter for Subclass view

* Fixed the class name display in the subclass view

* Improved missing class visual for subclass

* Fixed character creation

* Rerender class sheets when subclass link is changed

* Use compendium source over actual uuid in search

---------

Co-authored-by: Carlos Fernandez <cfern1990@gmail.com>
This commit is contained in:
WBHarry 2026-05-05 22:15:21 +02:00 committed by GitHub
parent fb5e3672dc
commit b7bc452bf5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 167 additions and 84 deletions

View file

@ -383,7 +383,8 @@ export const typeConfig = {
{
key: 'system.linkedClass',
label: 'TYPES.Item.class',
format: linkedClass => linkedClass?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing'
format: linkedClass =>
foundry.utils.fromUuidSync(linkedClass)?.name ?? 'DAGGERHEART.UI.ItemBrowser.missing'
},
{
key: 'system.spellcastingTrait',
@ -393,15 +394,18 @@ export const typeConfig = {
],
filters: [
{
key: 'system.linkedClass.uuid',
key: 'system.linkedClass',
label: 'TYPES.Item.class',
choices: items => {
const list = items
.filter(item => item.system.linkedClass)
.map(item => ({
value: item.system.linkedClass.uuid,
label: item.system.linkedClass.name
}));
choices: async items => {
const list = [];
for (const item of items.filter(item => item.system.linkedClass)) {
const linkedClass = await foundry.utils.fromUuid(item.system.linkedClass);
list.push({
value: linkedClass.uuid,
label: linkedClass.name
});
}
return list.reduce((a, c) => {
if (!a.find(i => i.value === c.value)) a.push(c);
return a;