diff --git a/module/SystemProvider.js b/module/SystemProvider.js index a31571f..57b2bea 100644 --- a/module/SystemProvider.js +++ b/module/SystemProvider.js @@ -1107,11 +1107,24 @@ export class swadeProvider extends SystemProvider { } export class tormenta20Provider extends SystemProvider { + constructor(id) { + super(id); + Handlebars.registerHelper("partyOverviewGetSkillList", function (skill, actors, opt) { + return actors.map((actor) => { + if (!isNaN(actor.pericias[skill]?.value)) + return { + ...actor.pericias[skill], + }; + return {}; + }); + }); + } + get tabs() { return { // languages: { id: "idiomas", visible: true, localization: "Idiomas" }, currencies: { id: "dinheiro", visible: true, localization: "Dinheiro" }, - // proficiencies: { id: "pericias", visible: true, localization: "PerĂ­cias" }, + proficiencies: { id: "pericias", visible: true, localization: "PerĂ­cias" }, }; } @@ -1162,6 +1175,12 @@ export class tormenta20Provider extends SystemProvider { delete pericias.fort; delete pericias.refl; delete pericias.vont; + delete pericias.defe; + for (let pericia in pericias) { + pericias[pericia] = { + value: data.pericias[pericia].value, + }; + } return pericias; } getSpeed(data) { @@ -1198,7 +1217,8 @@ export class tormenta20Provider extends SystemProvider { pm: this.getManaPoints(data), atributos: data.atributos, defesa: data.attributes.defesa.value, - pericias: data.pericias, + // pericias: data.pericias, + pericias: this.getPericias(data), // languages: data.traits.languages ? data.traits.languages.value.map((code) => CONFIG.DND5E.languages[code]) : [], // alignment: data.details.alignment, dinheiro: data.dinheiro, @@ -1228,17 +1248,19 @@ export class tormenta20Provider extends SystemProvider { } ); let totalPartyGP = actors.reduce((totalGP, actor) => totalGP + parseFloat(actor.dinheiroTotal), 0).toFixed(2); - // let pericias = foundry.utils.deepClone(CONFIG.T20.pericias); - // delete pericias.luta; - // delete pericias.pont; - // delete pericias.fort; - // delete pericias.refl; - // delete pericias.vont; - // delete pericias.ofic; + let pericias = foundry.utils.deepClone(CONFIG.T20.pericias); + delete pericias.luta; + delete pericias.pont; + delete pericias.fort; + delete pericias.refl; + delete pericias.vont; + delete pericias.ofic; + delete pericias.defe; + delete pericias.ocul; return [ actors, { - // pericias: pericias, + pericias: pericias, totalCurrency: totalCurrency, totalPartyGP: totalPartyGP, }, diff --git a/style/party-overview.css b/style/party-overview.css index a80130c..304b975 100644 --- a/style/party-overview.css +++ b/style/party-overview.css @@ -151,7 +151,8 @@ button.party-overview-button:not(.wfrp4e) { .party-overview-window.archmage .proficiencies.tab .header .num, .party-overview-window.dnd5e .proficiencies.tab .header .num, -.party-overview-window.pf2e .proficiencies.tab .header .num { +.party-overview-window.pf2e .proficiencies.tab .header .num, +.party-overview-window.tormenta20 .proficiencies.tab .header .num { flex: 1; } diff --git a/templates/tormenta20.hbs b/templates/tormenta20.hbs index 7dc8c06..5bff827 100644 --- a/templates/tormenta20.hbs +++ b/templates/tormenta20.hbs @@ -69,27 +69,31 @@ -