Kurt 2018-07-25 19:29:41 -07:00
parent c24a48e815
commit 91f39d74db
3 changed files with 22 additions and 10 deletions

View file

@ -210,19 +210,15 @@ namespace PKHeX.WinForms.Controls
ResetSlots(); ResetSlots();
M?.RefreshHoverSlot(this); 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 = max ? 0 : (CurrentBox + SAV.BoxCount - 1) % SAV.BoxCount;
CurrentBox = 0;
else
CurrentBox = (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 = max ? SAV.BoxCount - 1 : (CurrentBox + 1) % SAV.BoxCount;
CurrentBox = SAV.BoxCount - 1;
else
CurrentBox = (CurrentBox + 1) % SAV.BoxCount;
} }
private void GetSlotFiller(int offset, PictureBox pb, int box = -1, int slot = -1) private void GetSlotFiller(int offset, PictureBox pb, int box = -1, int slot = -1)
{ {

View file

@ -93,6 +93,14 @@ namespace PKHeX.WinForms.Controls
pb.ContextMenuStrip = menu.mnuVSD; pb.ContextMenuStrip = menu.mnuVSD;
} }
Tab_Box.MouseWheel += (s, e) =>
{
if (e.Delta > 1)
Box.MoveLeft();
else
Box.MoveRight();
};
GB_Daycare.Click += SwitchDaycare; GB_Daycare.Click += SwitchDaycare;
FLP_SAVtools.Scroll += WinFormsUtil.PanelScroll; FLP_SAVtools.Scroll += WinFormsUtil.PanelScroll;
Tab_Box.ContextMenuStrip = SortMenu = new BoxMenuStrip(this); Tab_Box.ContextMenuStrip = SortMenu = new BoxMenuStrip(this);

View file

@ -24,6 +24,14 @@ namespace PKHeX.WinForms
}; };
Owner = p.ParentForm; Owner = p.ParentForm;
MouseWheel += (s, e) =>
{
if (e.Delta > 1)
Box.MoveLeft();
else
Box.MoveRight();
};
foreach (PictureBox pb in Box.SlotPictureBoxes) foreach (PictureBox pb in Box.SlotPictureBoxes)
pb.ContextMenuStrip = parent.SlotPictureBoxes[0].ContextMenuStrip; pb.ContextMenuStrip = parent.SlotPictureBoxes[0].ContextMenuStrip;
} }