mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-04-23 07:53:39 +02:00
Improved
This commit is contained in:
parent
28efef7951
commit
9cdfd7a27a
11 changed files with 151 additions and 69 deletions
|
|
@ -50,13 +50,17 @@ export default class AncestrySheet extends DHHeritageSheet {
|
|||
|
||||
const item = await fromUuid(data.uuid);
|
||||
if (item?.type === 'feature') {
|
||||
const subType = event.target.closest('.primary-feature') ? 'primary' : 'secondary';
|
||||
if (item.system.subType && item.system.subType !== CONFIG.DH.ITEM.featureSubTypes[subType]) {
|
||||
const error = subType === 'primary' ? 'featureNotPrimary' : 'featureNotSecondary';
|
||||
ui.notifications.warn(game.i18n.localize(`DAGGERHEART.UI.Notifications.${error}`));
|
||||
return;
|
||||
if (item.system.originId) {
|
||||
const origin = await foundry.utils.fromUuid(item.system.originId);
|
||||
return ui.notifications.warn(
|
||||
game.i18n.format('DAGGERHEART.UI.Notifications.featureAlreadyLinked', {
|
||||
name: item.name,
|
||||
origin: origin.name
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
const subType = event.target.closest('.primary-feature') ? 'primary' : 'secondary';
|
||||
await item.update({
|
||||
system: {
|
||||
subType: subType,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue