League-of-Foundry-Developers / compendium-browser

A module to easily browse and filter spells as well as npcs loaded from compendie
9 stars 18 forks source link

Sorting with Magic Item rarity doesn't work well. #28

Closed Nedrapter closed 2 years ago

Nedrapter commented 3 years ago

I've noticed two problems with this filter. 1) Many magical weapons do not appear on the list when you filter with their rarity. For example this weapon from Loot Tavern image Which is magical and Uncommon, doesn't show up when you filter with "Uncommon" . You could filter by typing in the name "Uncommon" since this one has it on its name, but plenty of others do not. 2) Many armors that have uncommon, rare, legendary rarities are not considered "magical" which I assume the filter requires them to be. Of course it could still be the same problem as in case 1 and that's why they don't show up. Example armor image

spetzel2020 commented 2 years ago

Widespread problem, probably related to this code:

        this.addItemFilter("Magic Items", "Rarity", 'data.rarity', 'select', 
        {
            Common: "Common",
            Uncommon: "Uncommon",
            Rare: "Rare",
            "Very rare": "Very Rare",
            Legendary: "Legendary"
        });

because the actual data value is RARE, LEGENDARY etc (all caps). However simply changing these values to uppercase doesn't work.

spetzel2020 commented 2 years ago

Fixed in 0.7.2 (turns out the rarity is stored as camelcase: veryRare, rare etc.)