Skip to content

Commit

Permalink
0.0.27
Browse files Browse the repository at this point in the history
  • Loading branch information
gambit07 committed Feb 2, 2024
1 parent 8434c2b commit f04eda3
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
draft: false
prerelease: false
body: |
Bugfix: cpr integration
Bugfix: Actually fixed cpr integration this time
token: ${{ secrets.GITHUB_TOKEN }}
artifacts: './module.zip, ./module.json'
tag: ${{ steps.get-version.outputs.version }}
Expand Down
2 changes: 1 addition & 1 deletion module.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"name": "Gambit"
}
],
"version": "0.0.26",
"version": "0.0.27",
"compatibility": {
"minimum": "11",
"verified": "11",
Expand Down
7 changes: 5 additions & 2 deletions scripts/integrations/cpr.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// Define a global variable to hold the static data
let medkitItems = null;

async function loadCompendiumData() {

let items = {};

const compendiumNames = [
'gambits-premades.gps-class-features',
'gambits-premades.gps-generic-features',
Expand All @@ -12,7 +14,6 @@ async function loadCompendiumData() {
'gambits-premades.gps-homebrew-spells',
'gambits-premades.gps-monster-features'
];
let items = {};

for (const name of compendiumNames) {
let compendium = game.packs.get(name);
Expand All @@ -24,6 +25,8 @@ async function loadCompendiumData() {
version: item.system.source?.custom || 'Unknown'
};
});
} else {
console.warn(`Compendium ${name} not found.`);
}
}

Expand Down
10 changes: 8 additions & 2 deletions scripts/module.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
Hooks.once('init', () => {
registerSettings();
loadCompendiumData();
game.modules.get('gambits-premades').medkitApi = medkitApi;
});

Hooks.once('ready', () => {
loadCompendiumData().then(() => {
game.modules.get('gambits-premades').medkitApi = medkitApi;
}).catch(error => {
console.error("Error loading compendium data:", error);
});
});

Hooks.on('createCombat', async (combat, options, userId) => {
Expand Down

0 comments on commit f04eda3

Please sign in to comment.