atomizer / muledump

all your mules are belong to you
84 stars 144 forks source link

Improve consumable item sorting #80

Closed Nightfirecat closed 8 years ago

Nightfirecat commented 9 years ago

Most items are sorted by their category and tier, keeping the random order in which they appear in the items array from affecting the totals box sorting. With consumable items, however, there are many categories that fit into the same class, but have wildly different functions. As such, this takes advantage of the pre-existing tier sorting and extends it to apply to consumable items to better arrange them in the totals box.

Closes atomizer/muledump#75

Additional info: http://pastebin.com/gFWRiPDk

atomizer commented 8 years ago

Well, this is a lot of hard-coding... It will require housekeeping whenever the game updates.

Nightfirecat commented 8 years ago

I'll look into what (if anything) can be done to hardcode less. Likely, some items can be assigned their sorting ranks by item name.

atomizer commented 8 years ago

It can be done if we would pull full object info from https://static.drips.pw/rotmg/production/current/json/ . It is quite a challenge to integrate it into the current code though.

Nightfirecat commented 8 years ago

Well, I mean that all of the items have their name in index 0 of their array, so it's possible to change the logic in the added code to filter by the item name rather than the current item ID (since that changes in certain updates). We shouldn't have to pull in any further object info afaik.