PKHeX/PKHeX.WinForms/Controls/PKM Editor/EditPK1.cs
Kurt b41f2a3062 Extract logic from PKX
Extract Species Name logic to SpeciesName
Extract Language logic to Language
Remove FormConverter wrapper for string[] fetch
Rearrange some logic to more appropriate locations, update access
modifiers / types
Move some pkm array methods to arrayutil, make generic

PKX.GetVCLanguage was a dupe of _K12.GuessedLanguage() so just expose
the method

PKX is now back to pkm data manip only
2019-09-18 19:58:23 -07:00

36 lines
767 B
C#

using PKHeX.Core;
namespace PKHeX.WinForms.Controls
{
public partial class PKMEditor
{
private void PopulateFieldsPK1()
{
if (!(pkm is PK1 pk1))
return;
LoadMisc1(pk1);
TID_Trainer.LoadIDValues(pk1);
CR_PK1.LoadPK1(pk1);
// Attempt to detect language
CB_Language.SelectedValue = pk1.GuessedLanguage();
LoadPartyStats(pk1);
UpdateStats();
}
private PKM PreparePK1()
{
if (!(pkm is PK1 pk1))
return null;
SaveMisc1(pk1);
SavePartyStats(pk1);
pk1.FixMoves();
pk1.RefreshChecksum();
return pk1;
}
}
}