From 00d0dac85e5611f5d688296563328d5140479066 Mon Sep 17 00:00:00 2001 From: Kurt Date: Fri, 2 Dec 2016 20:05:11 -0800 Subject: [PATCH] Fix colon trim for type: null y gamefreak Closes #558 --- PKHeX/MainWindow/Main.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/PKHeX/MainWindow/Main.cs b/PKHeX/MainWindow/Main.cs index 571d1dd3d..86d626edd 100644 --- a/PKHeX/MainWindow/Main.cs +++ b/PKHeX/MainWindow/Main.cs @@ -2970,7 +2970,8 @@ private void dragout_MouseDown(object sender, MouseEventArgs e) // Create Temp File to Drag PKM pkx = preparePKM(); bool encrypt = ModifierKeys == Keys.Control; - string filename = $"{Path.GetFileNameWithoutExtension(pkx.FileName)}{(encrypt ? ".ek" + pkx.Format : "."+pkx.Extension) }"; + string fn = pkx.FileName; fn = fn.Substring(0, fn.LastIndexOf('.')); + string filename = $"{fn}{(encrypt ? ".ek" + pkx.Format : "." + pkx.Extension)}"; byte[] dragdata = encrypt ? pkx.EncryptedBoxData : pkx.DecryptedBoxData; // Make file string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename)); @@ -4055,7 +4056,8 @@ private void pbBoxSlot_MouseMove(object sender, MouseEventArgs e) byte[] dragdata = SAV.decryptPKM(DragInfo.slotPkmSource); Array.Resize(ref dragdata, SAV.SIZE_STORED); PKM pkx = SAV.getPKM(dragdata); - string filename = $"{Path.GetFileNameWithoutExtension(pkx.FileName)}{(encrypt ? ".ek" + pkx.Format : "." + pkx.Extension) }"; + string fn = pkx.FileName; fn = fn.Substring(0, fn.LastIndexOf('.')); + string filename = $"{fn}{(encrypt ? ".ek" + pkx.Format : "." + pkx.Extension)}"; // Make File string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename));