Adapt dropped/opened PKM to currently loaded savefile

Closes #3067
This commit is contained in:
Kurt 2020-10-30 22:44:08 -07:00
parent c9ee07e9b9
commit c9587c16c7
2 changed files with 13 additions and 1 deletions

View file

@ -457,10 +457,20 @@ namespace PKHeX.Core
pkm.Stat_Level = pkm.CurrentLevel;
}
protected void UpdatePKM(PKM pkm, PKMImportSetting trade, PKMImportSetting dex)
/// <summary>
/// Conditions a <see cref="pkm"/> for this save file as if it was traded to it.
/// </summary>
/// <param name="pkm">Entity to adapt</param>
/// <param name="trade">Setting on whether or not to adapt</param>
public void AdaptPKM(PKM pkm, PKMImportSetting trade = PKMImportSetting.UseDefault)
{
if (GetTradeUpdateSetting(trade))
SetPKM(pkm);
}
protected void UpdatePKM(PKM pkm, PKMImportSetting trade, PKMImportSetting dex)
{
AdaptPKM(pkm, trade);
if (GetDexUpdateSetting(dex))
SetDex(pkm);
}

View file

@ -627,6 +627,7 @@ namespace PKHeX.WinForms
Debug.WriteLine(c);
if (tmp == null)
return false;
C_SAV.SAV.AdaptPKM(tmp);
PKME_Tabs.PopulateFields(tmp);
return true;
}
@ -656,6 +657,7 @@ namespace PKHeX.WinForms
return true;
}
C_SAV.SAV.AdaptPKM(pk);
PKME_Tabs.PopulateFields(pk);
Debug.WriteLine(c);
return true;