mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-26 12:25:01 -05:00
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:
@@ -123,6 +123,16 @@ private static string Hash(PKM pk)
|
||||
}
|
||||
}
|
||||
|
||||
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 @@ private IEnumerable<PKM> SearchDatabase()
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user