diff --git a/PKHeX.WinForms/Controls/SAV Editor/BoxEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/BoxEditor.cs index 221d12903..80383c435 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/BoxEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/BoxEditor.cs @@ -62,8 +62,8 @@ public partial class BoxEditor : UserControl, ISlotViewer BoxSlotCount = SlotPictureBoxes.Count; foreach (var pb in SlotPictureBoxes) { - pb.MouseEnter += (o, args) => BoxSlot_MouseEnter(pb, args); - pb.MouseLeave += (o, args) => BoxSlot_MouseLeave(pb, args); + pb.MouseEnter += (_, args) => BoxSlot_MouseEnter(pb, args); + pb.MouseLeave += (_, args) => BoxSlot_MouseLeave(pb, args); pb.MouseClick += BoxSlot_MouseClick; pb.MouseMove += BoxSlot_MouseMove; pb.MouseDown += BoxSlot_MouseDown; @@ -72,7 +72,7 @@ public partial class BoxEditor : UserControl, ISlotViewer pb.DragEnter += BoxSlot_DragEnter; pb.DragDrop += BoxSlot_DragDrop; pb.QueryContinueDrag += BoxSlot_QueryContinueDrag; - pb.GiveFeedback += (sender, e) => e.UseDefaultCursors = false; + pb.GiveFeedback += (_, e) => e.UseDefaultCursors = false; pb.AllowDrop = true; } } diff --git a/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs b/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs index fc0d82f7e..6c5a60370 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/BoxMenuStrip.cs @@ -35,7 +35,7 @@ public sealed class BoxMenuStrip : ContextMenuStrip var name = item.Type.ToString(); ManipTypeImage.TryGetValue(item.Type, out var img); var tsi = new ToolStripMenuItem { Name = $"mnu_{name}", Text = name, Image = img }; - tsi.Click += (s, e) => Manipulator.Execute(item, sav.CurrentBox, All, Reverse); + tsi.Click += (_, _) => Manipulator.Execute(item, sav.CurrentBox, All, Reverse); parent.DropDownItems.Add(tsi); CustomItems.Add(new ItemVisibility(tsi, item)); } diff --git a/PKHeX.WinForms/Controls/SAV Editor/PartyEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/PartyEditor.cs index 00c92f9c4..255d243d0 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/PartyEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/PartyEditor.cs @@ -38,8 +38,8 @@ public partial class PartyEditor : UserControl, ISlotViewer BoxSlotCount = SlotPictureBoxes.Count; foreach (var pb in SlotPictureBoxes) { - pb.MouseEnter += (o, args) => BoxSlot_MouseEnter(pb, args); - pb.MouseLeave += (o, args) => BoxSlot_MouseLeave(pb, args); + pb.MouseEnter += (_, args) => BoxSlot_MouseEnter(pb, args); + pb.MouseLeave += (_, args) => BoxSlot_MouseLeave(pb, args); pb.MouseClick += BoxSlot_MouseClick; pb.MouseMove += BoxSlot_MouseMove; pb.MouseDown += BoxSlot_MouseDown; @@ -48,7 +48,7 @@ public partial class PartyEditor : UserControl, ISlotViewer pb.DragEnter += BoxSlot_DragEnter; pb.DragDrop += BoxSlot_DragDrop; pb.QueryContinueDrag += BoxSlot_QueryContinueDrag; - pb.GiveFeedback += (sender, e) => e.UseDefaultCursors = false; + pb.GiveFeedback += (_, e) => e.UseDefaultCursors = false; pb.AllowDrop = true; } } diff --git a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs index 4259bbf4b..2873b9f9a 100644 --- a/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs +++ b/PKHeX.WinForms/Controls/SAV Editor/SAVEditor.cs @@ -92,17 +92,17 @@ public partial class SAVEditor : UserControl, ISlotViewer, ISaveFile pb.ContextMenuStrip = menu.mnuVSD; } - GiveFeedback += (sender, e) => e.UseDefaultCursors = false; - Tab_Box.MouseWheel += (s, e) => + GiveFeedback += (_, e) => e.UseDefaultCursors = false; + Tab_Box.MouseWheel += (_, e) => { if (menu.mnuVSD.Visible) return; Box.CurrentBox = e.Delta > 1 ? Box.Editor.MoveLeft() : Box.Editor.MoveRight(); }; - GB_Daycare.Click += (o, args) => SwitchDaycare(GB_Daycare, args); + GB_Daycare.Click += (_, _) => SwitchDaycare(); FLP_SAVtools.Scroll += WinFormsUtil.PanelScroll; - SortMenu.Opening += (s, x) => x.Cancel = !tabBoxMulti.GetTabRect(tabBoxMulti.SelectedIndex).Contains(PointToClient(MousePosition)); + SortMenu.Opening += (_, x) => x.Cancel = !tabBoxMulti.GetTabRect(tabBoxMulti.SelectedIndex).Contains(PointToClient(MousePosition)); } private void InitializeDragDrop(Control pb) @@ -117,7 +117,7 @@ public partial class SAVEditor : UserControl, ISlotViewer, ISaveFile pb.DragEnter += M.DragEnter; pb.DragDrop += M.DragDrop; pb.QueryContinueDrag += M.QueryContinueDrag; - pb.GiveFeedback += (sender, e) => e.UseDefaultCursors = false; + pb.GiveFeedback += (_, e) => e.UseDefaultCursors = false; pb.AllowDrop = true; pb.ContextMenuStrip = menu.mnuVSD; } @@ -572,7 +572,7 @@ public partial class SAVEditor : UserControl, ISlotViewer, ISaveFile private int DaycareIndex; - private void SwitchDaycare(object sender, EventArgs e) + private void SwitchDaycare() { if (SAV is not IDaycareMulti m) return; diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index 2720b6984..317e07f6e 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -146,8 +146,8 @@ public partial class Main : Form { C_SAV.Menu_Redo = Menu_Redo; C_SAV.Menu_Undo = Menu_Undo; - dragout.GiveFeedback += (sender, e) => e.UseDefaultCursors = false; - GiveFeedback += (sender, e) => e.UseDefaultCursors = false; + dragout.GiveFeedback += (_, e) => e.UseDefaultCursors = false; + GiveFeedback += (_, e) => e.UseDefaultCursors = false; PKME_Tabs.EnableDragDrop(Main_DragEnter, Main_DragDrop); C_SAV.EnableDragDrop(Main_DragEnter, Main_DragDrop); @@ -159,9 +159,9 @@ public partial class Main : Form // Add ContextMenus var mnu = new ContextMenuPKM(); - mnu.RequestEditorLegality += (o, args) => ClickLegality(mnu, args); - mnu.RequestEditorQR += (o, args) => ClickQR(mnu, args); - mnu.RequestEditorSaveAs += (o, args) => MainMenuSave(mnu, args); + mnu.RequestEditorLegality += (_, args) => ClickLegality(mnu, args); + mnu.RequestEditorQR += (_, args) => ClickQR(mnu, args); + mnu.RequestEditorSaveAs += (_, args) => MainMenuSave(mnu, args); dragout.ContextMenuStrip = mnu.mnuL; C_SAV.menu.RequestEditorLegality = DisplayLegalityReport; } diff --git a/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs b/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs index 683b07ddd..9b981d319 100644 --- a/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs +++ b/PKHeX.WinForms/Subforms/PKM Editors/BatchEditor.cs @@ -145,7 +145,7 @@ public partial class BatchEditor : Form { editor = new Core.BatchEditor(); bool finished = false, displayed = false; // hack cuz DoWork event isn't cleared after completion - b.DoWork += (sender, e) => + b.DoWork += (_, _) => { if (finished) return; @@ -157,8 +157,8 @@ public partial class BatchEditor : Form RunBatchEditFolder(sets, source, destination); finished = true; }; - b.ProgressChanged += (sender, e) => SetProgressBar(e.ProgressPercentage); - b.RunWorkerCompleted += (sender, e) => + b.ProgressChanged += (_, e) => SetProgressBar(e.ProgressPercentage); + b.RunWorkerCompleted += (_, _) => { string result = editor.GetEditorResults(sets); if (!displayed) WinFormsUtil.Alert(result); diff --git a/PKHeX.WinForms/Subforms/PKM Editors/RibbonEditor.cs b/PKHeX.WinForms/Subforms/PKM Editors/RibbonEditor.cs index 841a2c614..47801d71c 100644 --- a/PKHeX.WinForms/Subforms/PKM Editors/RibbonEditor.cs +++ b/PKHeX.WinForms/Subforms/PKM Editors/RibbonEditor.cs @@ -157,7 +157,7 @@ public partial class RibbonEditor : Form pb.BackgroundImage = img; var display = RibbonStrings.GetName(name); - pb.MouseEnter += (s, e) => tipName.SetToolTip(pb, display); + pb.MouseEnter += (_, _) => tipName.SetToolTip(pb, display); if (Entity is IRibbonSetAffixed) pb.Click += (_, _) => CB_Affixed.Text = RibbonStrings.GetName(name); FLP_Ribbons.Controls.Add(pb); @@ -201,7 +201,7 @@ public partial class RibbonEditor : Form Maximum = rib.MaxCount, }; - nud.ValueChanged += (sender, e) => + nud.ValueChanged += (_, _) => { var controlName = PrefixPB + rib.Name; var pb = FLP_Ribbons.Controls[controlName] ?? throw new ArgumentException($"{controlName} not found in {FLP_Ribbons.Name}."); @@ -215,7 +215,7 @@ public partial class RibbonEditor : Form nud.Value = Math.Min(rib.MaxCount, rib.RibbonCount); TLP_Ribbons.Controls.Add(nud, 0, row); - label.Click += (s, e) => nud.Value = (nud.Value == 0) ? nud.Maximum : 0; + label.Click += (_, _) => nud.Value = (nud.Value == 0) ? nud.Maximum : 0; } private void AddRibbonCheckBox(RibbonInfo rib, int row, Control label) @@ -228,7 +228,7 @@ public partial class RibbonEditor : Form Padding = Padding.Empty, Margin = Padding.Empty, }; - chk.CheckedChanged += (sender, e) => + chk.CheckedChanged += (_, _) => { rib.HasRibbon = chk.Checked; var controlName = PrefixPB + rib.Name; @@ -243,7 +243,7 @@ public partial class RibbonEditor : Form chk.Checked = rib.HasRibbon; TLP_Ribbons.Controls.Add(chk, 0, row); - label.Click += (s, e) => chk.Checked ^= true; + label.Click += (_, _) => chk.Checked ^= true; } private void ToggleNewRibbon(RibbonInfo rib, Control pb) diff --git a/PKHeX.WinForms/Subforms/PKM Editors/Text.cs b/PKHeX.WinForms/Subforms/PKM Editors/Text.cs index 9e84228f0..40effc50f 100644 --- a/PKHeX.WinForms/Subforms/PKM Editors/Text.cs +++ b/PKHeX.WinForms/Subforms/PKM Editors/Text.cs @@ -107,7 +107,7 @@ public partial class TrashEditor : Form var l = GetLabel($"${i:X2}"); l.Font = NUD_Generation.Font; var n = GetNUD(min: 0, max: 255, hex: true); - n.Click += (s, e) => + n.Click += (_, _) => { switch (ModifierKeys) { @@ -116,7 +116,7 @@ public partial class TrashEditor : Form } }; n.Value = Raw[i]; - n.ValueChanged += (o, args) => UpdateNUD(n, args); + n.ValueChanged += (_, _) => UpdateNUD(n); FLP_Hex.Controls.Add(l); FLP_Hex.Controls.Add(n); @@ -124,7 +124,7 @@ public partial class TrashEditor : Form if (i % 4 == 3) FLP_Hex.SetFlowBreak(n, true); } - TB_Text.TextChanged += (o, args) => UpdateString(TB_Text, args); + TB_Text.TextChanged += (_, _) => UpdateString(TB_Text); CB_Species.InitializeBinding(); CB_Species.DataSource = new BindingSource(GameInfo.SpeciesDataSource, null); @@ -133,14 +133,13 @@ public partial class TrashEditor : Form CB_Language.DataSource = GameInfo.LanguageDataSource(generation); } - private void UpdateNUD(object sender, EventArgs e) + private void UpdateNUD(NumericUpDown nud) { if (editing) return; - editing = true; + // build bytes - if (sender is not NumericUpDown nud) - throw new Exception(); + editing = true; int index = Bytes.IndexOf(nud); Raw[index] = (byte)nud.Value; @@ -148,13 +147,13 @@ public partial class TrashEditor : Form editing = false; } - private void UpdateString(object sender, EventArgs e) + private void UpdateString(TextBox tb) { if (editing) return; editing = true; // build bytes - ReadOnlySpan data = SetString(TB_Text.Text); + ReadOnlySpan data = SetString(tb.Text); if (data.Length > Raw.Length) data = data[..Raw.Length]; data.CopyTo(Raw); diff --git a/PKHeX.WinForms/Subforms/ReportGrid.cs b/PKHeX.WinForms/Subforms/ReportGrid.cs index 49f417021..a27c6b564 100644 --- a/PKHeX.WinForms/Subforms/ReportGrid.cs +++ b/PKHeX.WinForms/Subforms/ReportGrid.cs @@ -25,7 +25,7 @@ public partial class ReportGrid : Form private void GetContextMenu() { var mnuHide = new ToolStripMenuItem { Name = "mnuHide", Text = MsgReportColumnHide }; - mnuHide.Click += (sender, e) => + mnuHide.Click += (_, _) => { int c = dgData.SelectedCells.Count; if (c == 0) @@ -35,7 +35,7 @@ public partial class ReportGrid : Form dgData.Columns[dgData.SelectedCells[i].ColumnIndex].Visible = false; }; var mnuRestore = new ToolStripMenuItem { Name = "mnuRestore", Text = MsgReportColumnRestore }; - mnuRestore.Click += (sender, e) => + mnuRestore.Click += (_, _) => { int c = dgData.ColumnCount; for (int i = 0; i < c; i++) diff --git a/PKHeX.WinForms/Subforms/SAV_Database.cs b/PKHeX.WinForms/Subforms/SAV_Database.cs index a7a70eba3..fba48cfe5 100644 --- a/PKHeX.WinForms/Subforms/SAV_Database.cs +++ b/PKHeX.WinForms/Subforms/SAV_Database.cs @@ -24,6 +24,9 @@ public partial class SAV_Database : Form private readonly PKMEditor PKME_Tabs; private readonly EntityInstructionBuilder UC_Builder; + private const int GridWidth = 6; + private const int GridHeight = 11; + public SAV_Database(PKMEditor f1, SAVEditor saveditor) { InitializeComponent(); @@ -48,7 +51,7 @@ public partial class SAV_Database : Form var grid = DatabasePokeGrid; var smallWidth = grid.Width; var smallHeight = grid.Height; - grid.InitializeGrid(6, 11, SpriteUtil.Spriter); + grid.InitializeGrid(GridWidth, GridHeight, SpriteUtil.Spriter); grid.SetBackground(Resources.box_wp_clean); var newWidth = grid.Width; var newHeight = grid.Height; @@ -64,30 +67,26 @@ public partial class SAV_Database : Form foreach (var slot in PKXBOXES) { // Enable Click - slot.MouseClick += (sender, e) => + slot.MouseClick += (_, e) => { - if (sender == null) - return; switch (ModifierKeys) { - case Keys.Control: ClickView(sender, e); break; - case Keys.Alt: ClickDelete(sender, e); break; - case Keys.Shift: ClickSet(sender, e); break; + case Keys.Control: ClickView(slot, e); break; + case Keys.Alt: ClickDelete(slot, e); break; + case Keys.Shift: ClickSet(slot, e); break; } }; slot.ContextMenuStrip = mnu; if (Main.Settings.Hover.HoverSlotShowText) { - slot.MouseMove += (o, args) => ShowSet.UpdatePreviewPosition(args.Location); - slot.MouseEnter += (o, args) => ShowHoverTextForSlot(slot, args); - slot.MouseLeave += (o, args) => ShowSet.Clear(); + slot.MouseMove += (_, args) => ShowSet.UpdatePreviewPosition(args.Location); + slot.MouseEnter += (_, _) => ShowHoverTextForSlot(slot); + slot.MouseLeave += (_, _) => ShowSet.Clear(); } - slot.Enter += (sender, e) => + slot.Enter += (_, _) => { - if (sender is not PictureBox pb) - return; - var index = Array.IndexOf(PKXBOXES, pb); + var index = Array.IndexOf(PKXBOXES, slot); if (index < 0) return; index += (SCR_Box.Value * RES_MIN); @@ -95,7 +94,7 @@ public partial class SAV_Database : Form return; var pk = Results[index]; - pb.AccessibleDescription = ShowdownParsing.GetLocalizedPreviewText(pk.Entity, Main.CurrentLanguage); + slot.AccessibleDescription = ShowdownParsing.GetLocalizedPreviewText(pk.Entity, Main.CurrentLanguage); }; } @@ -119,14 +118,14 @@ public partial class SAV_Database : Form }); task.Start(); - Menu_SearchSettings.DropDown.Closing += (sender, e) => + Menu_SearchSettings.DropDown.Closing += (_, e) => { if (e.CloseReason == ToolStripDropDownCloseReason.ItemClicked) e.Cancel = true; }; CB_Format.Items[0] = MsgAny; CenterToParent(); - Closing += (sender, e) => ShowSet.Clear(); + Closing += (_, _) => ShowSet.Clear(); } private readonly PictureBox[] PKXBOXES; @@ -135,8 +134,8 @@ public partial class SAV_Database : Form private List RawDB = []; private int slotSelected = -1; // = null; private Image? slotColor; - private const int RES_MAX = 66; - private const int RES_MIN = 6; + private const int RES_MIN = GridWidth * 1; + private const int RES_MAX = GridWidth * GridHeight; private readonly string Counter; private readonly string Viewed; private const int MAXFORMAT = PKX.Generation; @@ -237,9 +236,9 @@ public partial class SAV_Database : Form L_Count.Text = string.Format(Counter, Results.Count); slotSelected = Results.Count - 1; slotColor = SpriteUtil.Spriter.Set; - if ((SCR_Box.Maximum + 1) * 6 < Results.Count) + if ((SCR_Box.Maximum + 1) * GridWidth < Results.Count) SCR_Box.Maximum++; - SCR_Box.Value = Math.Max(0, SCR_Box.Maximum - (PKXBOXES.Length / 6) + 1); + SCR_Box.Value = Math.Max(0, SCR_Box.Maximum - (PKXBOXES.Length / GridWidth) + 1); FillPKXBoxes(SCR_Box.Value); WinFormsUtil.Alert(MsgDBAddFromTabsSuccess); } @@ -768,9 +767,8 @@ public partial class SAV_Database : Form private void L_Viewed_MouseEnter(object sender, EventArgs e) => hover.SetToolTip(L_Viewed, L_Viewed.Text); - private void ShowHoverTextForSlot(object sender, EventArgs e) + private void ShowHoverTextForSlot(PictureBox pb) { - var pb = (PictureBox)sender; int index = Array.IndexOf(PKXBOXES, pb); if (!GetShiftedIndex(ref index)) return; diff --git a/PKHeX.WinForms/Subforms/SAV_Encounters.cs b/PKHeX.WinForms/Subforms/SAV_Encounters.cs index 334e5d982..ef365a362 100644 --- a/PKHeX.WinForms/Subforms/SAV_Encounters.cs +++ b/PKHeX.WinForms/Subforms/SAV_Encounters.cs @@ -24,6 +24,9 @@ public partial class SAV_Encounters : Form private readonly CancellationTokenSource TokenSource = new(); private readonly EntityInstructionBuilder UC_Builder; + private const int GridWidth = 6; + private const int GridHeight = 11; + public SAV_Encounters(PKMEditor f1, TrainerDatabase db) { InitializeComponent(); @@ -44,7 +47,7 @@ public partial class SAV_Encounters : Form var grid = EncounterPokeGrid; var smallWidth = grid.Width; var smallHeight = grid.Height; - grid.InitializeGrid(6, 11, SpriteUtil.Spriter); + grid.InitializeGrid(GridWidth, GridHeight, SpriteUtil.Spriter); grid.SetBackground(Resources.box_wp_clean); var newWidth = grid.Width; var newHeight = grid.Height; @@ -61,18 +64,14 @@ public partial class SAV_Encounters : Form foreach (var slot in PKXBOXES) { // Enable Click - slot.MouseClick += (sender, e) => + slot.MouseClick += (_, e) => { - if (sender == null) - return; if (ModifierKeys == Keys.Control) - ClickView(sender, e); + ClickView(slot, e); }; - slot.Enter += (sender, e) => + slot.Enter += (_, _) => { - if (sender is not PictureBox pb) - return; - var index = Array.IndexOf(PKXBOXES, pb); + var index = Array.IndexOf(PKXBOXES, slot); if (index < 0) return; index += (SCR_Box.Value * RES_MIN); @@ -80,16 +79,16 @@ public partial class SAV_Encounters : Form return; var enc = Results[index]; - pb.AccessibleDescription = string.Join(Environment.NewLine, enc.GetTextLines()); + slot.AccessibleDescription = string.Join(Environment.NewLine, enc.GetTextLines()); }; slot.ContextMenuStrip = mnu; if (Main.Settings.Hover.HoverSlotShowText) - slot.MouseEnter += (o, args) => ShowHoverTextForSlot(slot, args); + slot.MouseEnter += (_, _) => ShowHoverTextForSlot(slot); } Counter = L_Count.Text; L_Viewed.Text = string.Empty; // invisible for now - L_Viewed.MouseEnter += (sender, e) => hover.SetToolTip(L_Viewed, L_Viewed.Text); + L_Viewed.MouseEnter += (_, _) => hover.SetToolTip(L_Viewed, L_Viewed.Text); PopulateComboBoxes(); WinFormsUtil.TranslateInterface(this, Main.CurrentLanguage); @@ -130,8 +129,8 @@ public partial class SAV_Encounters : Form private List Results = []; private int slotSelected = -1; // = null; private Image? slotColor; - private const int RES_MAX = 66; - private const int RES_MIN = 6; + private const int RES_MIN = GridWidth * 1; + private const int RES_MAX = GridWidth * GridHeight; private readonly string Counter; private bool GetShiftedIndex(ref int index) @@ -482,9 +481,8 @@ public partial class SAV_Encounters : Form FillPKXBoxes(SCR_Box.Value = newval); } - private void ShowHoverTextForSlot(object sender, EventArgs e) + private void ShowHoverTextForSlot(PictureBox pb) { - var pb = (PictureBox)sender; int index = Array.IndexOf(PKXBOXES, pb); if (!GetShiftedIndex(ref index)) return; diff --git a/PKHeX.WinForms/Subforms/SAV_MysteryGiftDB.cs b/PKHeX.WinForms/Subforms/SAV_MysteryGiftDB.cs index ac3d5ab4d..e9eac91f7 100644 --- a/PKHeX.WinForms/Subforms/SAV_MysteryGiftDB.cs +++ b/PKHeX.WinForms/Subforms/SAV_MysteryGiftDB.cs @@ -22,6 +22,9 @@ public partial class SAV_MysteryGiftDB : Form private readonly SummaryPreviewer ShowSet = new(); private readonly EntityInstructionBuilder UC_Builder; + private const int GridWidth = 6; + private const int GridHeight = 11; + public SAV_MysteryGiftDB(PKMEditor tabs, SAVEditor sav) { InitializeComponent(); @@ -46,7 +49,7 @@ public partial class SAV_MysteryGiftDB : Form var grid = MysteryPokeGrid; var smallWidth = grid.Width; var smallHeight = grid.Height; - grid.InitializeGrid(6, 11, SpriteUtil.Spriter); + grid.InitializeGrid(GridWidth, GridHeight, SpriteUtil.Spriter); grid.SetBackground(Resources.box_wp_clean); var newWidth = grid.Width; var newHeight = grid.Height; @@ -63,19 +66,17 @@ public partial class SAV_MysteryGiftDB : Form foreach (var slot in PKXBOXES) { // Enable Click - slot.MouseClick += (sender, e) => + slot.MouseClick += (_, e) => { if (ModifierKeys == Keys.Control) - ClickView(sender!, e); + ClickView(slot, e); }; slot.ContextMenuStrip = mnu; - slot.MouseEnter += (o, args) => ShowHoverTextForSlot(slot, args); - slot.Enter += (sender, e) => + slot.MouseEnter += (_, _) => ShowHoverTextForSlot(slot); + slot.Enter += (_, _) => { - if (sender is not PictureBox pb) - return; - var index = Array.IndexOf(PKXBOXES, pb); + var index = Array.IndexOf(PKXBOXES, slot); if (index < 0) return; index += (SCR_Box.Value * RES_MIN); @@ -83,14 +84,14 @@ public partial class SAV_MysteryGiftDB : Form return; var enc = Results[index]; - pb.AccessibleDescription = string.Join(Environment.NewLine, enc.GetTextLines()); + slot.AccessibleDescription = string.Join(Environment.NewLine, enc.GetTextLines()); }; } Counter = L_Count.Text; Viewed = L_Viewed.Text; L_Viewed.Text = string.Empty; // invis for now - L_Viewed.MouseEnter += (sender, e) => hover.SetToolTip(L_Viewed, L_Viewed.Text); + L_Viewed.MouseEnter += (_, _) => hover.SetToolTip(L_Viewed, L_Viewed.Text); // Load Data B_Search.Enabled = false; @@ -107,8 +108,8 @@ public partial class SAV_MysteryGiftDB : Form private List RawDB = []; private int slotSelected = -1; // = null; private Image? slotColor; - private const int RES_MAX = 66; - private const int RES_MIN = 6; + private const int RES_MIN = GridWidth * 1; + private const int RES_MAX = GridWidth * GridHeight; private readonly string Counter; private readonly string Viewed; private const int MAXFORMAT = PKX.Generation; @@ -452,10 +453,8 @@ public partial class SAV_MysteryGiftDB : Form } } - private void ShowHoverTextForSlot(object sender, EventArgs e) + private void ShowHoverTextForSlot(PictureBox pb) { - if (sender is not PictureBox pb) - return; int index = Array.IndexOf(PKXBOXES, pb); if (!GetShiftedIndex(ref index)) return; diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen1/SAV_EventReset1.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen1/SAV_EventReset1.cs index 1795db183..c97accbb6 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen1/SAV_EventReset1.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen1/SAV_EventReset1.cs @@ -38,7 +38,7 @@ public partial class SAV_EventReset1 : Form Text = pkmname, Enabled = pair.IsHidden, Size = new Size((Width / 2) - 25, 22), }; - b.Click += (s, e) => + b.Click += (_, _) => { pair.Reset(); b.Enabled = false; diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen3/SAV_Misc3.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen3/SAV_Misc3.cs index ab465fe59..4616a02ee 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen3/SAV_Misc3.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen3/SAV_Misc3.cs @@ -447,7 +447,7 @@ public partial class SAV_Misc3 : Form NUD_RecordValue.Minimum = int.MinValue; NUD_RecordValue.Maximum = int.MaxValue; - CB_Record.SelectedIndexChanged += (s, e) => + CB_Record.SelectedIndexChanged += (_, _) => { if (CB_Record.SelectedValue == null) return; @@ -456,10 +456,10 @@ public partial class SAV_Misc3 : Form LoadRecordID(index); NUD_FameH.Visible = NUD_FameS.Visible = NUD_FameM.Visible = index == 1; }; - CB_Record.MouseWheel += (s, e) => ((HandledMouseEventArgs)e).Handled = true; // disallowed + CB_Record.MouseWheel += (_, e) => ((HandledMouseEventArgs)e).Handled = true; // disallowed CB_Record.SelectedIndex = 0; LoadRecordID(0); - NUD_RecordValue.ValueChanged += (s, e) => + NUD_RecordValue.ValueChanged += (_, _) => { if (CB_Record.SelectedValue == null) return; @@ -475,7 +475,7 @@ public partial class SAV_Misc3 : Form { NUD_BP.Value = Math.Min(NUD_BP.Maximum, em.BP); NUD_BPEarned.Value = em.BPEarned; - NUD_BPEarned.ValueChanged += (s, e) => em.BPEarned = (uint)NUD_BPEarned.Value; + NUD_BPEarned.ValueChanged += (_, _) => em.BPEarned = (uint)NUD_BPEarned.Value; } else { @@ -483,9 +483,9 @@ public partial class SAV_Misc3 : Form NUD_BPEarned.Visible = L_BPEarned.Visible = false; } - NUD_FameH.ValueChanged += (s, e) => ChangeFame(records); - NUD_FameM.ValueChanged += (s, e) => ChangeFame(records); - NUD_FameS.ValueChanged += (s, e) => ChangeFame(records); + NUD_FameH.ValueChanged += (_, _) => ChangeFame(records); + NUD_FameM.ValueChanged += (_, _) => ChangeFame(records); + NUD_FameS.ValueChanged += (_, _) => ChangeFame(records); void ChangeFame(Record3 r3) => r3.SetRecord(1, (uint)(NUD_RecordValue.Value = GetFameTime())); void LoadRecordID(int index) => NUD_RecordValue.Value = records.GetRecord(index); diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs index 40f94e178..2c83f375e 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen6/SAV_Trainer.cs @@ -23,7 +23,7 @@ public partial class SAV_Trainer : Form TB_TRNick.Font = TB_OTName.Font; } - B_MaxCash.Click += (sender, e) => MT_Money.Text = "9,999,999"; + B_MaxCash.Click += (_, _) => MT_Money.Text = "9,999,999"; CB_Gender.Items.Clear(); CB_Gender.Items.AddRange(Main.GenderSymbols.Take(2).ToArray()); // m/f depending on unicode selection diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs index 054632c9e..cca1e1d0a 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7.cs @@ -26,7 +26,7 @@ public partial class SAV_Trainer7 : Form TB_OTName.Font = FontUtil.GetPKXFont(); } - B_MaxCash.Click += (sender, e) => MT_Money.Text = "9,999,999"; + B_MaxCash.Click += (_, _) => MT_Money.Text = "9,999,999"; CB_Gender.Items.Clear(); CB_Gender.Items.AddRange(Main.GenderSymbols.Take(2).ToArray()); // m/f depending on unicode selection diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7GG.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7GG.cs index 02194e5f9..10df28a6b 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7GG.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen7/SAV_Trainer7GG.cs @@ -26,7 +26,7 @@ public partial class SAV_Trainer7GG : Form TB_OTName.Font = TB_RivalName.Font = FontUtil.GetPKXFont(); } - B_MaxCash.Click += (sender, e) => MT_Money.Text = "9,999,999"; + B_MaxCash.Click += (_, _) => MT_Money.Text = "9,999,999"; GetComboBoxes(); LoadTrainerInfo(); diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_FlagWork8b.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_FlagWork8b.cs index 917a4009d..1bb55f2e6 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_FlagWork8b.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_FlagWork8b.cs @@ -189,7 +189,7 @@ public sealed partial class SAV_FlagWork8b : Form mtb.Text = ((int)mtb.Value).ToString(); updating = false; } - cb.SelectedValueChanged += (o, args) => + cb.SelectedValueChanged += (_, _) => { if (editing || updating) return; diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Trainer8.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Trainer8.cs index 425a5677c..9c198261d 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Trainer8.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen8/SAV_Trainer8.cs @@ -21,8 +21,8 @@ public partial class SAV_Trainer8 : Form TB_OTName.Font = TB_TrainerCardName.Font = FontUtil.GetPKXFont(); } - B_MaxCash.Click += (sender, e) => MT_Money.Text = SAV.MaxMoney.ToString(); - B_MaxWatt.Click += (sender, e) => MT_Watt.Text = MyStatus8.MaxWatt.ToString(); + B_MaxCash.Click += (_, _) => MT_Money.Text = SAV.MaxMoney.ToString(); + B_MaxWatt.Click += (_, _) => MT_Watt.Text = MyStatus8.MaxWatt.ToString(); CB_Gender.Items.Clear(); CB_Gender.Items.AddRange(Main.GenderSymbols.Take(2).ToArray()); // m/f depending on unicode selection diff --git a/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_Trainer9.cs b/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_Trainer9.cs index 26ec30a9c..a5106693f 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_Trainer9.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/Gen9/SAV_Trainer9.cs @@ -27,9 +27,9 @@ public partial class SAV_Trainer9 : Form TB_OTName.Font = FontUtil.GetPKXFont(); } - B_MaxCash.Click += (sender, e) => MT_Money.Text = SAV.MaxMoney.ToString(); - B_MaxLP.Click += (sender, e) => MT_LP.Text = SAV.MaxMoney.ToString(); - B_MaxBP.Click += (sender, e) => MT_BP.Text = SAV.MaxMoney.ToString(); + B_MaxCash.Click += (_, _) => MT_Money.Text = SAV.MaxMoney.ToString(); + B_MaxLP.Click += (_, _) => MT_LP.Text = SAV.MaxMoney.ToString(); + B_MaxBP.Click += (_, _) => MT_BP.Text = SAV.MaxMoney.ToString(); var games = GameInfo.Strings.gamelist; CB_Game.Items.Clear(); diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxList.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxList.cs index c580f0167..be6d5c784 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxList.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxList.cs @@ -29,7 +29,7 @@ public sealed partial class SAV_BoxList : Form Owner = p.ParentForm; foreach (var b in Boxes) m.Env.Slots.Publisher.Subscribers.Add(b); - FormClosing += (sender, e) => + FormClosing += (_, _) => { foreach (var b in Boxes) { @@ -41,9 +41,9 @@ public sealed partial class SAV_BoxList : Form private void AddEvents() { - GiveFeedback += (sender, e) => e.UseDefaultCursors = false; + GiveFeedback += (_, e) => e.UseDefaultCursors = false; DragEnter += Main_DragEnter; - DragDrop += (sender, e) => + DragDrop += (_, _) => { Cursor = DefaultCursor; System.Media.SystemSounds.Asterisk.Play(); @@ -75,19 +75,15 @@ public sealed partial class SAV_BoxList : Form foreach (var box in Boxes) { box.ClearEvents(); - box.B_BoxLeft.Click += (s, e) => + box.B_BoxLeft.Click += (_, _) => { - if (s == null) - return; - int index = Array.IndexOf(Boxes, ((Button)s).Parent); + int index = Array.IndexOf(Boxes, box); int other = (index + Boxes.Length - 1) % Boxes.Length; m.SwapBoxes(index, other, p.SAV); }; - box.B_BoxRight.Click += (s, e) => + box.B_BoxRight.Click += (_, _) => { - if (s == null) - return; - int index = Array.IndexOf(Boxes, ((Button)s).Parent); + int index = Array.IndexOf(Boxes, box); int other = (index + 1) % Boxes.Length; m.SwapBoxes(index, other, p.SAV); }; diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs index 86a6a44cc..36afb5110 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs @@ -29,16 +29,16 @@ public sealed partial class SAV_BoxViewer : Form CenterToParent(); AllowDrop = true; - GiveFeedback += (sender, e) => e.UseDefaultCursors = false; + GiveFeedback += (_, e) => e.UseDefaultCursors = false; DragEnter += Main_DragEnter; - DragDrop += (sender, e) => + DragDrop += (_, _) => { Cursor = DefaultCursor; System.Media.SystemSounds.Asterisk.Play(); }; Owner = p.ParentForm; - MouseWheel += (s, e) => + MouseWheel += (_, e) => { if (parent.menu.mnuVSD.Visible) return; diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs index 131523a44..95f28132b 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags.cs @@ -114,7 +114,7 @@ public sealed partial class SAV_EventFlags : Form cells[0].Value = values[index]; cells[1].Value = name; } - dgv.CellValueChanged += (s, e) => + dgv.CellValueChanged += (_, e) => { if (e.ColumnIndex != 0 || e.RowIndex == -1) return; @@ -125,7 +125,7 @@ public sealed partial class SAV_EventFlags : Form if (NUD_Flag.Value == index) c_CustomFlag.Checked = chk; }; - dgv.CellMouseUp += (s, e) => + dgv.CellMouseUp += (_, e) => { if (e.RowIndex == -1) return; @@ -186,7 +186,7 @@ public sealed partial class SAV_EventFlags : Form cb.InitializeBinding(); cb.DataSource = map; - lbl.Click += (sender, e) => mtb.Value = 0; + lbl.Click += (_, _) => mtb.Value = 0; bool updating = false; mtb.ValueChanged += ChangeConstValue; void ChangeConstValue(object? sender, EventArgs e) @@ -205,7 +205,7 @@ public sealed partial class SAV_EventFlags : Form MT_Stat.Text = ((int)mtb.Value).ToString(); updating = false; } - cb.SelectedValueChanged += (o, args) => + cb.SelectedValueChanged += (_, _) => { if (editing || updating) return; diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags2.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags2.cs index 49b1666c5..e40b6e06a 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags2.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventFlags2.cs @@ -114,7 +114,7 @@ public sealed partial class SAV_EventFlags2 : Form cells[0].Value = values[index]; cells[1].Value = name; } - dgv.CellValueChanged += (s, e) => + dgv.CellValueChanged += (_, e) => { if (e.ColumnIndex != 0 || e.RowIndex == -1) return; @@ -125,7 +125,7 @@ public sealed partial class SAV_EventFlags2 : Form if (NUD_Flag.Value == index) c_CustomFlag.Checked = chk; }; - dgv.CellMouseUp += (s, e) => + dgv.CellMouseUp += (_, e) => { if (e.RowIndex == -1) return; @@ -185,7 +185,7 @@ public sealed partial class SAV_EventFlags2 : Form cb.InitializeBinding(); cb.DataSource = map; - lbl.Click += (sender, e) => mtb.Value = 0; + lbl.Click += (_, _) => mtb.Value = 0; bool updating = false; mtb.ValueChanged += ChangeConstValue; void ChangeConstValue(object? sender, EventArgs e) @@ -204,7 +204,7 @@ public sealed partial class SAV_EventFlags2 : Form MT_Stat.Text = ((int)mtb.Value).ToString(); updating = false; } - cb.SelectedValueChanged += (o, args) => + cb.SelectedValueChanged += (_, _) => { if (editing || updating) return; diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventWork.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventWork.cs index 998d5c001..504e51d0a 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_EventWork.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_EventWork.cs @@ -82,8 +82,8 @@ public sealed partial class SAV_EventWork : Form Checked = f.Flag, AutoSize = true, }; - lbl.Click += (sender, e) => chk.Checked ^= true; - chk.CheckedChanged += (s, e) => f.Flag = chk.Checked; + lbl.Click += (_, _) => chk.Checked ^= true; + chk.CheckedChanged += (_, _) => f.Flag = chk.Checked; tlp.Controls.Add(chk, 0, i); tlp.Controls.Add(lbl, 1, i); i++; @@ -139,7 +139,7 @@ public sealed partial class SAV_EventWork : Form if (cb.SelectedIndex < 0) cb.SelectedIndex = 0; - cb.SelectedValueChanged += (s, e) => + cb.SelectedValueChanged += (_, _) => { if (editing) return; @@ -154,7 +154,7 @@ public sealed partial class SAV_EventWork : Form } editing = false; }; - nud.ValueChanged += (s, e) => + nud.ValueChanged += (_, _) => { if (editing) return; diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_GroupViewer.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_GroupViewer.cs index be73df585..6e1140e8d 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_GroupViewer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_GroupViewer.cs @@ -28,7 +28,7 @@ public sealed partial class SAV_GroupViewer : Form Regenerate(count); CenterToParent(); - MouseWheel += (s, e) => CurrentGroup = e.Delta > 1 ? MoveLeft() : MoveRight(); + MouseWheel += (_, e) => CurrentGroup = e.Delta > 1 ? MoveLeft() : MoveRight(); var names = groups.Select(z => $"{z.GroupName}").ToArray(); CB_BoxSelect.Items.AddRange(names); @@ -36,19 +36,18 @@ public sealed partial class SAV_GroupViewer : Form foreach (PictureBox pb in Box.Entries) { - pb.Click += (o, args) => OmniClick(pb, args); + pb.Click += (_, args) => OmniClick(pb, args); pb.ContextMenuStrip = mnu; - pb.MouseMove += (o, args) => Preview.UpdatePreviewPosition(args.Location); - pb.MouseEnter += (o, args) => HoverSlot(pb, args); - pb.MouseLeave += (o, args) => Preview.Clear(); + pb.MouseMove += (_, args) => Preview.UpdatePreviewPosition(args.Location); + pb.MouseEnter += (_, _) => HoverSlot(pb); + pb.MouseLeave += (_, _) => Preview.Clear(); } - Closing += (s, e) => Preview.Clear(); + Closing += (_, _) => Preview.Clear(); } - private void HoverSlot(object sender, EventArgs e) + private void HoverSlot(PictureBox pb) { var group = Groups[CurrentGroup]; - var pb = (PictureBox)sender; var index = Box.Entries.IndexOf(pb); var slot = group.Slots[index]; Preview.Show(pb, slot); diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_SimpleTrainer.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_SimpleTrainer.cs index 40ee6564c..7d37c79a1 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_SimpleTrainer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_SimpleTrainer.cs @@ -19,8 +19,8 @@ public partial class SAV_SimpleTrainer : Form cba = [CHK_1, CHK_2, CHK_3, CHK_4, CHK_5, CHK_6, CHK_7, CHK_8]; TB_OTName.MaxLength = SAV.MaxStringLengthTrainer; - B_MaxCash.Click += (sender, e) => MT_Money.Text = SAV.MaxMoney.ToString(); - B_MaxCoins.Click += (sender, e) => MT_Coins.Text = SAV.MaxCoins.ToString(); + B_MaxCash.Click += (_, _) => MT_Money.Text = SAV.MaxMoney.ToString(); + B_MaxCoins.Click += (_, _) => MT_Coins.Text = SAV.MaxCoins.ToString(); MT_Money.Mask = "".PadRight((int)Math.Floor(Math.Log10(SAV.MaxMoney) + 1), '0'); MT_Coins.Mask = "".PadRight((int)Math.Floor(Math.Log10(SAV.MaxCoins) + 1), '0'); diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_Wondercard.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_Wondercard.cs index c4908ec4c..c44eb2770 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_Wondercard.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_Wondercard.cs @@ -42,7 +42,7 @@ public partial class SAV_Wondercard : Form pb.MouseDown += BoxSlot_MouseDown; pb.ContextMenuStrip = mnuVSD; pb.MouseHover += (_, _) => Summary.Show(pb, Album[pba.IndexOf(pb)]); - pb.Enter += (sender, e) => + pb.Enter += (_, _) => { var index = pba.IndexOf(pb); if (index < 0) diff --git a/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.cs b/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.cs index 2032bc7a2..9a773cf36 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/TrainerStat.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Collections.Generic; using System.Linq; using System.Windows.Forms; @@ -11,7 +11,7 @@ public partial class TrainerStat : UserControl public TrainerStat() { InitializeComponent(); - CB_Stats.MouseWheel += (s, e) => ((HandledMouseEventArgs)e).Handled = true; // disallowed + CB_Stats.MouseWheel += (_, e) => ((HandledMouseEventArgs)e).Handled = true; // disallowed } private bool Editing; diff --git a/PKHeX.WinForms/Subforms/SettingsEditor.cs b/PKHeX.WinForms/Subforms/SettingsEditor.cs index b2c7b6341..3e39757a0 100644 --- a/PKHeX.WinForms/Subforms/SettingsEditor.cs +++ b/PKHeX.WinForms/Subforms/SettingsEditor.cs @@ -28,7 +28,7 @@ public partial class SettingsEditor : Form CB_Blank.SelectedValue = (int)s.Startup.DefaultSaveVersion; CB_Blank.SelectedValueChanged += (_, _) => s.Startup.DefaultSaveVersion = (GameVersion)WinFormsUtil.GetIndex(CB_Blank); CB_Blank.SelectedIndexChanged += (_, _) => BlankChanged = true; - B_Reset.Click += (x, e) => DeleteSettings(); + B_Reset.Click += (_, _) => DeleteSettings(); } else { diff --git a/PKHeX.WinForms/Util/DevUtil.cs b/PKHeX.WinForms/Util/DevUtil.cs index 498ac833f..008cd38eb 100644 --- a/PKHeX.WinForms/Util/DevUtil.cs +++ b/PKHeX.WinForms/Util/DevUtil.cs @@ -42,7 +42,7 @@ namespace PKHeX.WinForms ShortcutKeys = Keys.Control | Keys.Alt | Keys.D, Visible = false, }; - ti.Click += (s, e) => UpdateAll(); + ti.Click += (_, _) => UpdateAll(); return ti; }