diff --git a/PKHeX.Core/Saves/SaveFile.cs b/PKHeX.Core/Saves/SaveFile.cs index e09fbaf6e..13618284d 100644 --- a/PKHeX.Core/Saves/SaveFile.cs +++ b/PKHeX.Core/Saves/SaveFile.cs @@ -588,7 +588,7 @@ public bool IsAnySlotLockedInBox(int BoxStart, int BoxEnd) } public virtual bool IsSlotInBattleTeam(int box, int slot) => false; - public void SortBoxes(int BoxStart = 0, int BoxEnd = -1) + public void SortBoxes(int BoxStart = 0, int BoxEnd = -1, Func, IEnumerable> sortMethod = null) { var BD = BoxData; int start = BoxSlotCount * BoxStart; @@ -596,7 +596,7 @@ public void SortBoxes(int BoxStart = 0, int BoxEnd = -1) if (BoxEnd > BoxStart) Section = Section.Take(BoxSlotCount * (BoxEnd - BoxStart)); - var Sorted = Section.OrderBySpecies(); + var Sorted = (sortMethod ?? PKMSorting.OrderBySpecies)(Section); Sorted.CopyTo(BD, start); BoxData = BD;