Add options to import documents into specific folders or compendium packs and sort them by tier.
This commit is contained in:
parent
3e9bc42ca4
commit
f5153485af
4 changed files with 133 additions and 10 deletions
|
|
@ -47,7 +47,9 @@ export class DHImporterApp extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
adversary: "Adversary",
|
||||
environment: "Environment"
|
||||
},
|
||||
inputText: this.inputText
|
||||
inputText: this.inputText,
|
||||
folders: game.folders.filter(f => f.type === "Actor").sort((a, b) => a.name.localeCompare(b.name)),
|
||||
packs: game.packs.filter(p => p.documentName === "Actor" && !p.locked)
|
||||
};
|
||||
}
|
||||
|
||||
|
|
@ -152,7 +154,10 @@ export class DHImporterApp extends HandlebarsApplicationMixin(ApplicationV2) {
|
|||
}
|
||||
}
|
||||
|
||||
await DHImporter.createDocuments(this.parsedData, this.parsedDataType);
|
||||
const importTarget = formData.importTarget || "";
|
||||
const sortTier = formData.sortTier || false;
|
||||
|
||||
await DHImporter.createDocuments(this.parsedData, this.parsedDataType, { target: importTarget, sortTier });
|
||||
ui.notifications.info(`Successfully imported ${this.parsedData.length} documents.`);
|
||||
this.close();
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue