mirror of
https://github.com/kwsch/PKHeX
synced 2025-02-17 05:48:44 +00:00
Add some overloads for non-specified generation
fetches current gen if used without generation parameter
This commit is contained in:
parent
5580d6a7d4
commit
dbe000d08e
1 changed files with 4 additions and 5 deletions
|
@ -241,12 +241,12 @@ namespace PKHeX.Core
|
|||
/// <param name="nick">Current name</param>
|
||||
/// <param name="generation">Generation specific formatting option</param>
|
||||
/// <returns>True if it does not match any language name, False if not nicknamed</returns>
|
||||
public static bool IsNicknamedAnyLanguage(int species, string nick, int generation)
|
||||
public static bool IsNicknamedAnyLanguage(int species, string nick, int generation = Generation)
|
||||
{
|
||||
var langs = GetAvailableGameLanguages(generation);
|
||||
return langs.All(lang => GetSpeciesNameGeneration(species, lang, generation) != nick);
|
||||
}
|
||||
private static ICollection<int> GetAvailableGameLanguages(int generation)
|
||||
private static ICollection<int> GetAvailableGameLanguages(int generation = Generation)
|
||||
{
|
||||
if (generation < 3)
|
||||
return Legal.Languages_GB;
|
||||
|
@ -263,7 +263,7 @@ namespace PKHeX.Core
|
|||
/// <param name="generation">Generation specific formatting option</param>
|
||||
/// <param name="priorlang">Language ID with a higher priority</param>
|
||||
/// <returns>Language ID if it does not match any language name, -1 if no matches</returns>
|
||||
public static int GetSpeciesNameLanguage(int species, string nick, int generation, int priorlang = -1)
|
||||
public static int GetSpeciesNameLanguage(int species, string nick, int generation = Generation, int priorlang = -1)
|
||||
{
|
||||
var langs = GetAvailableGameLanguages(generation);
|
||||
|
||||
|
@ -452,7 +452,6 @@ namespace PKHeX.Core
|
|||
for (int i = 232; i < 260; i += 2)
|
||||
BitConverter.GetBytes((ushort)(BitConverter.ToUInt16(ekx, i) ^ LCRNG(ref seed) >> 16)).CopyTo(ekx, i);
|
||||
|
||||
// Done
|
||||
return ekx;
|
||||
}
|
||||
|
||||
|
@ -543,7 +542,7 @@ namespace PKHeX.Core
|
|||
|
||||
// Data Requests
|
||||
public static string GetResourceStringBall(int ball) => $"_ball{ball}";
|
||||
public static string GetResourceStringSprite(int species, int form, int gender, int generation)
|
||||
public static string GetResourceStringSprite(int species, int form, int gender, int generation = Generation)
|
||||
{
|
||||
if (new[] { 778, 664, 665, 414, 493, 773 }.Contains(species)) // Species who show their default sprite regardless of Form
|
||||
form = 0;
|
||||
|
|
Loading…
Add table
Reference in a new issue