mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-02 16:58:08 -05:00
Show all valid yamask-1 formarg values
from 319 (max HP-1) to 9999 (max saved value). Causes a little bit of GUI lag when loading 10k items to the combobox; could be a number entry but meh. Lazily allocate the 10k strings; wait until it's requested.
This commit is contained in:
@@ -303,6 +303,8 @@ private CheckResult VerifyFormArgument(LegalityAnalysis data, in uint arg)
|
||||
if (arg != 0)
|
||||
return GetInvalid(LFormArgumentNotAllowed);
|
||||
}
|
||||
if (arg > 9_999)
|
||||
return GetInvalid(LFormArgumentHigh);
|
||||
break;
|
||||
}
|
||||
case (int)Species.Runerigus:
|
||||
@@ -316,6 +318,8 @@ private CheckResult VerifyFormArgument(LegalityAnalysis data, in uint arg)
|
||||
{
|
||||
if (arg < 49)
|
||||
return GetInvalid(LFormArgumentLow);
|
||||
if (arg > 9_999)
|
||||
return GetInvalid(LFormArgumentHigh);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1029,23 +1029,23 @@ public static string[] GetFormArgumentStrings(int species, int form, int generat
|
||||
if (generation <= 5)
|
||||
return EMPTY;
|
||||
|
||||
static string[] GetBlank(int count)
|
||||
{
|
||||
var result = new string[count];
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
result[i] = i.ToString();
|
||||
return result;
|
||||
}
|
||||
|
||||
return species switch
|
||||
{
|
||||
(int) Furfrou when form != 0 => new[] {"0", "1", "2", "3", "4", "5"},
|
||||
(int) Hoopa when form == 1 => new[] {"0", "1", "2", "3"},
|
||||
(int) Yamask when form == 1 => GetBlank(320),
|
||||
(int) Runerigus when form == 0 => GetBlank(320), // max Runerigus HP
|
||||
(int) Yamask when form == 1 => FormArg9999.Value,
|
||||
(int) Runerigus when form == 0 => FormArg9999.Value,
|
||||
(int) Alcremie => Enum.GetNames(typeof(AlcremieDecoration)),
|
||||
_ => EMPTY
|
||||
};
|
||||
}
|
||||
|
||||
private static readonly Lazy<string[]> FormArg9999 = new Lazy<string[]>(() =>
|
||||
{
|
||||
var result = new string[9_999];
|
||||
for (int i = 0; i < result.Length; i++)
|
||||
result[i] = i.ToString();
|
||||
return result;
|
||||
}, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user