Skip to content

Commit

Permalink
add call of cthulhu
Browse files Browse the repository at this point in the history
  • Loading branch information
ardittristan committed Mar 7, 2021
1 parent 5be2eb5 commit b829e79
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 6 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
8 changes: 5 additions & 3 deletions module.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,22 @@
"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"
],
"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"
Expand Down
23 changes: 23 additions & 0 deletions modules/CoC7.js
Original file line number Diff line number Diff line change
@@ -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;
});
}
});
2 changes: 1 addition & 1 deletion modules/callofcthulhu.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
2 changes: 1 addition & 1 deletion modules/dnd5e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down
2 changes: 1 addition & 1 deletion modules/pf2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
});
Expand Down

0 comments on commit b829e79

Please sign in to comment.