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
|
|
|
|
{
|
2020-12-23 05:24:41 +00:00
|
|
|
|
if (Entity is not G4PKM pk4)
|
2019-10-27 19:57:04 +00:00
|
|
|
|
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
|
|
|
|
|
2021-07-04 06:25:09 +00:00
|
|
|
|
CB_GroundTile.SelectedValue = pk4.Gen4 ? (int)pk4.GroundTile : 0;
|
|
|
|
|
CB_GroundTile.Visible = Label_GroundTile.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
|
|
|
|
{
|
2020-12-23 05:24:41 +00:00
|
|
|
|
if (Entity is not G4PKM pk4)
|
2019-10-27 19:57:04 +00:00
|
|
|
|
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
|
|
|
|
|
2021-07-04 06:25:09 +00:00
|
|
|
|
pk4.GroundTile = (GroundTileType)WinFormsUtil.GetIndex(CB_GroundTile);
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|