mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-07-28 19:27:23 -05:00
D&D: user's temp folder instead of application path
This commit is contained in:
parent
f867697caa
commit
72e149dc70
|
|
@ -2393,7 +2393,6 @@ private void dragout_MouseDown(object sender, MouseEventArgs e)
|
|||
if (!verifiedPKX()) { return; }
|
||||
{
|
||||
// Create Temp File to Drag
|
||||
string basepath = Application.StartupPath;
|
||||
Cursor.Current = Cursors.Hand;
|
||||
|
||||
// Make a new file name
|
||||
|
|
@ -2409,14 +2408,11 @@ private void dragout_MouseDown(object sender, MouseEventArgs e)
|
|||
// Strip out party stats (if they are there)
|
||||
Array.Resize(ref dragdata, PK6.SIZE_STORED);
|
||||
// Make file
|
||||
string newfile = Path.Combine(basepath, Util.CleanFileName(filename));
|
||||
string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename));
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(newfile, dragdata);
|
||||
|
||||
string[] filesToDrag = { newfile };
|
||||
dragout.DoDragDrop(new DataObject(DataFormats.FileDrop, filesToDrag), DragDropEffects.Move);
|
||||
File.Delete(newfile);
|
||||
DoDragDrop(new DataObject(DataFormats.FileDrop, new[] { newfile }), DragDropEffects.Move);
|
||||
}
|
||||
catch (Exception x)
|
||||
{ Util.Error("Drag & Drop Error", x.ToString()); }
|
||||
|
|
@ -3264,7 +3260,6 @@ private void pbBoxSlot_MouseDown(object sender, MouseEventArgs e)
|
|||
int offset = getPKXOffset(pkm_from_slot);
|
||||
if (e.Button != MouseButtons.Left || e.Clicks != 1) return;
|
||||
// Create Temp File to Drag
|
||||
string basepath = Application.StartupPath;
|
||||
Cursor.Current = Cursors.Hand;
|
||||
|
||||
// Prepare Data
|
||||
|
|
@ -3281,14 +3276,11 @@ private void pbBoxSlot_MouseDown(object sender, MouseEventArgs e)
|
|||
filename += " - " + pkx.PID + ".pk6";
|
||||
|
||||
// Make File
|
||||
string newfile = Path.Combine(basepath, Util.CleanFileName(filename));
|
||||
string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename));
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(newfile, dragdata);
|
||||
|
||||
string[] filesToDrag = { newfile };
|
||||
DoDragDrop(new DataObject(DataFormats.FileDrop, filesToDrag), DragDropEffects.Move);
|
||||
File.Delete(newfile); // after drop, delete the temporary file
|
||||
DoDragDrop(new DataObject(DataFormats.FileDrop, new[] { newfile }), DragDropEffects.Move);
|
||||
}
|
||||
catch (ArgumentException x)
|
||||
{ Util.Error("Drag & Drop Error:", x.ToString()); }
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user