Skip to content

Commit

Permalink
Update SystemProvider.js
Browse files Browse the repository at this point in the history
Fix #60
  • Loading branch information
mclemente committed Jan 3, 2023
1 parent 4186fca commit 8080224
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions module/SystemProvider.js
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,16 @@ export class pf2eProvider extends SystemProvider {
return currency.cp / 100 + currency.sp / 10 + currency.gp + currency.pp * 10;
}

getLanguages(data) {
let langs = data.traits.languages.value.map((code) => game.i18n.localize(CONFIG.PF2E.languages[code]));
if (data.traits.languages.custom) {
for (let lang of data.traits.languages.custom.split(/[,;]/g)) {
langs.push(lang.trim());
}
}
return langs;
}

getLore(data) {
const lore = data.items.filter((a) => a.type == "lore").map((a) => a.name);
return lore;
Expand Down Expand Up @@ -883,7 +893,7 @@ export class pf2eProvider extends SystemProvider {
reflex: data.saves?.reflex?.value || 0,
will: data.saves?.will?.value || 0,
},
languages: data.traits?.languages ? data.traits.languages.value.map((code) => game.i18n.localize(CONFIG.PF2E.languages[code])) : [],
languages: data.traits?.languages ? this.getLanguages(data) : [],
currency: currency,
itemsValue: itemsValue,
sumItemsGP: sumItemsGP,
Expand Down Expand Up @@ -1519,7 +1529,6 @@ export class shinobigamiProvider extends SystemProvider {
health[i] = dirty[i] ? dirty[i] : health[i];
}


return {
id: actor.id,
name: actor.name,
Expand All @@ -1539,4 +1548,4 @@ export class shinobigamiProvider extends SystemProvider {
get template() {
return "/modules/party-overview/templates/shinobigami.hbs";
}
}
}

0 comments on commit 8080224

Please sign in to comment.