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.v0.3.1-spetzel2020
parent
4fb315bed3
commit
c9b6a751ad
|
@ -128,7 +128,7 @@ class CompendiumBrowser extends Application {
|
||||||
//FIXME: How much could we do with the loaded index rather than all content?
|
//FIXME: How much could we do with the loaded index rather than all content?
|
||||||
await pack.getContent().then(content => {
|
await pack.getContent().then(content => {
|
||||||
for (let item5e of 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);
|
const decoratedItem = this.decorateCompendiumEntry(item5e);
|
||||||
if (decoratedItem) {
|
if (decoratedItem) {
|
||||||
let altItemSort = null;
|
let altItemSort = null;
|
||||||
|
@ -798,15 +798,19 @@ class CompendiumBrowser extends Application {
|
||||||
}
|
}
|
||||||
|
|
||||||
async renderItemData(itemType) {
|
async renderItemData(itemType) {
|
||||||
const items = await this.loadAndFilterItems(itemType);
|
let items;
|
||||||
let html;
|
let html;
|
||||||
if (itemType === "spell") {
|
if (itemType === "spell") {
|
||||||
|
items = await this.loadAndFilterItems(itemType);
|
||||||
html = await renderTemplate("modules/compendium-browser/template/spell-browser-list.html", {spells : items});
|
html = await renderTemplate("modules/compendium-browser/template/spell-browser-list.html", {spells : items});
|
||||||
} else if (itemType === "feat") {
|
} else if (itemType === "feat") {
|
||||||
|
items = await this.loadAndFilterItems(itemType);
|
||||||
html = await renderTemplate("modules/compendium-browser/template/feat-browser-list.html", {feats : items});
|
html = await renderTemplate("modules/compendium-browser/template/feat-browser-list.html", {feats : items});
|
||||||
} else if (itemType === "npc") {
|
} 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 {
|
} else {
|
||||||
|
items = await this.loadAndFilterItems(itemType);
|
||||||
html = await renderTemplate("modules/compendium-browser/template/item-browser-list.html", {items : items});
|
html = await renderTemplate("modules/compendium-browser/template/item-browser-list.html", {items : items});
|
||||||
}
|
}
|
||||||
return html;
|
return html;
|
||||||
|
|
Loading…
Reference in New Issue