mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 15:39:02 +01:00
Feature(Item) now has subtype instead of primary as a field
This commit is contained in:
parent
e9967a27ca
commit
e2ca4506cd
5 changed files with 28 additions and 10 deletions
|
|
@ -32,7 +32,7 @@ export default class AncestrySheet extends DHHeritageSheet {
|
|||
type: 'feature',
|
||||
name: game.i18n.format('DOCUMENT.New', { type: game.i18n.localize('TYPES.Item.feature') }),
|
||||
system: {
|
||||
primary: button.dataset.type === 'primary'
|
||||
subType: button.dataset.type
|
||||
}
|
||||
});
|
||||
await this.document.update({
|
||||
|
|
@ -100,9 +100,8 @@ export default class AncestrySheet extends DHHeritageSheet {
|
|||
|
||||
const item = await fromUuid(data.uuid);
|
||||
if (item?.type === 'feature') {
|
||||
if (event.target.closest('.primary-feature')) {
|
||||
await item.update({ 'system.primary': true });
|
||||
}
|
||||
const subType = event.target.closest('.primary-feature') ? 'primary' : 'secondary';
|
||||
await item.update({ 'system.subType': subType });
|
||||
|
||||
await this.document.update({
|
||||
'system.features': [...this.document.system.features.map(x => x.uuid), item.uuid]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue