mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-25 05:20:20 +00:00
Add encrypted format dragout from box
Same as the preview sprite. Fixes bug with RS Box dragging out 84 bytes instead of 80 (yay for 4 metadata bytes, not worth another PKM class)
This commit is contained in:
parent
fe34ed6091
commit
503452e1c6
1 changed files with 3 additions and 2 deletions
|
@ -3934,16 +3934,17 @@ namespace PKHeX
|
|||
DragInfo.slotSourceBoxNumber = DragInfo.slotSourceSlotNumber >= 30 ? -1 : CB_BoxSelect.SelectedIndex;
|
||||
|
||||
// Make a new file name based off the PID
|
||||
bool encrypt = ModifierKeys == Keys.Control;
|
||||
byte[] dragdata = SAV.decryptPKM(DragInfo.slotPkmSource);
|
||||
Array.Resize(ref dragdata, SAV.SIZE_STORED);
|
||||
PKM pkx = SAV.getPKM(dragdata);
|
||||
string filename = pkx.FileName;
|
||||
string filename = $"{Path.GetFileNameWithoutExtension(pkx.FileName)}{(encrypt ? ".ek" + pkx.Format : "." + pkx.Extension) }";
|
||||
|
||||
// Make File
|
||||
string newfile = Path.Combine(Path.GetTempPath(), Util.CleanFileName(filename));
|
||||
try
|
||||
{
|
||||
File.WriteAllBytes(newfile, dragdata);
|
||||
File.WriteAllBytes(newfile, encrypt ? pkx.EncryptedBoxData : pkx.DecryptedBoxData);
|
||||
var img = (Bitmap)pb.Image;
|
||||
DragInfo.Cursor = Cursor.Current = new Cursor(img.GetHicon());
|
||||
pb.Image = null;
|
||||
|
|
Loading…
Reference in a new issue