Database sanity checking before opening

This commit is contained in:
Kurt
2015-10-08 17:40:36 -07:00
parent d9073cea98
commit 8ef03eaccd
2 changed files with 6 additions and 2 deletions

View File

@@ -3466,7 +3466,11 @@ private void B_JPEG_Click(object sender, EventArgs e)
}
private void B_OpenDB_Click(object sender, EventArgs e)
{
new SAV_Database(this).Show();
if (Directory.Exists("db"))
new SAV_Database(this).Show();
else
Util.Alert("PKHeX's database was not found",
"Please dump all boxes from a save file, then ensure the 'db' folder exists.");
}
// Save Folder Related
private void clickSaveFileName(object sender, EventArgs e)

View File

@@ -95,8 +95,8 @@ public SAV_Database(Main f1)
// Prepare Database
prepareDBForSearch();
}
private string DatabasePath = Path.Combine(Path.GetDirectoryName(Process.GetCurrentProcess().MainModule.FileName), "db");
private Main m_parent;
private const string DatabasePath = "db";
private List<DatabaseList> Database = new List<DatabaseList>();
private List<PK6> Results;
private List<PK6> RawDB;