2017-10-03 06:13:40 +00:00
|
|
|
|
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
|
|
|
|
{
|
|
|
|
|
var pk4 = pkm;
|
|
|
|
|
if (pk4?.Format != 4)
|
|
|
|
|
return;
|
|
|
|
|
|
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;
|
2017-10-26 02:37:31 +00:00
|
|
|
|
CB_EncounterType.Visible = Label_EncounterType.Visible = pkm.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
|
|
|
|
|
switch (pk4)
|
|
|
|
|
{
|
|
|
|
|
case PK4 p4: ShinyLeaf.Value = p4.ShinyLeaf;
|
|
|
|
|
break;
|
2017-10-03 06:13:40 +00:00
|
|
|
|
case BK4 b4: ShinyLeaf.Value = b4.ShinyLeaf;
|
2017-07-27 01:26:54 +00:00
|
|
|
|
break;
|
|
|
|
|
}
|
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
|
|
|
|
|
2017-06-18 01:37:19 +00:00
|
|
|
|
private PKM PreparePK4()
|
2017-05-23 04:55:05 +00:00
|
|
|
|
{
|
|
|
|
|
var pk4 = pkm;
|
|
|
|
|
if (pk4?.Format != 4)
|
|
|
|
|
return null;
|
|
|
|
|
|
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
|
|
|
|
|
switch (pk4)
|
|
|
|
|
{
|
|
|
|
|
case PK4 p4:
|
|
|
|
|
p4.ShinyLeaf = ShinyLeaf.Value;
|
|
|
|
|
break;
|
|
|
|
|
case BK4 b4:
|
|
|
|
|
b4.ShinyLeaf = ShinyLeaf.Value;
|
|
|
|
|
break;
|
|
|
|
|
}
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|