mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-23 02:43:13 +00:00
fc754b346b
[Language Reference](https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/proposals/csharp-10.0/file-scoped-namespaces) Updates all the files, one less level of indentation. Some small changes were made to API surfaces, renaming `PKM pkm` -> `PKM pk`, and `LegalityAnalysis.pkm` -> `LegalityAnalysis.Entity`
43 lines
964 B
C#
43 lines
964 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 IShadowPKM 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 IShadowPKM ck3)
|
|
SaveShadow3(ck3);
|
|
|
|
SavePartyStats(pk3);
|
|
pk3.FixMoves();
|
|
pk3.RefreshChecksum();
|
|
return pk3;
|
|
}
|
|
}
|