Fixed so that beastform items always have a beastformEffect on them that can't be removed

This commit is contained in:
WBHarry 2026-02-04 20:33:26 +01:00
parent 735ed4c214
commit f42c1267a6
3 changed files with 23 additions and 3 deletions

View file

@ -433,7 +433,7 @@ export default function DHApplicationMixin(Base) {
icon: 'fa-solid fa-lightbulb',
condition: target => {
const doc = getDocFromElementSync(target);
return doc && !doc.disabled;
return doc && !doc.disabled && doc.type !== 'beastform';
},
callback: async target => (await getDocFromElement(target)).update({ disabled: true })
},
@ -442,7 +442,7 @@ export default function DHApplicationMixin(Base) {
icon: 'fa-regular fa-lightbulb',
condition: target => {
const doc = getDocFromElementSync(target);
return doc && doc.disabled;
return doc && doc.disabled && doc.type !== 'beastform';
},
callback: async target => (await getDocFromElement(target)).update({ disabled: false })
}
@ -536,6 +536,10 @@ export default function DHApplicationMixin(Base) {
options.push({
name: 'CONTROLS.CommonDelete',
icon: 'fa-solid fa-trash',
condition: target => {
const doc = getDocFromElementSync(target);
return doc && doc.type !== 'beastform';
},
callback: async (target, event) => {
const doc = await getDocFromElement(target);
if (event.shiftKey) return doc.delete();