ben-wallis / Filtration

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

Reworking BlockItem sorting. #107

Closed GlenCFL closed 5 years ago

GlenCFL commented 5 years ago

Having to increment the SortOrder property on each BlockItem type each time we add a new one is tedious and error prone. It would be better if we could simply categorize each item using 1-2 properties, then we could simply sort first based on those properties and secondly alphabetically based on either the PrefixText or DisplayHeading property. Sorting is partially to increase outputted filter performance in-game and partially to group similar rules within the UI, so both need to be taken into consideration.

enum BlockItemKind {
    Action,
    Condition,
    Cosmetic
}

enum BlockItemType {
    Level,
    Size,
    Numeric,
    Boolean,
    Group,
    Rarity,
    String,
    Color,
    Effect
}

BlockItemTypes could really just be added as necessary, with it not being particularly strict whatsoever. It's also incomplete.