Working on Skills and some fixes
- Added Skills to character sheet - Added migration to old skills - Added icon on skills - Added actor.isNpc - Money out of system
This commit is contained in:
@@ -745,7 +745,7 @@ export class HelpersL5r5e {
|
||||
* @return {Promise<{RollTableDraw}>} The drawn results
|
||||
*/
|
||||
static async drawManyFromPack(pack, tableName, retrieve = 5, opt = { rollMode: "selfroll" }) {
|
||||
const comp = await game.packs.get(pack);
|
||||
const comp = game.packs.get(pack);
|
||||
if (!comp) {
|
||||
console.log(`L5R5E | Pack not found[${pack}]`);
|
||||
return;
|
||||
@@ -760,6 +760,23 @@ export class HelpersL5r5e {
|
||||
return await table.drawMany(retrieve, opt);
|
||||
}
|
||||
|
||||
/**
|
||||
* Load all compendium data from his id
|
||||
*
|
||||
* @param {String} compendium
|
||||
* @param {Function} filter
|
||||
* @returns {Promise<Item[]>}
|
||||
*/
|
||||
static async loadCompendium(compendium, filter = item => true) {
|
||||
const pack = game.packs.get(compendium);
|
||||
if (!pack) {
|
||||
console.log(`L5R5E | Pack not found[${compendium}]`);
|
||||
return;
|
||||
}
|
||||
const data = (await pack.getDocuments()) ?? [];
|
||||
return data.filter(filter);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the string simplified for comparaison
|
||||
* @param {string} str
|
||||
|
||||
Reference in New Issue
Block a user