Skip to content

Commit

Permalink
Make Dungeon Draw compatible with v9.
Browse files Browse the repository at this point in the history
  • Loading branch information
mcglincy committed Dec 10, 2021
1 parent 1655b3f commit afe0dfc
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"library": "false",
"manifestPlusVersion": "1.0.0",
"minimumCoreVersion": "0.8.9",
"compatibleCoreVersion": "0.8.9",
"compatibleCoreVersion": "9",
"dependencies": [],
"esmodules": ["./modules/dungeondraw-bundle.min.js"],
"packs": [],
Expand Down
2 changes: 1 addition & 1 deletion modules/dungeondraw-bundle.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion modules/dungeondraw-bundle.min.js.map

Large diffs are not rendered by default.

13 changes: 12 additions & 1 deletion src/dungeondraw.js
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,18 @@ export class DungeonDraw {
}

static getSceneControlButtons(controls) {
CONFIG.Canvas.layers.dungeon = DungeonLayer;
if (CONFIG.Canvas.layers.background?.group) {
// v9+ layer setup
CONFIG.Canvas.layers.dungeon = {
layerClass: DungeonLayer,
group: "primary",
};
} else {
// v8 layer setup
// TODO: remove this if/else once v8 is gone from existence
CONFIG.Canvas.layers.dungeon = DungeonLayer;
}

CONFIG.Dungeon = {
//documentClass: DungeonDocument,
layerClass: DungeonLayer,
Expand Down

0 comments on commit afe0dfc

Please sign in to comment.