kwsch / PKHeX

Pokémon Save File Editor
https://projectpokemon.org/pkhex/
Other
3.64k stars 684 forks source link

[Question] Sort pokemon in boxes #616

Closed natubis closed 7 years ago

natubis commented 7 years ago

Just a question. It might be a lot of work, but is it possible to sort pokemon in boxes according to: name/ID/nature/whatever?

kwsch commented 7 years ago

Not really a lot of work, just change how the sortBoxes method works in Saves/SaveFile.cs

Current sorting: Per Species with Non-eggs and empty slots at the end.

            var Sorted = Section
                .OrderBy(p => p.Species == 0) // empty slots at end
                .ThenBy(p => p.IsEgg) // eggs to the end
                .ThenBy(p => p.Species) // species sorted
                .ThenBy(p => p.AltForm) // altforms sorted
                .ThenBy(p => p.IsNicknamed).ToArray();

Can always modify the .ThenBy(p => p.Species) // species sorted line to do whatever you wish, but I don't see any use in having anything other than sorting with the method above.

If you wish to obtain clumps of info (like all pokemon with ID XXXXX) please use the Database Viewer with Options of only Boxes selected. The Advanced search syntax is the same as the Batch Editor. Just open the advanced search area (ctrl-A) and do something like =TID=12345 to see everything with that TID.