mirror of
https://github.com/kwsch/PKHeX
synced 2024-11-26 14:00:21 +00:00
Update wc6 database
g7db was last updated Nov 17, 2016 Closes #701 fix extension suggestion & copy backup logic from main
This commit is contained in:
parent
4636042fe1
commit
bd1ac8e266
4 changed files with 12 additions and 4 deletions
|
@ -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);
|
||||
|
|
Binary file not shown.
Binary file not shown.
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue