From 10894f5341fb6824f08dfeaecbcb06517c2a5d67 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 16 Aug 2018 14:38:12 -0700 Subject: [PATCH] Add alternate clone hash method for Semi clones https://projectpokemon.org/home/forums/topic/47048-suggestion-being-able-to-check-pokemon-with-exact-pid-semi-clones/ hold control when searching (kinda clunky solution) to instead search by PID clones --- PKHeX.WinForms/Subforms/SAV_Database.cs | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/PKHeX.WinForms/Subforms/SAV_Database.cs b/PKHeX.WinForms/Subforms/SAV_Database.cs index 08e64605c..b7ea75069 100644 --- a/PKHeX.WinForms/Subforms/SAV_Database.cs +++ b/PKHeX.WinForms/Subforms/SAV_Database.cs @@ -123,6 +123,16 @@ namespace PKHeX.WinForms } } + private static string PIDHash(PKM pk) + { + switch (pk.Format) + { + case 1: return $"{((PK1)pk).DV16:X4}"; + case 2: return $"{((PK2)pk).DV16:X4}"; + default: return $"{pk.PID:X8}"; + } + } + // Important Events private void ClickView(object sender, EventArgs e) { @@ -519,7 +529,12 @@ namespace PKHeX.WinForms } if (Menu_SearchClones.Checked) - res = res.GroupBy(Hash).Where(group => group.Count() > 1).SelectMany(z => z); + { + Func method = Hash; + if (ModifierKeys == Keys.Control) + method = PIDHash; + res = res.GroupBy(method).Where(group => group.Count() > 1).SelectMany(z => z); + } return res; }