Avoid default type on name and item create dialogs

This commit is contained in:
Carlos Fernandez 2026-06-01 03:10:07 -04:00
parent c8d0df87c8
commit f0c29b5d75
3 changed files with 36 additions and 0 deletions

View file

@ -65,6 +65,11 @@ export default class DhpActor extends Actor {
};
}
static createDialog(data, createOptions, options, renderOptions) {
options.classes = [options.classes ?? [], 'actor-create'].flat(); // handled in hook
return super.createDialog(data, createOptions, options, renderOptions);
}
/* -------------------------------------------- */
/** @inheritDoc */

View file

@ -82,6 +82,7 @@ export default class DHItem extends foundry.documents.Item {
/** @inheritdoc */
static async createDialog(data = {}, createOptions = {}, options = {}) {
const { folders, types, template, context = {}, ...dialogOptions } = options;
dialogOptions.classes = [options.classes ?? [], 'item-create'].flat(); // handled in hook
if (types?.length === 0) {
throw new Error('The array of sub-types to restrict to must not be empty.');