PKHeX/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_HallOfFame7.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

54 lines
1.5 KiB
C#

using System;
using System.Windows.Forms;
using PKHeX.Core;
namespace PKHeX.WinForms;
public partial class SAV_HallOfFame7 : Form
{
private readonly SAV7 SAV;
private readonly ComboBox[] entries;
public SAV_HallOfFame7(SAV7 sav)
{
InitializeComponent();
WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage);
SAV = sav;
entries = new[]
{
CB_F1, CB_F2, CB_F3, CB_F4, CB_F5, CB_F6,
CB_C1, CB_C2, CB_C3, CB_C4, CB_C5, CB_C6,
};
var block = SAV.Fame;
var specList = GameInfo.FilteredSources.Species;
for (int i = 0; i < entries.Length; i++)
{
var cb = entries[i];
cb.Items.Clear();
cb.InitializeBinding();
cb.DataSource = new BindingSource(specList, null);
cb.SelectedValue = block.GetEntry(i);
}
if (SAV is SAV7USUM uu)
TB_EC.Text = uu.Misc.StarterEncryptionConstant.ToString("X8");
else
TB_EC.Visible = L_EC.Visible = false;
}
private void B_Cancel_Click(object sender, EventArgs e) => Close();
private void B_Close_Click(object sender, EventArgs e)
{
var block = SAV.Fame;
for (int i = 0; i < entries.Length; i++)
block.SetEntry(i, (ushort)WinFormsUtil.GetIndex(entries[i]));
if (SAV is SAV7USUM uu)
uu.Misc.StarterEncryptionConstant = Util.GetHexValue(TB_EC.Text);
Close();
}
}