DIM icon indicating copy to clipboard operation
DIM copied to clipboard

Separate armor element and weapon damage sorts

Open Bailejd opened this issue 2 years ago • 4 comments

Issue #8512

This separates sorting by "Element" into "Weapon Element" and "Armor Element" for more customizable sorting.

I also added "SortByWeaponElement": "Weapon Element", and "SortByArmorElement": "Armor Element", to i18next.json and en.json. I left the original "Element": "Element", unchanged since t('Organizer.Columns.Element') was used somewhere else.

Bailejd avatar Jul 01 '22 03:07 Bailejd

does this not break the current sort preferences of every single person who currently uses elemental sort?

nev-r avatar Jul 01 '22 09:07 nev-r

@nev-r Good point.

Is there a good way to keep the original element sort without being too confusing? Having "Element", "Weapon Element", and "Armor Element" sorts has overlap which would probably cause confusion as to what "Element" sort does. Or maybe some way to convert everyone's "Element" sort to "Armor Element" + "Weapon Element" while keeping the correct order?

I'll look into possible ways to fix this. Suggestions are welcome.

Bailejd avatar Jul 01 '22 16:07 Bailejd

Yeah, I think what you'd want to do is when settings are loaded, if you see element replace it with elementWeapon and elementArmor at the same place in the custom sort list.

You could either do that by fixing up the list in itemSortOrderCustomSelector, or when the data is written to state in dim-api/reducer (the profileLoadedFromIDB and profileLoaded actions), or maybe in dim-api/actions you could fire off an actual settings update to upgrade the setting.

bhollis avatar Jul 02 '22 23:07 bhollis

@bhollis I made some changes to the profileLoaded action. I'm not exactly sure if that was what you meant, but it seems to get the expected result. If the "element" sort is in itemSortOrderCustom it replaces it with both "elementWeapon" and "elementArmor" while keeping the same order. Let me know if I should do something differently. A lot of dim-api/reducer.ts is new to me, so I'm still figuring out how it all works.

Bailejd avatar Jul 05 '22 06:07 Bailejd