From c9b6a751adceeaca027c038f8c28f52c8990d09a Mon Sep 17 00:00:00 2001 From: opus1217 Date: Thu, 11 Feb 2021 22:13:17 -0800 Subject: [PATCH] 0.4.1i 11-Feb-2021 All tabs now showing values (although missing correct decorations) compendium-browser.js - loadAndFilterItems(): test for item5e was skipping items called loot, equipment etc. --- compendium-browser.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/compendium-browser.js b/compendium-browser.js index 4bcb971..9c2d18a 100644 --- a/compendium-browser.js +++ b/compendium-browser.js @@ -128,7 +128,7 @@ class CompendiumBrowser extends Application { //FIXME: How much could we do with the loaded index rather than all content? await pack.getContent().then(content => { for (let item5e of content) { - if (item5e.type === itemType) { + if ((item5e.type === itemType) || ((itemType === "item") && !["spell","feat"].includes(item5e.type))) { const decoratedItem = this.decorateCompendiumEntry(item5e); if (decoratedItem) { let altItemSort = null; @@ -798,15 +798,19 @@ class CompendiumBrowser extends Application { } async renderItemData(itemType) { - const items = await this.loadAndFilterItems(itemType); + let items; let html; if (itemType === "spell") { + items = await this.loadAndFilterItems(itemType); html = await renderTemplate("modules/compendium-browser/template/spell-browser-list.html", {spells : items}); } else if (itemType === "feat") { + items = await this.loadAndFilterItems(itemType); html = await renderTemplate("modules/compendium-browser/template/feat-browser-list.html", {feats : items}); } else if (itemType === "npc") { - html = await renderTemplate("modules/compendium-browser/template/npc-browser-list.html", {npcs : items}); + const npcs = this.loadNpcs(); + html = await renderTemplate("modules/compendium-browser/template/npc-browser-list.html", {npcs : npcs}); } else { + items = await this.loadAndFilterItems(itemType); html = await renderTemplate("modules/compendium-browser/template/item-browser-list.html", {items : items}); } return html;