From bd1ac8e2661e100610c3fafe72862ae7b1c90972 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 7 Jan 2017 09:54:31 -0800 Subject: [PATCH] Update wc6 database g7db was last updated Nov 17, 2016 Closes #701 fix extension suggestion & copy backup logic from main --- PKHeX/MysteryGifts/MysteryGift.cs | 2 +- PKHeX/Resources/byte/wc6.pkl | Bin 281688 -> 284064 bytes PKHeX/Resources/byte/wc6full.pkl | Bin 223440 -> 228144 bytes PKHeX/Subforms/Save Editors/SAV_Wondercard.cs | 14 +++++++++++--- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/PKHeX/MysteryGifts/MysteryGift.cs b/PKHeX/MysteryGifts/MysteryGift.cs index 0f8b48052..ee6868561 100644 --- a/PKHeX/MysteryGifts/MysteryGift.cs +++ b/PKHeX/MysteryGifts/MysteryGift.cs @@ -80,7 +80,7 @@ namespace PKHeX } } - public string Extension => "." + GetType().Name.ToLower(); + public string Extension => GetType().Name.ToLower(); public string FileName => getCardHeader() + "." + Extension; public virtual byte[] Data { get; set; } public abstract PKM convertToPKM(SaveFile SAV); diff --git a/PKHeX/Resources/byte/wc6.pkl b/PKHeX/Resources/byte/wc6.pkl index 9dd487771493f4e185811ccb163cda28fdc53035..de55b2b7b467ebe6d6a6bcc35fb172098ae3271e 100644 GIT binary patch delta 767 zcmcaHLvX=rK`Aqqh-(KAL>yOOcyn3!{F+?~41e}8oIkNiNZ*WQau17@i1Qpb1~B;d9|RawHm=w+QBiF22NnxP^XUs8F&fI`Fyu3&GL!&e zB19>i+_-4+JT58e4|?WIa4`h|22+M4hFFFVj0_ANlQ$leom?Po!3q|c&REH$&1gP( zqnN&&FVIX}CX;FI^ob7`b-9rYov0|xG~i|lnlqvKb@D?gYx3MhO|yW}d+-^fz8q3` j!6OmIAUE)6V{o$qOS=LKBM>tIG4pl>78VPS4GJs(crU!l delta 38 rcmZ3mTJXjU!R-x!ED9`}1GqRCn*+Go1GpH0ms7`Ouf^G*u3 diff --git a/PKHeX/Resources/byte/wc6full.pkl b/PKHeX/Resources/byte/wc6full.pkl index 441c76b34e309fa20f6619b7675a08b4942b3432..3b1769957e972ac317a859d247d47a4d6ffb2755 100644 GIT binary patch delta 1214 zcmbW1Ur1AN6vxlKcTK(iZ~jXyep`l`p#`Zcf@WKjWWr!WRw-zCGr=Y~4K0c+B8d{W z-^1^vmn14`ky=pLj2YqdK~w@CL*I)WQTZ^kbMJLE*F)&N{J7_Le&_z~_jAtq-T8&o zksqndG|t~h?to5^pd0TNb~-^QqfUEKsTo?pjjm20%ILs30V~>Fa6z#xO2lRQ%>L8I zX_Jf(!D_Wu^CxJ(Ih!>H`25(7yhdmryH#T72K5Xl(-z?RV%Boa@RT zI4W3BBjmH|@AxWua4?5G>f^T4j4Y8I+a|Om-cyMz?D+(LAeM&K@}-+ZVf*WZx($0Q z+pbVkPFhVX>f4xE8+<|K?Qj-#ia0i|uIC;7GPMUJx@^$t``{bS@mZ6ZCaRP85~z=?noTeb_kGf8}xd&AjVK)Gp3xot|}aPY59DZ)@AYc>eBQQK;=>+?t5 zoPV5vKR6jA&^VhoOHlQ|g!x5q{#GdBCvfDgY*|7C!2e-JgznHlfB-k;TqF>g?hSp% z7g9-Om}5(0oQ7y4GFO$xwKy4cVMz3o(NH#YkuxfxEHcbxXxHF< gMU{rWN;{lozHe236u;Kw3yMac1iaxKnwM_;4M%uP4FCWD delta 29 jcmdn+jrYPu-t7;vnO%6AL-^Z6_!)tiX?qAib59HaxlIar diff --git a/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs b/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs index 2638005fe..697e3da11 100644 --- a/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs +++ b/PKHeX/Subforms/Save Editors/SAV_Wondercard.cs @@ -147,14 +147,22 @@ namespace PKHeX SaveFileDialog outputwc6 = new SaveFileDialog { Filter = getFilter(), - FileName = Util.CleanFileName($"{mg.CardID} - {mg.CardTitle}{mg.Extension}") + FileName = Util.CleanFileName(mg.FileName) }; if (outputwc6.ShowDialog() != DialogResult.OK) return; string path = outputwc6.FileName; - if (File.Exists(path)) // File already exists, save a .bak - File.WriteAllBytes(path + ".bak", File.ReadAllBytes(path)); + if (File.Exists(path)) + { + // File already exists, save a .bak + string bakpath = path + ".bak"; + if (!File.Exists(bakpath)) + { + byte[] backupfile = File.ReadAllBytes(path); + File.WriteAllBytes(bakpath, backupfile); + } + } File.WriteAllBytes(path, mg.Data); }