2019-10-04 01:23:40 +00:00
|
|
|
|
using PKHeX.Core;
|
2019-02-10 04:05:32 +00:00
|
|
|
|
|
2019-10-04 01:23:40 +00:00
|
|
|
|
using static PKHeX.Core.GameVersion;
|
|
|
|
|
|
|
|
|
|
namespace PKHeX.Drawing
|
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
|
|
|
|
{
|
2019-10-04 01:23:40 +00:00
|
|
|
|
index++; // start indexes at 1
|
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-10-03 03:11:17 +00:00
|
|
|
|
case 7 when !GG.Contains(version):
|
2019-02-10 04:05:32 +00:00
|
|
|
|
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
|
2019-10-04 01:23:40 +00:00
|
|
|
|
|
|
|
|
|
return wallpaperID switch
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
2019-10-04 01:23:40 +00:00
|
|
|
|
5 => true, // Volcano
|
|
|
|
|
13 => E == version, // PokéCenter
|
|
|
|
|
_ => false,
|
|
|
|
|
};
|
2017-03-09 05:50:34 +00:00
|
|
|
|
case 4:
|
2019-10-04 01:23:40 +00:00
|
|
|
|
return wallpaperID switch
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
2019-10-04 01:23:40 +00:00
|
|
|
|
5 => true, // Volcano
|
|
|
|
|
12 => true, // Checks
|
|
|
|
|
13 => true, // PokéCenter
|
|
|
|
|
22 => true, // Special
|
|
|
|
|
_ => false
|
|
|
|
|
};
|
2017-03-09 05:50:34 +00:00
|
|
|
|
case 5:
|
2019-10-04 01:23:40 +00:00
|
|
|
|
return wallpaperID switch
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
2019-10-04 01:23:40 +00:00
|
|
|
|
5 => true, // Volcano
|
|
|
|
|
12 => true, // Checks
|
|
|
|
|
19 => B2W2.Contains(version), // PWT
|
|
|
|
|
22 => B2W2.Contains(version), // Reshiram
|
|
|
|
|
21 => BW.Contains(version), // Zoroark
|
|
|
|
|
23 => BW.Contains(version), // Musical
|
|
|
|
|
_ => false
|
|
|
|
|
};
|
2017-03-09 05:50:34 +00:00
|
|
|
|
case 6:
|
|
|
|
|
case 7:
|
2019-10-04 01:23:40 +00:00
|
|
|
|
return wallpaperID switch
|
2017-03-09 05:50:34 +00:00
|
|
|
|
{
|
2019-10-04 01:23:40 +00:00
|
|
|
|
5 => true, // Volcano
|
|
|
|
|
12 => true, // PokéCenter
|
|
|
|
|
20 => true, // Special5 Flare/Magma
|
|
|
|
|
_ => false
|
|
|
|
|
};
|
2020-04-16 21:50:41 +00:00
|
|
|
|
case 8:
|
|
|
|
|
return wallpaperID switch
|
|
|
|
|
{
|
2020-04-16 22:07:04 +00:00
|
|
|
|
_ => true, // Bad contrast with lots of void space, better to just highlight the shiny red.
|
2020-04-16 21:50:41 +00:00
|
|
|
|
};
|
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
|
|
|
|
}
|
|
|
|
|
}
|