PKHeX/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_BerryFieldXY.cs
Kurt fc754b346b
File scoped namespaces (#3529)
[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`
2022-06-18 11:04:24 -07:00

51 lines
1.6 KiB
C#

using System;
using System.Windows.Forms;
using PKHeX.Core;
using static System.Buffers.Binary.BinaryPrimitives;
namespace PKHeX.WinForms;
public partial class SAV_BerryFieldXY : Form
{
private readonly SAV6XY SAV;
public SAV_BerryFieldXY(SAV6XY sav)
{
InitializeComponent();
WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
SAV = sav;
listBox1.SelectedIndex = 0;
}
private void Changefield(object sender, EventArgs e)
{
// Change Berry Field
// Gather Data
int ofs = SAV.BerryField + 0xC + (listBox1.SelectedIndex * 0x18);
int berry = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 0)));
int u1 = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 1)));
int u2 = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 2)));
int u3 = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 3)));
int u4 = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 4)));
int u5 = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 5)));
int u6 = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 6)));
int u7 = ReadUInt16LittleEndian(SAV.Data.AsSpan(ofs + (2 * 7)));
// Display Data
TB_Berry.Text = berry.ToString();
TB_u1.Text = u1.ToString();
TB_u2.Text = u2.ToString();
TB_u3.Text = u3.ToString();
TB_u4.Text = u4.ToString();
TB_u5.Text = u5.ToString();
TB_u6.Text = u6.ToString();
TB_u7.Text = u7.ToString();
}
private void B_Cancel_Click(object sender, EventArgs e)
{
Close();
}
}