Fix dragging battle team slot sprite refresh

Refresh the image if the team slot indication needs updating
(true->false, false->true), else stay lazy and just set the image.

Could just refresh the image regardless but muh negligible speed
This commit is contained in:
Kurt 2017-02-24 20:26:28 -08:00
parent 82de3e5d12
commit 6ddcdee9cf
2 changed files with 12 additions and 2 deletions

View file

@ -4121,7 +4121,12 @@ namespace PKHeX.WinForms
pb.BackgroundImage = null;
if (DragInfo.SameBox && DragInfo.DestinationValid)
SlotPictureBoxes[DragInfo.slotDestinationSlotNumber].Image = img;
{
if (SAV.getIsTeamSet(box, DragInfo.slotDestinationSlotNumber) ^ SAV.getIsTeamSet(box, DragInfo.slotSourceSlotNumber))
getQuickFiller(SlotPictureBoxes[DragInfo.slotDestinationSlotNumber], SAV.getStoredSlot(DragInfo.slotDestinationOffset));
else
SlotPictureBoxes[DragInfo.slotDestinationSlotNumber].Image = img;
}
if (result == DragDropEffects.Copy) // viewed in tabs, apply 'view' highlight
getSlotColor(DragInfo.slotSourceSlotNumber, Resources.slotView);

View file

@ -203,7 +203,12 @@ namespace PKHeX.WinForms
pb.BackgroundImage = null;
if (DragInfo.SameBox && DragInfo.DestinationValid)
SlotPictureBoxes[DragInfo.slotDestinationSlotNumber].Image = img;
{
if (SAV.getIsTeamSet(box, DragInfo.slotDestinationSlotNumber) ^ SAV.getIsTeamSet(box, DragInfo.slotSourceSlotNumber))
getQuickFiller(SlotPictureBoxes[DragInfo.slotDestinationSlotNumber], SAV.getStoredSlot(DragInfo.slotDestinationOffset));
else
SlotPictureBoxes[DragInfo.slotDestinationSlotNumber].Image = img;
}
}
catch (Exception x)
{