2019-10-27 19:57:04 +00:00
|
|
|
|
using System;
|
|
|
|
|
using PKHeX.Core;
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
|
|
|
|
namespace PKHeX.WinForms.Controls
|
|
|
|
|
{
|
|
|
|
|
public partial class PKMEditor
|
|
|
|
|
{
|
|
|
|
|
private void PopulateFieldsPK8()
|
|
|
|
|
{
|
2020-12-23 05:24:41 +00:00
|
|
|
|
if (Entity is not PK8 pk8)
|
2019-10-27 19:57:04 +00:00
|
|
|
|
throw new FormatException(nameof(Entity));
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
|
|
|
|
LoadMisc1(pk8);
|
|
|
|
|
LoadMisc2(pk8);
|
|
|
|
|
LoadMisc3(pk8);
|
|
|
|
|
LoadMisc4(pk8);
|
|
|
|
|
LoadMisc6(pk8);
|
|
|
|
|
SizeCP.LoadPKM(pk8);
|
2019-11-16 01:34:18 +00:00
|
|
|
|
LoadMisc8(pk8);
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
|
|
|
|
LoadPartyStats(pk8);
|
|
|
|
|
UpdateStats();
|
|
|
|
|
}
|
|
|
|
|
|
2019-10-27 19:57:04 +00:00
|
|
|
|
private PK8 PreparePK8()
|
2019-09-23 23:56:47 +00:00
|
|
|
|
{
|
2020-12-23 05:24:41 +00:00
|
|
|
|
if (Entity is not PK8 pk8)
|
2019-10-27 19:57:04 +00:00
|
|
|
|
throw new FormatException(nameof(Entity));
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
|
|
|
|
SaveMisc1(pk8);
|
|
|
|
|
SaveMisc2(pk8);
|
|
|
|
|
SaveMisc3(pk8);
|
|
|
|
|
SaveMisc4(pk8);
|
|
|
|
|
SaveMisc6(pk8);
|
2019-11-16 01:34:18 +00:00
|
|
|
|
SaveMisc8(pk8);
|
2019-09-23 23:56:47 +00:00
|
|
|
|
|
|
|
|
|
// Toss in Party Stats
|
|
|
|
|
SavePartyStats(pk8);
|
|
|
|
|
|
|
|
|
|
pk8.FixMoves();
|
|
|
|
|
pk8.FixRelearn();
|
|
|
|
|
if (ModifyPKM)
|
|
|
|
|
pk8.FixMemories();
|
|
|
|
|
pk8.RefreshChecksum();
|
|
|
|
|
return pk8;
|
|
|
|
|
}
|
2021-11-20 02:23:49 +00:00
|
|
|
|
|
|
|
|
|
private PB8 PreparePB8()
|
|
|
|
|
{
|
|
|
|
|
if (Entity is not PB8 pk8)
|
|
|
|
|
throw new FormatException(nameof(Entity));
|
|
|
|
|
|
|
|
|
|
SaveMisc1(pk8);
|
|
|
|
|
SaveMisc2(pk8);
|
|
|
|
|
SaveMisc3(pk8);
|
|
|
|
|
SaveMisc4(pk8);
|
|
|
|
|
SaveMisc6(pk8);
|
|
|
|
|
SaveMisc8(pk8);
|
|
|
|
|
|
|
|
|
|
// Toss in Party Stats
|
|
|
|
|
SavePartyStats(pk8);
|
|
|
|
|
|
|
|
|
|
pk8.FixMoves();
|
|
|
|
|
pk8.FixRelearn();
|
|
|
|
|
if (ModifyPKM)
|
|
|
|
|
pk8.FixMemories();
|
|
|
|
|
pk8.RefreshChecksum();
|
|
|
|
|
return pk8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PopulateFieldsPB8()
|
|
|
|
|
{
|
|
|
|
|
if (Entity is not PB8 pk8)
|
|
|
|
|
throw new FormatException(nameof(Entity));
|
|
|
|
|
|
|
|
|
|
LoadMisc1(pk8);
|
|
|
|
|
LoadMisc2(pk8);
|
|
|
|
|
LoadMisc3(pk8);
|
|
|
|
|
LoadMisc4(pk8);
|
|
|
|
|
LoadMisc6(pk8);
|
|
|
|
|
SizeCP.LoadPKM(pk8);
|
|
|
|
|
LoadMisc8(pk8);
|
|
|
|
|
|
|
|
|
|
LoadPartyStats(pk8);
|
|
|
|
|
UpdateStats();
|
|
|
|
|
}
|
2022-02-05 01:36:51 +00:00
|
|
|
|
|
|
|
|
|
private PA8 PreparePA8()
|
|
|
|
|
{
|
|
|
|
|
if (Entity is not PA8 pk8)
|
|
|
|
|
throw new FormatException(nameof(Entity));
|
|
|
|
|
|
|
|
|
|
SaveMisc1(pk8);
|
|
|
|
|
SaveMisc2(pk8);
|
|
|
|
|
SaveMisc3(pk8);
|
|
|
|
|
SaveMisc4(pk8);
|
|
|
|
|
SaveMisc6(pk8);
|
|
|
|
|
SaveMisc8(pk8);
|
|
|
|
|
|
|
|
|
|
// Toss in Party Stats
|
|
|
|
|
SavePartyStats(pk8);
|
|
|
|
|
|
|
|
|
|
pk8.FixMoves();
|
|
|
|
|
pk8.FixRelearn();
|
|
|
|
|
if (ModifyPKM)
|
|
|
|
|
pk8.FixMemories();
|
|
|
|
|
pk8.RefreshChecksum();
|
|
|
|
|
return pk8;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void PopulateFieldsPA8()
|
|
|
|
|
{
|
|
|
|
|
if (Entity is not PA8 pk8)
|
|
|
|
|
throw new FormatException(nameof(Entity));
|
|
|
|
|
|
|
|
|
|
LoadMisc1(pk8);
|
|
|
|
|
LoadMisc2(pk8);
|
|
|
|
|
LoadMisc3(pk8);
|
|
|
|
|
LoadMisc4(pk8);
|
|
|
|
|
LoadMisc6(pk8);
|
|
|
|
|
LoadGVs(pk8);
|
|
|
|
|
SizeCP.LoadPKM(pk8);
|
|
|
|
|
LoadMisc8(pk8);
|
|
|
|
|
|
|
|
|
|
LoadPartyStats(pk8);
|
|
|
|
|
UpdateStats();
|
|
|
|
|
}
|
2019-09-23 23:56:47 +00:00
|
|
|
|
}
|
|
|
|
|
}
|