DIM
DIM copied to clipboard
Separate armor element and weapon damage sorts
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.
does this not break the current sort preferences of every single person who currently uses elemental sort?
@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.
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 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.