Skip to content

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
MrVauxs committed May 22, 2022
1 parent aa0dd3a commit 4351f03
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 61 deletions.
112 changes: 58 additions & 54 deletions module.json
Original file line number Diff line number Diff line change
@@ -1,56 +1,60 @@
{
"name": "pf2e-jb2a-macros",
"title": "PF2e x JB2A Macros Compendium",
"description": "<p>A module dedicated to making PF2e shine.</p>",
"version": "1.0.0",
"minimumCoreVersion": "9",
"compatibleCoreVersion": "9",
"author": "MrVauxs and Co.",
"systems": [
"pf2e"
],
"scripts": [
"./module/auto-import.js"
],
"esmodules": [],
"styles": [],
"url": "https://github.com/MrVauxs/pf2e-jb2a-macros",
"manifest": "https://github.com/MrVauxs/pf2e-jb2a-macros/releases/latest/download/manifest.json",
"download": "https://github.com/MrVauxs/pf2e-jb2a-macros/releases/latest/download/module.zip",
"packs": [
{
"label": "PF2e x JB2A Macros",
"entity": "Macro",
"name": "Macros",
"path": "packs/macros.db",
"system": "pf2e"
},
{
"label": "PF2e x JB2A Actors",
"entity": "Actor",
"name": "Actors",
"path": "packs/actors.db",
"system": "pf2e"
}
],
"dependencies": [
{
"name": "sequencer",
"manifest": "https://github.com/fantasycalendar/FoundryVTT-Sequencer/releases/latest/download/module.json"
},
{
"name": "autoanimations",
"manifest": "https://github.com/otigon/automated-jb2a-animations/releases/latest/download/module.json"
},
{
"name": "warpgate",
"manifest": "https://github.com/trioderegion/warpgate/releases/latest/download/module.json"
},
{
"name": "soundfxlibrary",
"manifest": "https://raw.githubusercontent.com/CDeenen/SoundFxLibrary/master/module.json"
}
],
"languages": [],
"socket": false
"name": "pf2e-jb2a-macros",
"title": "PF2e x JB2A Macros Compendium",
"description": "<p>A module dedicated to making PF2e shine.</p>",
"version": "1.1.0",
"minimumCoreVersion": "9",
"compatibleCoreVersion": "9",
"author": "MrVauxs and Co.",
"systems": [
"pf2e"
],
"scripts": [
"./module/auto-import.js"
],
"esmodules": [],
"styles": [],
"url": "https://github.com/MrVauxs/pf2e-jb2a-macros",
"manifest": "https://github.com/MrVauxs/pf2e-jb2a-macros/releases/latest/download/module.json",
"download": "https://github.com/MrVauxs/pf2e-jb2a-macros/releases/download/1.1.0/module.zip",
"packs": [
{
"label": "PF2e x JB2A Macros",
"entity": "Macro",
"name": "Macros",
"path": "packs/macros.db",
"system": "pf2e"
},
{
"label": "PF2e x JB2A Actors",
"entity": "Actor",
"name": "Actors",
"path": "packs/actors.db",
"system": "pf2e"
}
],
"dependencies": [
{
"name": "sequencer",
"manifest": "https://github.com/fantasycalendar/FoundryVTT-Sequencer/releases/latest/download/module.json"
},
{
"name": "autoanimations",
"manifest": "https://github.com/otigon/automated-jb2a-animations/releases/latest/download/module.json"
},
{
"name": "warpgate",
"manifest": "https://github.com/trioderegion/warpgate/releases/latest/download/module.json"
},
{
"name": "soundfxlibrary",
"manifest": "https://raw.githubusercontent.com/CDeenen/SoundFxLibrary/master/module.json"
},
{
"name": "socketlib",
"manifest": "https://raw.githubusercontent.com/manuelVo/foundryvtt-socketlib/master/module.json"
}
],
"languages": [],
"socket": false
}
16 changes: 10 additions & 6 deletions module/auto-import.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
let version = 111

Hooks.on("init", () => {
game.settings.register("pf2e-jb2a-macros", "imported", {
scope: "world",
config: false,
config: true,
name: "Imported Contents",
hint: "Whether or not you have imported the contents of the module using the pop-up when you enabled the module.\nDisable to have them imported again automatically.",
type: Boolean,
default: false
});
Expand All @@ -21,11 +25,11 @@ async function importAllMacros() {
const module = game.modules.get("pf2e-jb2a-macros");
let scenes = null;
let actors = null;
for ( let p of module.packs ) {
const pack = game.packs.get("pf2e-jb2a-macros."+p.name);
for (let p of module.packs) {
const pack = game.packs.get("pf2e-jb2a-macros." + p.name);
await pack.importAll();
if ( p.entity === "Macro" ) macros = game.folders.getName(p.label);
if ( p.entity === "Actor" ) actors = game.folders.getName(p.label);
if (p.entity === "Macro") macros = game.folders.getName(p.label);
if (p.entity === "Actor") actors = game.folders.getName(p.label);
}
return game.settings.set("pf2e-jb2a-macros", "imported", true);
}
}
Loading

0 comments on commit 4351f03

Please sign in to comment.