2019-10-27 19:57:04 +00:00
|
|
|
|
using System;
|
|
|
|
|
using PKHeX.Core;
|
2017-05-23 04:55:05 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.WinForms.Controls
|
|
|
|
|
{
|
|
|
|
|
public partial class PKMEditor
|
|
|
|
|
{
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private void PopulateFieldsPK4()
|
2017-05-23 04:55:05 +00:00
|
|
|
|
{
|
2019-10-27 19:57:04 +00:00
|
|
|
|
if (!(Entity is G4PKM pk4))
|
|
|
|
|
throw new FormatException(nameof(Entity));
|
2017-05-23 04:55:05 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadMisc1(pk4);
|
|
|
|
|
LoadMisc2(pk4);
|
|
|
|
|
LoadMisc3(pk4);
|
|
|
|
|
LoadMisc4(pk4);
|
2017-05-23 04:55:05 +00:00
|
|
|
|
|
|
|
|
|
CB_EncounterType.SelectedValue = pk4.Gen4 ? pk4.EncounterType : 0;
|
2019-10-27 19:57:04 +00:00
|
|
|
|
CB_EncounterType.Visible = Label_EncounterType.Visible = Entity.Gen4;
|
2017-05-23 04:55:05 +00:00
|
|
|
|
|
|
|
|
|
if (HaX)
|
|
|
|
|
DEV_Ability.SelectedValue = pk4.Ability;
|
|
|
|
|
else
|
2017-10-03 06:13:40 +00:00
|
|
|
|
LoadAbility4(pk4);
|
2017-06-18 04:49:14 +00:00
|
|
|
|
|
2017-07-27 01:26:54 +00:00
|
|
|
|
// Minor properties
|
2019-10-27 19:57:04 +00:00
|
|
|
|
ShinyLeaf.SetValue(pk4.ShinyLeaf);
|
2017-10-03 06:13:40 +00:00
|
|
|
|
|
|
|
|
|
LoadPartyStats(pk4);
|
|
|
|
|
UpdateStats();
|
2017-05-23 04:55:05 +00:00
|
|
|
|
}
|
2017-10-03 06:13:40 +00:00
|
|
|
|
|
2019-10-27 19:57:04 +00:00
|
|
|
|
private G4PKM PreparePK4()
|
2017-05-23 04:55:05 +00:00
|
|
|
|
{
|
2019-10-27 19:57:04 +00:00
|
|
|
|
if (!(Entity is G4PKM pk4))
|
|
|
|
|
throw new FormatException(nameof(Entity));
|
2017-05-23 04:55:05 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SaveMisc1(pk4);
|
|
|
|
|
SaveMisc2(pk4);
|
|
|
|
|
SaveMisc3(pk4);
|
|
|
|
|
SaveMisc4(pk4);
|
2017-05-23 04:55:05 +00:00
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
pk4.EncounterType = WinFormsUtil.GetIndex(CB_EncounterType);
|
2018-05-12 15:13:39 +00:00
|
|
|
|
|
2017-07-27 01:26:54 +00:00
|
|
|
|
// Minor properties
|
2019-10-27 19:57:04 +00:00
|
|
|
|
pk4.ShinyLeaf = ShinyLeaf.GetValue();
|
2017-06-18 04:49:14 +00:00
|
|
|
|
|
2017-10-03 06:13:40 +00:00
|
|
|
|
SavePartyStats(pk4);
|
2017-05-23 04:55:05 +00:00
|
|
|
|
pk4.FixMoves();
|
|
|
|
|
pk4.RefreshChecksum();
|
|
|
|
|
return pk4;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|