2017-10-03 06:13:40 +00:00
|
|
|
|
using PKHeX.Core;
|
2016-08-28 10:18:22 +00:00
|
|
|
|
|
2017-05-23 04:55:05 +00:00
|
|
|
|
namespace PKHeX.WinForms.Controls
|
2016-08-28 10:18:22 +00:00
|
|
|
|
{
|
2017-05-23 04:55:05 +00:00
|
|
|
|
public partial class PKMEditor
|
2016-08-28 10:18:22 +00:00
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private void PopulateFieldsPK1()
|
2016-08-28 10:18:22 +00:00
|
|
|
|
{
|
2017-10-03 06:13:40 +00:00
|
|
|
|
if (!(pkm is PK1 pk1))
|
2016-08-28 10:18:22 +00:00
|
|
|
|
return;
|
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadMisc1(pk1);
|
2016-08-28 10:18:22 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
// Attempt to detect language
|
|
|
|
|
if (pk1.Japanese)
|
|
|
|
|
CB_Language.SelectedIndex = 0;
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
int lang = PKX.GetSpeciesNameLanguage(pk1.Species, pk1.Nickname, 2);
|
|
|
|
|
CB_Language.SelectedValue = lang > 0 ? lang : 2;
|
|
|
|
|
}
|
2016-08-29 20:27:17 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadPartyStats(pk1);
|
2017-06-18 01:37:19 +00:00
|
|
|
|
UpdateStats();
|
2016-08-28 10:18:22 +00:00
|
|
|
|
}
|
2017-10-03 06:13:40 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private PKM PreparePK1()
|
2016-08-28 10:18:22 +00:00
|
|
|
|
{
|
2017-10-03 06:13:40 +00:00
|
|
|
|
if (!(pkm is PK1 pk1))
|
2016-08-28 10:18:22 +00:00
|
|
|
|
return null;
|
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SaveMisc1(pk1);
|
2016-08-28 10:18:22 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SavePartyStats(pk1);
|
2016-08-28 10:18:22 +00:00
|
|
|
|
pk1.FixMoves();
|
|
|
|
|
pk1.RefreshChecksum();
|
|
|
|
|
return pk1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|