From 9171055fd47e758755843e015b611b6d2a8c5aff Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 18 Feb 2019 15:34:55 -0800 Subject: [PATCH] Add box sort by encounter type grabs encounter name and orders by that (Egg/Static/Wild etc) --- PKHeX.Core/Editing/Saves/BoxManipSort.cs | 1 + PKHeX.Core/Editing/Saves/BoxManipType.cs | 1 + PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs | 1 + 3 files changed, 3 insertions(+) diff --git a/PKHeX.Core/Editing/Saves/BoxManipSort.cs b/PKHeX.Core/Editing/Saves/BoxManipSort.cs index c35469e65..6bb463b93 100644 --- a/PKHeX.Core/Editing/Saves/BoxManipSort.cs +++ b/PKHeX.Core/Editing/Saves/BoxManipSort.cs @@ -61,6 +61,7 @@ namespace PKHeX.Core new BoxManipSort(BoxManipType.SortBST, list => list.OrderByCustom(pk => pk.PersonalInfo.BST)), new BoxManipSort(BoxManipType.SortCP, list => list.OrderByCustom(pk => (pk as PB7)?.Stat_CP), s => s is SAV7b), new BoxManipSort(BoxManipType.SortLegal, list => list.OrderByCustom(pk => !new LegalityAnalysis(pk).Valid)), + new BoxManipSort(BoxManipType.SortEncounterType, list => list.OrderByCustom(pk => new LegalityAnalysis(pk).Info?.EncounterMatch.GetEncounterTypeName())), }; } } \ No newline at end of file diff --git a/PKHeX.Core/Editing/Saves/BoxManipType.cs b/PKHeX.Core/Editing/Saves/BoxManipType.cs index 666ff0819..3d973e06b 100644 --- a/PKHeX.Core/Editing/Saves/BoxManipType.cs +++ b/PKHeX.Core/Editing/Saves/BoxManipType.cs @@ -30,6 +30,7 @@ namespace PKHeX.Core SortBST, SortCP, SortLegal, + SortEncounterType, ModifyHatchEggs, ModifyMaxFriendship, diff --git a/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs b/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs index 60ebfc4f3..7928761b9 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs @@ -70,6 +70,7 @@ namespace PKHeX.WinForms.Controls [BoxManipType.SortBST] = Resources.vallohi, [BoxManipType.SortCP] = Resources.vallohi, [BoxManipType.SortLegal] = Resources.export, + [BoxManipType.SortEncounterType] = Resources.about, [BoxManipType.ModifyHatchEggs] = Resources.about, [BoxManipType.ModifyMaxFriendship] = Resources.heart,