added some filters for the new dnd5e item types
parent
d4181d347e
commit
165445df29
|
@ -568,7 +568,7 @@ class CompendiumBrowser extends Application {
|
||||||
|
|
||||||
const decoratedItem = this.decorateItem(item5e);
|
const decoratedItem = this.decorateItem(item5e);
|
||||||
|
|
||||||
if(decoratedItem && ["feat","class"].includes(decoratedItem.type) && this.passesFilter(decoratedItem, this.featFilters.activeFilters)){
|
if(decoratedItem && ["feat","class","subclass"].includes(decoratedItem.type) && this.passesFilter(decoratedItem, this.featFilters.activeFilters)){
|
||||||
itemsList[item5e.id] = {
|
itemsList[item5e.id] = {
|
||||||
compendium : pack.collection,
|
compendium : pack.collection,
|
||||||
name : decoratedItem.name,
|
name : decoratedItem.name,
|
||||||
|
@ -595,7 +595,7 @@ class CompendiumBrowser extends Application {
|
||||||
|
|
||||||
const decoratedItem = this.decorateItem(item5e);
|
const decoratedItem = this.decorateItem(item5e);
|
||||||
|
|
||||||
if(decoratedItem && !["spell","feat","class"].includes(decoratedItem.type) && this.passesFilter(decoratedItem, this.itemFilters.activeFilters)){
|
if(decoratedItem && !["spell","feat","class","subclass"].includes(decoratedItem.type) && this.passesFilter(decoratedItem, this.itemFilters.activeFilters)){
|
||||||
itemsList[item5e.id] = {
|
itemsList[item5e.id] = {
|
||||||
compendium : pack.collection,
|
compendium : pack.collection,
|
||||||
name : decoratedItem.name,
|
name : decoratedItem.name,
|
||||||
|
@ -1219,6 +1219,7 @@ class CompendiumBrowser extends Application {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (prop === undefined) return false;
|
||||||
if (filter.value !== undefined && prop !== undefined && prop != filter.value && !(filter.value === true && prop)) {
|
if (filter.value !== undefined && prop !== undefined && prop != filter.value && !(filter.value === true && prop)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -1566,6 +1567,24 @@ class CompendiumBrowser extends Application {
|
||||||
wizard: game.i18n.localize("CMPBrowser.wizard")
|
wizard: game.i18n.localize("CMPBrowser.wizard")
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
this.addFeatFilter(game.i18n.localize("CMPBrowser.general"), game.i18n.localize("CMPBrowser.overall"), 'type', 'select',
|
||||||
|
{
|
||||||
|
class: game.i18n.localize("CMPBrowser.class"),
|
||||||
|
subclass: game.i18n.localize("CMPBrowser.subclass"),
|
||||||
|
feat: game.i18n.localize("CMPBrowser.feature"),
|
||||||
|
}
|
||||||
|
, false);
|
||||||
|
|
||||||
|
this.addFeatFilter(game.i18n.localize("CMPBrowser.general"), game.i18n.localize("CMPBrowser.featureType"), 'system.type.value', 'select',
|
||||||
|
Object.keys(dnd5e.config.featureTypes).reduce(function(acc, current) {
|
||||||
|
acc[current] = dnd5e.config.featureTypes[current].label;
|
||||||
|
return acc;
|
||||||
|
}, {})
|
||||||
|
, false);
|
||||||
|
|
||||||
|
this.addFeatFilter(game.i18n.localize("CMPBrowser.general"), game.i18n.localize("CMPBrowser.subfeature"), 'system.type.subtype', 'select',
|
||||||
|
dnd5e.config.featureTypes.class.subtypes);
|
||||||
|
|
||||||
if (CompendiumBrowser.isFoundryV10Plus) {
|
if (CompendiumBrowser.isFoundryV10Plus) {
|
||||||
this.addFeatFilter("Game Mechanics", game.i18n.localize("DND5E.ItemActivationCost"), 'system.activation.type', 'select', CONFIG.DND5E.abilityActivationTypes);
|
this.addFeatFilter("Game Mechanics", game.i18n.localize("DND5E.ItemActivationCost"), 'system.activation.type', 'select', CONFIG.DND5E.abilityActivationTypes);
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
"CMPBrowser.spellType":"Spell Type",
|
"CMPBrowser.spellType":"Spell Type",
|
||||||
"CMPBrowser.damageType":"Damage Type",
|
"CMPBrowser.damageType":"Damage Type",
|
||||||
"CMPBrowser.class":"Class",
|
"CMPBrowser.class":"Class",
|
||||||
|
"CMPBrowser.subclass":"Subclass",
|
||||||
"CMPBrowser.artificer":"Artificer",
|
"CMPBrowser.artificer":"Artificer",
|
||||||
"CMPBrowser.bard":"Bard",
|
"CMPBrowser.bard":"Bard",
|
||||||
"CMPBrowser.cleric":"Cleric",
|
"CMPBrowser.cleric":"Cleric",
|
||||||
|
@ -32,6 +33,10 @@
|
||||||
"CMPBrowser.warlock":"Warlock",
|
"CMPBrowser.warlock":"Warlock",
|
||||||
"CMPBrowser.wizard":"Wizard",
|
"CMPBrowser.wizard":"Wizard",
|
||||||
"CMPBrowser.general":"General",
|
"CMPBrowser.general":"General",
|
||||||
|
"CMPBrowser.overall":"Overall Type",
|
||||||
|
"CMPBrowser.featureType":"Feature Type",
|
||||||
|
"CMPBrowser.subfeature":"Subfeature Type",
|
||||||
|
"CMPBrowser.feature":"Feature",
|
||||||
"CMPBrowser.components":"Components",
|
"CMPBrowser.components":"Components",
|
||||||
"CMPBrowser.hasSpells":"Has Spells",
|
"CMPBrowser.hasSpells":"Has Spells",
|
||||||
"CMPBrowser.hasLegAct":"Has Legendary Actions",
|
"CMPBrowser.hasLegAct":"Has Legendary Actions",
|
||||||
|
|
Loading…
Reference in New Issue