Added createDialog

This commit is contained in:
WBHarry 2026-02-09 23:35:50 +01:00
parent a76479e9b7
commit 94262ba6ec
4 changed files with 9 additions and 1 deletions

View file

@ -712,17 +712,23 @@ export default function DHApplicationMixin(Base) {
const cls =
type === 'action' ? game.system.api.models.actions.actionsTypes.base : getDocumentClass(documentClass);
const data = {
name: cls.defaultName({ type, parent }),
type,
system: systemData
};
if (inVault) data['system.inVault'] = true;
if (disabled) data.disabled = true;
if (type === 'domainCard' && parent?.system.domains?.length) {
data.system.domain = parent.system.domains[0];
}
if (documentClass === 'ActiveEffect') {
return cls.createDialog(data, { parent: this.document });
}
const doc = await cls.create(data, { parent, renderSheet: !event.shiftKey });
if (parentIsItem && type === 'feature') {
await this.document.update({