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
This commit is contained in:
Kurt 2018-08-16 14:38:12 -07:00
parent e366f9a93d
commit 10894f5341

View file

@ -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<PKM, string> method = Hash;
if (ModifierKeys == Keys.Control)
method = PIDHash;
res = res.GroupBy(method).Where(group => group.Count() > 1).SelectMany(z => z);
}
return res;
}