mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-14 20:51:07 +01:00
Compendium Browser (#821)
This commit is contained in:
parent
b68d2e9ec2
commit
f9774f130e
6 changed files with 74 additions and 20 deletions
|
|
@ -383,7 +383,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
uuid: suggestions.armor?.uuid,
|
||||
taken: suggestions.armor?.uuid === this.equipment.armor?.uuid
|
||||
},
|
||||
compendium: 'armors'
|
||||
compendium: 'armor'
|
||||
};
|
||||
context.primaryWeapon = {
|
||||
...this.equipment.primaryWeapon,
|
||||
|
|
@ -392,7 +392,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
uuid: suggestions.primaryWeapon?.uuid,
|
||||
taken: suggestions.primaryWeapon?.uuid === this.equipment.primaryWeapon?.uuid
|
||||
},
|
||||
compendium: 'weapons'
|
||||
compendium: 'weapon'
|
||||
};
|
||||
context.secondaryWeapon = {
|
||||
...this.equipment.secondaryWeapon,
|
||||
|
|
@ -402,7 +402,7 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
taken: suggestions.secondaryWeapon?.uuid === this.equipment.secondaryWeapon?.uuid
|
||||
},
|
||||
disabled: this.equipment.primaryWeapon?.system?.burden === burden.twoHanded.value,
|
||||
compendium: 'weapons'
|
||||
compendium: 'weapon'
|
||||
};
|
||||
context.inventory = {
|
||||
take: suggestions.inventory.take,
|
||||
|
|
@ -500,11 +500,12 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
}
|
||||
|
||||
static async viewCompendium(event, target) {
|
||||
const type = target.dataset.compendium ?? target.dataset.type;
|
||||
const type = target.dataset.compendium ?? target.dataset.type,
|
||||
equipment = ['armor', 'weapon'];
|
||||
|
||||
const presets = {
|
||||
compendium: 'daggerheart',
|
||||
folder: type,
|
||||
folder: equipment.includes(type) ? "equipments" : type,
|
||||
render: {
|
||||
noFolder: true
|
||||
}
|
||||
|
|
@ -516,6 +517,12 @@ export default class DhCharacterCreation extends HandlebarsApplicationMixin(Appl
|
|||
'system.domain': { key: 'system.domain', value: this.setup.class?.system.domains ?? null }
|
||||
};
|
||||
|
||||
if (equipment.includes(type))
|
||||
presets.filter = {
|
||||
'system.tier': { key: 'system.tier', value: 1 },
|
||||
'type': { key: 'type', value: type }
|
||||
};
|
||||
|
||||
return (this.itemBrowser = await new ItemBrowser({ presets }).render({ force: true }));
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue