richardgaywood / foundry-penllawen-compendium-table-maker

Other
0 stars 1 forks source link

I can't Filter by Type #9

Closed brunocalado closed 1 year ago

brunocalado commented 1 year ago

Hi.

I'm trying to create a table with weapons only. But, this is generating with everything. await s.addJournalPageNamed("Weapons") .addInputCompendium(gear) .addTypeNameFilter("weapon") .writeJournalPage();

await s.addJournalPageNamed("Armor") .addInputCompendium(gear) .addTypeNameFilter("armor") .writeJournalPage();

https://user-images.githubusercontent.com/4999783/226462817-5af1d6a3-b27b-46c3-81e8-d3f9cc9ebcec.mp4

const skills = "swpf-core-rules.swpf-skills";
const edges = "swpf-core-rules.swpf-edges";
const hindrances = "swpf-core-rules.swpf-hindrances";
const powers = "swpf-core-rules.swpf-powers";
const gear = "swpf-core-rules.swpf-gear";

let s = game.modules.get("penllawen-compendium-table-maker").api.getCompendiumSummariser();

await s.makeNewJournalNamed("SWPF Summary");

await s.addJournalPageNamed("Edges")
  .addInputCompendium(edges)
  .writeJournalPage();

await s.addJournalPageNamed("Skills")
  .addInputCompendium(skills)
  .writeJournalPage();

await s.addJournalPageNamed("Hindrances")
  .addInputCompendium(hindrances)
  .writeJournalPage();  

await s.addJournalPageNamed("Powers")
  .addInputCompendium(powers)
  .writeJournalPage();    

await s.addJournalPageNamed("Weapons")
  .addInputCompendium(gear)
    .addTypeNameFilter("weapon")
  .writeJournalPage();      

await s.addJournalPageNamed("Armor")
  .addInputCompendium(gear)
    .addTypeNameFilter("armor")
  .writeJournalPage();      
richardgaywood commented 1 year ago

I've rewritten the filtering system completely in v1.4.0 (just released) -- can you give it a try, please?

Note you'll need to make a couple of small changes to your macro, see README for details.