mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-11 15:07:11 +00:00
Add box scrolling
https://projectpokemon.org/home/forums/topic/46370-bug-cant-scroll-between-boxes/
This commit is contained in:
parent
c24a48e815
commit
91f39d74db
3 changed files with 22 additions and 10 deletions
|
@ -210,19 +210,15 @@ namespace PKHeX.WinForms.Controls
|
|||
ResetSlots();
|
||||
M?.RefreshHoverSlot(this);
|
||||
}
|
||||
private void ClickBoxLeft(object sender, EventArgs e)
|
||||
private void ClickBoxLeft(object sender, EventArgs e) => MoveLeft(ModifierKeys == Keys.Control);
|
||||
public void MoveLeft(bool max = false)
|
||||
{
|
||||
if (ModifierKeys == Keys.Control)
|
||||
CurrentBox = 0;
|
||||
else
|
||||
CurrentBox = (CurrentBox + SAV.BoxCount - 1) % SAV.BoxCount;
|
||||
CurrentBox = max ? 0 : (CurrentBox + SAV.BoxCount - 1) % SAV.BoxCount;
|
||||
}
|
||||
private void ClickBoxRight(object sender, EventArgs e)
|
||||
private void ClickBoxRight(object sender, EventArgs e) => MoveRight(ModifierKeys == Keys.Control);
|
||||
public void MoveRight(bool max = false)
|
||||
{
|
||||
if (ModifierKeys == Keys.Control)
|
||||
CurrentBox = SAV.BoxCount - 1;
|
||||
else
|
||||
CurrentBox = (CurrentBox + 1) % SAV.BoxCount;
|
||||
CurrentBox = max ? SAV.BoxCount - 1 : (CurrentBox + 1) % SAV.BoxCount;
|
||||
}
|
||||
private void GetSlotFiller(int offset, PictureBox pb, int box = -1, int slot = -1)
|
||||
{
|
||||
|
|
|
@ -93,6 +93,14 @@ namespace PKHeX.WinForms.Controls
|
|||
pb.ContextMenuStrip = menu.mnuVSD;
|
||||
}
|
||||
|
||||
Tab_Box.MouseWheel += (s, e) =>
|
||||
{
|
||||
if (e.Delta > 1)
|
||||
Box.MoveLeft();
|
||||
else
|
||||
Box.MoveRight();
|
||||
};
|
||||
|
||||
GB_Daycare.Click += SwitchDaycare;
|
||||
FLP_SAVtools.Scroll += WinFormsUtil.PanelScroll;
|
||||
Tab_Box.ContextMenuStrip = SortMenu = new BoxMenuStrip(this);
|
||||
|
|
|
@ -24,6 +24,14 @@ namespace PKHeX.WinForms
|
|||
};
|
||||
Owner = p.ParentForm;
|
||||
|
||||
MouseWheel += (s, e) =>
|
||||
{
|
||||
if (e.Delta > 1)
|
||||
Box.MoveLeft();
|
||||
else
|
||||
Box.MoveRight();
|
||||
};
|
||||
|
||||
foreach (PictureBox pb in Box.SlotPictureBoxes)
|
||||
pb.ContextMenuStrip = parent.SlotPictureBoxes[0].ContextMenuStrip;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue