From 6ddcdee9cfbc957a57abd05233ecddd82d617970 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 24 Feb 2017 20:26:28 -0800 Subject: [PATCH] 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 --- PKHeX.WinForms/MainWindow/Main.cs | 7 ++++++- PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/PKHeX.WinForms/MainWindow/Main.cs b/PKHeX.WinForms/MainWindow/Main.cs index c32d81cdd..8ce6ecc74 100644 --- a/PKHeX.WinForms/MainWindow/Main.cs +++ b/PKHeX.WinForms/MainWindow/Main.cs @@ -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); diff --git a/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs b/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs index e8549ffa1..f161b6847 100644 --- a/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs +++ b/PKHeX.WinForms/Subforms/Save Editors/SAV_BoxViewer.cs @@ -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) {