2019-10-27 19:57:04 +00:00
|
|
|
|
using System;
|
|
|
|
|
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
|
|
|
|
{
|
2020-12-23 05:24:41 +00:00
|
|
|
|
if (Entity is not PK1 pk1)
|
2019-10-27 19:57:04 +00:00
|
|
|
|
throw new FormatException(nameof(Entity));
|
2016-08-28 10:18:22 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadMisc1(pk1);
|
2019-09-19 02:58:23 +00:00
|
|
|
|
TID_Trainer.LoadIDValues(pk1);
|
2018-09-30 17:16:45 +00:00
|
|
|
|
CR_PK1.LoadPK1(pk1);
|
2016-08-28 10:18:22 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
// Attempt to detect language
|
2019-09-19 02:58:23 +00:00
|
|
|
|
CB_Language.SelectedValue = pk1.GuessedLanguage();
|
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
|
|
|
|
|
2019-10-27 19:57:04 +00:00
|
|
|
|
private PK1 PreparePK1()
|
2016-08-28 10:18:22 +00:00
|
|
|
|
{
|
2020-12-23 05:24:41 +00:00
|
|
|
|
if (Entity is not PK1 pk1)
|
2019-10-27 19:57:04 +00:00
|
|
|
|
throw new FormatException(nameof(Entity));
|
2016-08-28 10:18:22 +00:00
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|