2
0
Fork 0
mirror of https://github.com/kwsch/PKHeX synced 2024-12-21 01:43:10 +00:00
PKHeX/PKHeX.WinForms/Controls/PKM Editor/EditPK4.cs

55 lines
1.3 KiB
C#
Raw Normal View History

using System;
using PKHeX.Core;
namespace PKHeX.WinForms.Controls
{
public partial class PKMEditor
{
private void PopulateFieldsPK4()
{
2020-12-23 05:24:41 +00:00
if (Entity is not G4PKM pk4)
throw new FormatException(nameof(Entity));
LoadMisc1(pk4);
LoadMisc2(pk4);
LoadMisc3(pk4);
LoadMisc4(pk4);
CB_EncounterType.SelectedValue = pk4.Gen4 ? pk4.EncounterType : 0;
CB_EncounterType.Visible = Label_EncounterType.Visible = Entity.Gen4;
if (HaX)
DEV_Ability.SelectedValue = pk4.Ability;
else
LoadAbility4(pk4);
// Minor properties
ShinyLeaf.SetValue(pk4.ShinyLeaf);
LoadPartyStats(pk4);
UpdateStats();
}
private G4PKM PreparePK4()
{
2020-12-23 05:24:41 +00:00
if (Entity is not G4PKM pk4)
throw new FormatException(nameof(Entity));
SaveMisc1(pk4);
SaveMisc2(pk4);
SaveMisc3(pk4);
SaveMisc4(pk4);
pk4.EncounterType = WinFormsUtil.GetIndex(CB_EncounterType);
2018-05-12 15:13:39 +00:00
// Minor properties
pk4.ShinyLeaf = ShinyLeaf.GetValue();
SavePartyStats(pk4);
pk4.FixMoves();
pk4.RefreshChecksum();
return pk4;
}
}
}