mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-05-05 21:17:14 -05:00
Add wordfilter bypass search via database
regex matching takes a lot more time and is a cosmetic / easily fixable issue (reset to no nickname / default OT). Add a prompt to temp turn off those checks to drastically speed up search (no regexes done). Fix unsanitize for gen6 (should have been >= 6, aka starting with gen6)
This commit is contained in:
parent
69e8c071f7
commit
a938a1bd9c
|
|
@ -1931,7 +1931,7 @@ private static string SanitizeString(string str)
|
|||
private static string UnSanitizeString(string str, int generation, int species = -1, bool nicknamed = true)
|
||||
{
|
||||
var s = str;
|
||||
if (generation > 6)
|
||||
if (generation >= 6)
|
||||
s = str.Replace("\u0027", "\u2019"); // farfetch'd
|
||||
|
||||
if (generation == 5 || generation == 4)
|
||||
|
|
@ -1943,7 +1943,7 @@ private static string UnSanitizeString(string str, int generation, int species =
|
|||
|
||||
bool foreign = true;
|
||||
if ((species == 029 || species == 032) && !nicknamed)
|
||||
foreign = str[0] != 'N';
|
||||
foreign = str[0] != 'N'; // idoran
|
||||
else if (nicknamed)
|
||||
foreign = str.Select(c => c >> 12).Any(c => c != 0 && c != 0xE);
|
||||
|
||||
|
|
|
|||
|
|
@ -568,7 +568,13 @@ private async void B_Search_Click(object sender, EventArgs e)
|
|||
{
|
||||
B_Search.Enabled = false;
|
||||
var search = SearchDatabase();
|
||||
|
||||
bool legalSearch = Menu_SearchLegal.Checked ^ Menu_SearchIllegal.Checked;
|
||||
if (legalSearch && WinFormsUtil.Prompt(MessageBoxButtons.YesNo, "Check wordfilter legality?") == DialogResult.No)
|
||||
Legal.CheckWordFilter = false;
|
||||
var results = await Task.Run(() => search.ToArray());
|
||||
Legal.CheckWordFilter = true;
|
||||
|
||||
if (results.Length == 0)
|
||||
{
|
||||
if (!Menu_SearchBoxes.Checked && !Menu_SearchDatabase.Checked)
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user