Mods are sorted alphabetically on all platforms.#968
Mods are sorted alphabetically on all platforms.#968HELLISH666-warframe wants to merge 1 commit intoCodenameCrew:mainfrom
Conversation
Very intricate code added right here!!111!!one11!!!
r6915ee
left a comment
There was a problem hiding this comment.
The review comment attached below is primarily for if the pull request goes down this route.
My only major complaint is that this will sort the list each time the mods menu is opened. This might not affect small mods lists that much, but if the player has many mods installed, then this may be able to cause a noticeable slowdown.
What I would instead do is memoize the sorted list, alongside a hash of the concatenated mod directory names (preferably through an SHA-2 variant) and the last sorting mode used. Sorting and memoization would instead occur in getModsList. The last hash is compared against the current hash alongside the last sorting mode, and if any of them differ, then sorting would reoccur.
This could perhaps be furthered by storing these values together alongside with other variants, further improving performance. The main drawback would be increased memory usage, but memoization can perhaps be configured to use only a user-defined amount of entries.
| FlxTween.tween(bg, {alpha: 0.5}, 0.25, {ease: FlxEase.cubeOut}); | ||
|
|
||
| mods = ModsFolder.getModsList(); | ||
| CoolUtil.sortAlphabetically(ModsFolder.getModsList(),true); |
There was a problem hiding this comment.
I would probably shorten this line and line 32 into one by doing:
mods = CoolUtil.sortAlphabetically(ModsFolder.getModsList(), true);Because sortAlphabetically returns the modified array, it's safe to directly use it as the value of mods.
Very intricate code added right here!!111!!one11!!!