PKHeX/PKHeX.WinForms/Controls/PKM Editor/EditPK3.cs
Kurt 03182ebd3d Update 22.11.24
Adds support for Scarlet & Violet.

Co-Authored-By: SciresM <8676005+SciresM@users.noreply.github.com>
Co-Authored-By: Matt <17801814+sora10pls@users.noreply.github.com>
Co-Authored-By: Lusamine <30205550+Lusamine@users.noreply.github.com>
2022-11-24 17:42:17 -08:00

43 lines
972 B
C#

using System;
using PKHeX.Core;
namespace PKHeX.WinForms.Controls;
public partial class PKMEditor
{
private void PopulateFieldsPK3()
{
if (Entity is not G3PKM pk3)
throw new FormatException(nameof(Entity));
LoadMisc1(pk3);
LoadMisc2(pk3);
LoadMisc3(pk3);
CB_Ability.SelectedIndex = pk3.AbilityBit && CB_Ability.Items.Count > 1 ? 1 : 0;
if (pk3 is IShadowCapture s)
LoadShadow3(s);
LoadPartyStats(pk3);
UpdateStats();
}
private G3PKM PreparePK3()
{
if (Entity is not G3PKM pk3)
throw new FormatException(nameof(Entity));
SaveMisc1(pk3);
SaveMisc2(pk3);
SaveMisc3(pk3);
pk3.AbilityBit = CB_Ability.SelectedIndex != 0;
if (Entity is IShadowCapture ck3)
SaveShadow3(ck3);
SavePartyStats(pk3);
pk3.FixMoves();
pk3.RefreshChecksum();
return pk3;
}
}