2019-02-10 04:05:32 +00:00
|
|
|
|
using static PKHeX.Core.GameVersion;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Core
|
2016-07-25 04:11:11 +00:00
|
|
|
|
{
|
2019-02-10 04:24:38 +00:00
|
|
|
|
/// <summary>
|
|
|
|
|
/// Retrieves Box Storage wallpaper metadata.
|
|
|
|
|
/// </summary>
|
2016-07-25 04:11:11 +00:00
|
|
|
|
public static class BoxWallpaper
|
|
|
|
|
{
|
2019-02-10 04:05:32 +00:00
|
|
|
|
public static string GetWallpaperResourceName(GameVersion version, int index)
|
2016-07-25 04:11:11 +00:00
|
|
|
|
{
|
|
|
|
|
index++;
|
2019-02-10 04:05:32 +00:00
|
|
|
|
var suffix = GetResourceSuffix(version, index);
|
|
|
|
|
return $"box_wp{index:00}{suffix}";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private static string GetResourceSuffix(GameVersion version, int index)
|
|
|
|
|
{
|
|
|
|
|
switch (version.GetGeneration())
|
2016-07-25 04:11:11 +00:00
|
|
|
|
{
|
2019-09-23 23:56:47 +00:00
|
|
|
|
case 8:
|
|
|
|
|
return "swsh";
|
2019-02-10 04:05:32 +00:00
|
|
|
|
case 7:
|
|
|
|
|
return "xy";
|
|
|
|
|
case 6:
|
|
|
|
|
return ORAS.Contains(version) && index > 16 ? "ao" : "xy";
|
|
|
|
|
case 5:
|
|
|
|
|
return B2W2.Contains(version) && index > 16 ? "b2w2" : "bw";
|
2016-07-25 04:11:11 +00:00
|
|
|
|
case 4:
|
2019-02-10 04:05:32 +00:00
|
|
|
|
if (index > 16)
|
|
|
|
|
{
|
|
|
|
|
if (Pt == version)
|
|
|
|
|
return "pt";
|
|
|
|
|
if (HGSS.Contains(version))
|
|
|
|
|
return "hgss";
|
|
|
|
|
}
|
|
|
|
|
return "dp";
|
2016-07-25 04:11:11 +00:00
|
|
|
|
case 3:
|
2019-02-10 04:05:32 +00:00
|
|
|
|
if (E == version)
|
|
|
|
|
return "e";
|
|
|
|
|
else if (FRLG.Contains(version) && index > 12)
|
|
|
|
|
return "frlg";
|
2016-07-25 04:11:11 +00:00
|
|
|
|
else
|
2019-02-10 04:05:32 +00:00
|
|
|
|
return "rs";
|
|
|
|
|
default:
|
|
|
|
|
return string.Empty;
|
2016-07-25 04:11:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2018-07-29 20:27:48 +00:00
|
|
|
|
|
2019-02-10 04:05:32 +00:00
|
|
|
|
public static bool IsWallpaperRed(GameVersion version, int wallpaperID)
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
2019-02-10 04:05:32 +00:00
|
|
|
|
switch (version.GetGeneration())
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
|
|
|
|
case 3:
|
2019-02-10 04:05:32 +00:00
|
|
|
|
if (CXD.Contains(version))
|
|
|
|
|
return wallpaperID == 7; // flame pattern in XD
|
|
|
|
|
switch (wallpaperID)
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
|
|
|
|
case 5: // Volcano
|
|
|
|
|
return true;
|
|
|
|
|
case 13: // PokéCenter
|
2019-02-10 04:05:32 +00:00
|
|
|
|
return E == version;
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
2017-03-09 05:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
case 4:
|
2019-02-10 04:05:32 +00:00
|
|
|
|
switch (wallpaperID)
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
|
|
|
|
case 5: // Volcano
|
|
|
|
|
case 12: // Checks
|
|
|
|
|
case 13: // PokéCenter
|
|
|
|
|
case 22: // Special
|
|
|
|
|
return true;
|
2019-02-10 04:05:32 +00:00
|
|
|
|
default:
|
|
|
|
|
return false;
|
2017-03-09 05:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
case 5:
|
2019-02-10 04:05:32 +00:00
|
|
|
|
switch (wallpaperID)
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
|
|
|
|
case 5: // Volcano
|
|
|
|
|
case 12: // Checks
|
|
|
|
|
return true;
|
|
|
|
|
case 19: // PWT
|
|
|
|
|
case 22: // Reshiram
|
2019-02-10 04:05:32 +00:00
|
|
|
|
return B2W2.Contains(version);
|
2017-03-09 05:50:34 +00:00
|
|
|
|
case 21: // Zoroark
|
|
|
|
|
case 23: // Musical
|
2019-02-10 04:05:32 +00:00
|
|
|
|
return BW.Contains(version);
|
|
|
|
|
default:
|
|
|
|
|
return false;
|
2017-03-09 05:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
case 6:
|
|
|
|
|
case 7:
|
2019-02-10 04:05:32 +00:00
|
|
|
|
switch (wallpaperID)
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
|
|
|
|
case 5: // Volcano
|
|
|
|
|
case 12: // PokéCenter
|
|
|
|
|
case 20: // Special5 Flare/Magma
|
|
|
|
|
return true;
|
2019-02-10 04:05:32 +00:00
|
|
|
|
default:
|
|
|
|
|
return false;
|
2017-03-09 05:50:34 +00:00
|
|
|
|
}
|
2019-09-23 23:56:47 +00:00
|
|
|
|
case 8: // todo swsh
|
|
|
|
|
return true;
|
2019-02-10 04:05:32 +00:00
|
|
|
|
default:
|
|
|
|
|
return false;
|
2017-03-09 05:50:34 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2016-07-25 04:11:11 +00:00
|
|
|
|
}
|
|
|
|
|
}
|