Fix Check All behavior

- Gender specific forms now set the correct flags
- Regular click on Check All doesn't set shiny flags
- Shift click on Check All sets shiny flags too.

Closes #2425 thanks @igniscitrinus !
This commit is contained in:
Kurt 2019-11-16 09:28:32 -08:00
parent 29d52e065f
commit b172008981

View file

@ -315,15 +315,17 @@ namespace PKHeX.Core
SetAllSeen(true, shinyToo);
}
private void SeenAll(int species, int fc, PersonalInfo pi, bool shinyToo, bool value = true)
private void SeenAll(int species, int fc, bool shinyToo, bool value = true)
{
var pt = PersonalTable.SWSH;
for (int i = 0; i < fc; i++)
{
var pi = pt.GetFormeEntry(species, i);
if (pi.IsDualGender || !value)
{
SetSeenRegion(species, i, 0, value);
SetSeenRegion(species, i, 1, value);
if (!shinyToo && !value)
if (!shinyToo && value)
continue;
SetSeenRegion(species, i, 2, value);
SetSeenRegion(species, i, 3, value);
@ -400,18 +402,17 @@ namespace PKHeX.Core
var fc = pi.FormeCount;
if (species == (int) Species.Eternatus)
fc = 1; // ignore gigantamax
SeenAll(species, fc, pi, shinyToo, value);
SeenAll(species, fc, shinyToo, value);
if (species == (int) Species.Alcremie)
{
// Alcremie forms
var alc = PersonalTable.SWSH[(int)Species.Alcremie];
SeenAll((int)Species.Alcremie, 7 * 8, alc, shinyToo, value);
SeenAll((int)Species.Alcremie, 7 * 8, shinyToo, value);
}
else if (species == (int) Species.Eternatus)
{
SetSeenRegion(species, 63, 0, value);
if (!shinyToo && !value)
if (!shinyToo && value)
return;
SetSeenRegion(species, 63, 2, value);
}