diff --git a/CHANGELOG.md b/CHANGELOG.md index 0e8832a..500f4e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Patch Notes +## Version 1.4.0 + +* Update urls to reflect new site. +* Add compatibility for the other Call of Cthulhu 7th edition system. + ## Version 1.3.0 * Added functionality to create/update a worlds.json file in the actorAPI folder to allow listing available worlds as part of the external viewer. [#10](https://github.com/ardittristan/VTTExternalActorViewer/pull/10) diff --git a/module.json b/module.json index 7d7cd32..cea25fb 100644 --- a/module.json +++ b/module.json @@ -2,7 +2,7 @@ "name": "externalactor", "title": "External Actor Viewer", "description": "Makes you able to see characters from unloaded worlds.", - "version": "1.3.0", + "version": "1.4.0", "author": "ardittristan#0001", "esmodules": [ "actorviewer.js" @@ -10,12 +10,14 @@ "scripts": [ "modules/dnd5e.js", "modules/pf2e.js", - "modules/callofcthulhu.js" + "modules/callofcthulhu.js", + "modules/CoC7.js" ], "systems": [ "dnd5e", "pf2e", - "callofcthulhu" + "callofcthulhu", + "CoC7" ], "styles": [ "css/externalactor.css" diff --git a/modules/CoC7.js b/modules/CoC7.js new file mode 100644 index 0000000..86028c5 --- /dev/null +++ b/modules/CoC7.js @@ -0,0 +1,23 @@ +Hooks.on("init", () => { + if (game.system.id === "CoC7") { + Hooks.on("actorViewerGenerate", () => { + const compatMode = game.settings.get("externalactor", "compatMode"); + let actors = {}; + game.actors.forEach((actor) => { + if (!compatMode) { + if (game.user.isGM) { + actor.setFlag("externalactor", "pulpRules", game.settings.get('CoC7', 'pulpRules')); + } + } + + actors[actor.id] = JSON.parse(JSON.stringify(actor.data)); + }); + + ActorViewer.createActorsFile(actors); + + game.settings.set("externalactor", "systemSite", "https://ardittristan.github.io/VTTExternalActorSites/CoC7/"); + + return false; + }); + } +}); diff --git a/modules/callofcthulhu.js b/modules/callofcthulhu.js index 2afea29..b738225 100644 --- a/modules/callofcthulhu.js +++ b/modules/callofcthulhu.js @@ -15,7 +15,7 @@ Hooks.on("init", () => { ActorViewer.createActorsFile(actors); ActorViewer.createWorldsFile(); - game.settings.set("externalactor", "systemSite", "https://ardittristan.github.io/VTTCoC7thExternalActorSite/"); + game.settings.set("externalactor", "systemSite", "https://ardittristan.github.io/VTTExternalActorSites/callofcthulhu/"); return false; }); diff --git a/modules/dnd5e.js b/modules/dnd5e.js index 70639a5..3afed25 100644 --- a/modules/dnd5e.js +++ b/modules/dnd5e.js @@ -31,7 +31,7 @@ Hooks.on("init", () => { ActorViewer.createActorsFile(actors); ActorViewer.createWorldsFile(); // set application button url - game.settings.set("externalactor", "systemSite", "https://ardittristan.github.io/VTTExternalActorSite/"); + game.settings.set("externalactor", "systemSite", "https://ardittristan.github.io/VTTExternalActorSites/dnd5e/"); return false; }); diff --git a/modules/pf2e.js b/modules/pf2e.js index f0d5286..32314a7 100644 --- a/modules/pf2e.js +++ b/modules/pf2e.js @@ -24,7 +24,7 @@ Hooks.on("init", () => { ActorViewer.createActorsFile(actors); ActorViewer.createWorldsFile(); - game.settings.set("externalactor", "systemSite", "https://ardittristan.github.io/VTTPF2eExternalActorSite/"); + game.settings.set("externalactor", "systemSite", "https://ardittristan.github.io/VTTExternalActorSites/pf2e/"); return false; });