mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-09-07 23:08:47 -05:00
Smart Directory IO
if cybergadget save can be loaded/saved the opened directory will goto
This commit is contained in:
24
f1-Main.cs
24
f1-Main.cs
@@ -5950,6 +5950,14 @@ private void updateAbilityNumber()
|
||||
// Main Menu Strip UI Functions //
|
||||
private void mainmenuOpen(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
string cyberpath = Util.GetTempFolder();
|
||||
if (Directory.Exists(cyberpath + "root\\"))
|
||||
OpenPKX.InitialDirectory = cyberpath + "root\\";
|
||||
else if (Directory.Exists(cyberpath))
|
||||
OpenPKX.InitialDirectory = cyberpath;
|
||||
else { }
|
||||
|
||||
DialogResult result = OpenPKX.ShowDialog();
|
||||
if (result == DialogResult.OK)
|
||||
{
|
||||
@@ -7408,6 +7416,16 @@ private void exportSAV(object sender, EventArgs e)
|
||||
Array.Copy(editedsav, 0x5400, cybersav, 0, 0x65600);
|
||||
|
||||
SaveFileDialog cySAV = new SaveFileDialog();
|
||||
|
||||
// Try for file path
|
||||
string cyberpath = Util.GetTempFolder();
|
||||
if (Directory.Exists(cyberpath + "root\\"))
|
||||
cySAV.InitialDirectory = cyberpath + "root\\";
|
||||
else if (Directory.Exists(cyberpath))
|
||||
cySAV.InitialDirectory = cyberpath;
|
||||
else { }
|
||||
|
||||
|
||||
cySAV.Filter = "Cyber SAV|*.*";
|
||||
cySAV.FileName = Regex.Split(L_Save.Text, ": ")[1];
|
||||
DialogResult sdr = cySAV.ShowDialog();
|
||||
@@ -8321,9 +8339,9 @@ private void B_OpenTemp_Click(object sender, EventArgs e)
|
||||
{
|
||||
// MessageBox.Show("Not Implemented", "Error");
|
||||
string path = Util.GetTempFolder();
|
||||
if (File.Exists(path + "root\\"))
|
||||
if (Directory.Exists(path + "root\\"))
|
||||
System.Diagnostics.Process.Start("explorer.exe", path + "root\\");
|
||||
else if (File.Exists(path))
|
||||
else if (Directory.Exists(path))
|
||||
System.Diagnostics.Process.Start("explorer.exe", path);
|
||||
else { MessageBox.Show("Can't find the temporary file.\n\nMake sure the Cyber Gadget software is paused.", "Alert"); }
|
||||
}
|
||||
@@ -8511,8 +8529,6 @@ private void reportToolStripMenuItem_Click(object sender, EventArgs e)
|
||||
ReportForm.PopulateData(savefile);
|
||||
ReportForm.ShowDialog();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
#region Structs & Classes
|
||||
public class cbItem
|
||||
|
||||
Reference in New Issue
Block a user