From 00bdee5d58726745cd401e22f4b61e834929d2f9 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 18 Dec 2016 23:49:27 -0800 Subject: [PATCH] Fix party dragdrop same slot deletion now just aborts the dragdrop operation if the destination is the same as the source --- PKHeX/MainWindow/Main.cs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/PKHeX/MainWindow/Main.cs b/PKHeX/MainWindow/Main.cs index 7fbcb66ea..dc8dcb3c9 100644 --- a/PKHeX/MainWindow/Main.cs +++ b/PKHeX/MainWindow/Main.cs @@ -4230,11 +4230,14 @@ private void pbBoxSlot_DragDrop(object sender, DragEventArgs e) DragInfo.slotDestination = this; DragInfo.slotDestinationSlotNumber = getSlot(sender); DragInfo.slotDestinationOffset = getPKXOffset(DragInfo.slotDestinationSlotNumber); - DragInfo.slotDestinationBoxNumber = CB_BoxSelect.SelectedIndex; + DragInfo.slotDestinationBoxNumber = DragInfo.DestinationParty ? -1 : CB_BoxSelect.SelectedIndex; // Check for In-Dropped files (PKX,SAV,ETC) string[] files = (string[])e.Data.GetData(DataFormats.FileDrop); if (Directory.Exists(files[0])) { loadBoxesFromDB(files[0]); return; } + if (DragInfo.SameSlot) + return; + if (DragInfo.SameBox) if (SAV.getIsSlotLocked(DragInfo.slotDestinationBoxNumber, DragInfo.slotDestinationSlotNumber)) { DragInfo.slotDestinationSlotNumber = -1; // Invalidate @@ -4359,6 +4362,7 @@ public static class DragInfo public static string CurrentPath; public static bool SameBox => slotSourceBoxNumber > -1 && slotSourceBoxNumber == slotDestinationBoxNumber; + public static bool SameSlot => slotSourceSlotNumber == slotDestinationSlotNumber && slotSourceBoxNumber == slotDestinationBoxNumber; public static bool SourceValid => slotSourceBoxNumber > -1 || SourceParty; public static bool DestinationValid => slotDestinationBoxNumber > -1 || DestinationParty; public static bool SourceParty => 30 <= slotSourceSlotNumber && slotSourceSlotNumber < 36;