mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 03:06:24 -05:00
Enable auto-bak loading for db
previously was only for debug builds; loads in like 2 seconds on my computer for >70k pkm from >250 backups if enough people complain I can add it as a setting instead
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
#define LOADALL
|
||||
using System;
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
@@ -157,7 +158,7 @@ private void ClickDelete(object sender, EventArgs e)
|
||||
var pk = Results[index];
|
||||
string path = pk.Identifier;
|
||||
|
||||
#if DEBUG
|
||||
#if LOADALL
|
||||
if (path.StartsWith(EXTERNAL_SAV))
|
||||
{
|
||||
WinFormsUtil.Alert("Can't delete from a backup save.");
|
||||
@@ -338,7 +339,7 @@ private void LoadDatabase()
|
||||
dbTemp.Add(pk);
|
||||
});
|
||||
|
||||
#if DEBUG
|
||||
#if LOADALL
|
||||
if (SaveUtil.GetSavesFromFolder(Main.BackupPath, false, out IEnumerable<string> result))
|
||||
{
|
||||
Parallel.ForEach(result, file =>
|
||||
@@ -405,7 +406,7 @@ private IEnumerable<PKM> SearchDatabase()
|
||||
if (!Menu_SearchDatabase.Checked)
|
||||
{
|
||||
res = res.Where(pk => !pk.Identifier.StartsWith(DatabasePath + Path.DirectorySeparatorChar, StringComparison.Ordinal));
|
||||
#if DEBUG
|
||||
#if LOADALL
|
||||
res = res.Where(pk => !pk.Identifier.StartsWith(EXTERNAL_SAV, StringComparison.Ordinal));
|
||||
#endif
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user