Misc tweaks

only have one empty forme array object
rename method for clarity
show version ID for hidden savefile program window titles
This commit is contained in:
Kurt 2018-08-15 21:15:06 -07:00
parent eec14645ef
commit e366f9a93d
4 changed files with 16 additions and 14 deletions

View file

@ -82,6 +82,8 @@ namespace PKHeX.Core
}
}
private static readonly string[] EMPTY = {""};
private static string[] GetFormsGen1(int species, IReadOnlyList<string> types, IReadOnlyList<string> forms, int generation)
{
switch (species)
@ -107,7 +109,7 @@ namespace PKHeX.Core
switch (species)
{
default:
return new[] { "" };
return EMPTY;
case 172:
return GetFormsPichu(generation, types, forms);
@ -121,7 +123,7 @@ namespace PKHeX.Core
switch (species)
{
default:
return new[] { "" };
return EMPTY;
case 351: // Casftorm
return new[]
@ -154,7 +156,7 @@ namespace PKHeX.Core
switch (species)
{
default:
return new[] { "" };
return EMPTY;
case 412:
case 413:
@ -217,7 +219,7 @@ namespace PKHeX.Core
switch (species)
{
default:
return new[] { "" };
return EMPTY;
case 550:
return new[]
@ -291,7 +293,7 @@ namespace PKHeX.Core
switch (species)
{
default:
return new[] { "" };
return EMPTY;
case 658:
return new[]
@ -420,7 +422,7 @@ namespace PKHeX.Core
switch (species)
{
default:
return new[] { "" };
return EMPTY;
case 741: // Oricorio
return new[]
@ -495,12 +497,12 @@ namespace PKHeX.Core
private static string[] GetFormsAlolan (int generation, IReadOnlyList<string> types, IReadOnlyList<string> forms, int species)
{
if (generation < 7)
return new[] { "" };
return EMPTY;
switch (species)
{
default:
return new[] { "" };
return EMPTY;
case 19: // Rattata
case 26: // Raichu
@ -531,7 +533,7 @@ namespace PKHeX.Core
switch (generation)
{
default:
return new[] { "" };
return EMPTY;
case 6:
return new[]
@ -570,7 +572,7 @@ namespace PKHeX.Core
};
}
return new[] { "" };
return EMPTY;
}
private static string[] GetFormsArceus (int generation, IReadOnlyList<string> types)

View file

@ -2,7 +2,7 @@
{
public static class BoxWallpaper
{
public static string GetWallpaper(SaveFile SAV, int index)
public static string GetWallpaperResourceName(SaveFile SAV, int index)
{
index++;
string s = $"box_wp{index:00}";

View file

@ -822,9 +822,9 @@ namespace PKHeX.WinForms
private static string GetProgramTitle(SaveFile sav)
{
if (Settings.Default.HideSAVDetails)
return GetProgramTitle() + $" - {sav.GetType().Name}";
string title = GetProgramTitle() + $" - {sav.GetType().Name}: ";
if (Settings.Default.HideSAVDetails)
return title + $"[{sav.Version}]";
if (!sav.Exportable) // Blank save file
return title + $"{sav.FileName} [{sav.OT} ({sav.Version})]";
return title + Path.GetFileNameWithoutExtension(Util.CleanFileName(sav.BAKName)); // more descriptive

View file

@ -96,7 +96,7 @@ namespace PKHeX.WinForms
private static Image GetWallpaper(SaveFile SAV, int box)
{
string s = BoxWallpaper.GetWallpaper(SAV, box);
string s = BoxWallpaper.GetWallpaperResourceName(SAV, box);
return (Bitmap)(Resources.ResourceManager.GetObject(s) ?? Resources.box_wp16xy);
}