ben-wallis / Filtration

The Path of Exile loot filter editor
GNU General Public License v2.0
262 stars 61 forks source link

Incomplete display of multiple Rarity tokens #1

Open SayyadinaAtreides opened 9 years ago

SayyadinaAtreides commented 9 years ago

Various Hide blocks (have not tested Show) that include lines such as "Rarity Normal Magic" (which functions in-game to address both normal and magic items) are displaying in Filtration as applying only to Normal items. Switching the script text to "Rarity Magic Normal" continues to display in Filtration as applying only to Normal items.

Will provide screenshots if needed.

ben-wallis commented 9 years ago

I wasn't aware that the Rarity BlockItem supported that syntax - I haven't seen it used in any scripts. It's semantically the same as Rarity <= Magic - and I can't think of any scenario where you'd want "Rarity Normal Unique" for example. I'll leave this open as if the game supports it then Filtration should too, but I've got a fair number of higher priority issues currently.

SayyadinaAtreides commented 9 years ago

Makes sense. :) If I were writing a script in Filtration for the first time, I'd have just gone with <=; I assumed at first it was some sort of "oh hey I found a valid token, let's ignore the rest of the line" bug, but the fact that it parsed "Rarity Magic Normal" as "Rarity = Normal" as well is what intrigued me.

ben-wallis commented 9 years ago

The reason it parses "Rarity Magic Normal" as Rarity = Normal is because Normal is the first entry in the ItemRarity enum class, and "Rarity Magic Normal" doesn't match for the regex I use for Rarity rows - ^\w+\s+([><!=]{0,2})\s*(\w+)$. It also uses equals because Equal is the first entry in the FilterPredicateOperator enum class. So the bottom line is what you're seeing is the result of luck rather than anything intelligent happening.

You'll find that "Rarity Unique Rare", or "Rarity ermagerdthismakesnosense !1111" also parses as Rarity = Normal, lol.

ben-wallis commented 8 years ago

This is related to #17 and should be fixed in the next release.