mirror of
https://github.com/kwsch/PKHeX
synced 2024-12-04 01:39: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`
53 lines
1.2 KiB
C#
53 lines
1.2 KiB
C#
using System;
|
|
using PKHeX.Core;
|
|
|
|
namespace PKHeX.WinForms.Controls;
|
|
|
|
public partial class PKMEditor
|
|
{
|
|
private void PopulateFieldsPK4()
|
|
{
|
|
if (Entity is not G4PKM pk4)
|
|
throw new FormatException(nameof(Entity));
|
|
|
|
LoadMisc1(pk4);
|
|
LoadMisc2(pk4);
|
|
LoadMisc3(pk4);
|
|
LoadMisc4(pk4);
|
|
|
|
CB_GroundTile.SelectedValue = pk4.Gen4 ? (int)pk4.GroundTile : 0;
|
|
CB_GroundTile.Visible = Label_GroundTile.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()
|
|
{
|
|
if (Entity is not G4PKM pk4)
|
|
throw new FormatException(nameof(Entity));
|
|
|
|
SaveMisc1(pk4);
|
|
SaveMisc2(pk4);
|
|
SaveMisc3(pk4);
|
|
SaveMisc4(pk4);
|
|
|
|
pk4.GroundTile = (GroundTileType)WinFormsUtil.GetIndex(CB_GroundTile);
|
|
|
|
// Minor properties
|
|
pk4.ShinyLeaf = ShinyLeaf.GetValue();
|
|
|
|
SavePartyStats(pk4);
|
|
pk4.FixMoves();
|
|
pk4.RefreshChecksum();
|
|
return pk4;
|
|
}
|
|
}
|