mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-23 12:33:06 +00:00
Prevent sort/clear reverse on shortcut use
Closes #2111 by preventing the user error
This commit is contained in:
parent
f5b09c2bea
commit
81f6988d3e
2 changed files with 16 additions and 2 deletions
|
@ -39,6 +39,20 @@
|
|||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Executes the provided <see cref="type"/> with the provided parameters.
|
||||
/// </summary>
|
||||
/// <param name="type">Manipulation to perform on the <see cref="SAV"/> box data.</param>
|
||||
/// <param name="box">Single box to modify; if <see cref="allBoxes"/> is set, this param is ignored.</param>
|
||||
/// <param name="allBoxes">Indicates if all boxes are to be manipulated, or just one box.</param>
|
||||
/// <param name="reverse">Manipulation action should be inverted (criteria) or reversed (sort).</param>
|
||||
/// <returns>True if operation succeeded, false if no changes made.</returns>
|
||||
public bool Execute(BoxManipType type, int box, bool allBoxes, bool reverse = false)
|
||||
{
|
||||
var manip = type.GetManip();
|
||||
return Execute(manip, box, allBoxes, reverse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sanity check for modifying the box data.
|
||||
/// </summary>
|
||||
|
|
|
@ -106,8 +106,8 @@ namespace PKHeX.WinForms.Controls
|
|||
Resources.wand,
|
||||
};
|
||||
|
||||
public void Clear() => ((ToolStripMenuItem)Items[0]).DropDownItems[0].PerformClick();
|
||||
public void Sort() => ((ToolStripMenuItem)Items[1]).DropDownItems[0].PerformClick();
|
||||
public void Clear() => Manipulator.Execute(BoxManipType.DeleteAll, sav.SAV.CurrentBox, All);
|
||||
public void Sort() => Manipulator.Execute(BoxManipType.SortSpecies, sav.SAV.CurrentBox, All);
|
||||
|
||||
private static bool All => (ModifierKeys & Keys.Shift) != 0;
|
||||
private static bool Reverse => (ModifierKeys & Keys.Control) != 0;
|
||||
|
|
Loading…
Reference in a new issue