Skip to content

Commit

Permalink
Updated for foundry 0.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
HadaIonut committed Feb 20, 2021
1 parent 8dddf6b commit 73d0e59
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
23 changes: 18 additions & 5 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
"name": "EEEG-Importer",
"title": "EEEG-Importer",
"description": "A module that allows you to import your cities generated with Eigengrau's Generator into a collection of journal entries.",
"version": "1.0.1",
"version": "1.1.0",
"minimumCoreVersion": "0.7.6",
"compatibleCoreVersion": "0.7.8",
"compatibleCoreVersion": "0.8.0",
"author": "HadaIonut",
"dependencies": [

Expand Down
7 changes: 6 additions & 1 deletion scripts/lib/ImportWindow.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ const prepareDisplayName = (folder) => {
return prepareDisplayName(game.folders.get(folder.data.parent)) + '/' + folder.data.name;
}

const isFoundry8 = () => {
const foundryVersion = game.data.version;
return foundryVersion >= '0.8.0' && foundryVersion < '0.9.0';
}

export default class ImportWindow extends Application {

static get defaultOptions() {
Expand All @@ -26,7 +31,7 @@ export default class ImportWindow extends Application {
const locationSelector = html.find("#customLocation");
const locationSelectorActors = html.find('#customLocationActor');

const folders = game.folders.entries;
const folders = isFoundry8() ? game.folders : game.folders.entries;

folders.forEach((folder) => {
if (folder.data.type === 'JournalEntry')
Expand Down
1 change: 1 addition & 0 deletions scripts/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ Hooks.on("renderSidebarTab", async (app, html) => {
html.find(".header-actions").after(buttonDiv);
}
})

0 comments on commit 73d0e59

Please sign in to comment.