2021-11-27 23:48:08 +00:00
|
|
|
|
using System.Drawing;
|
|
|
|
|
using PKHeX.Core;
|
|
|
|
|
using PKHeX.Drawing.Misc.Properties;
|
|
|
|
|
|
2021-12-10 08:15:04 +00:00
|
|
|
|
namespace PKHeX.Drawing.Misc;
|
|
|
|
|
|
|
|
|
|
public static class PlayerSpriteUtil
|
2021-11-27 23:48:08 +00:00
|
|
|
|
{
|
2021-12-10 08:15:04 +00:00
|
|
|
|
public static Image? Sprite(this SaveFile sav) => GetSprite(sav);
|
2021-11-27 23:48:08 +00:00
|
|
|
|
|
2021-12-10 08:15:04 +00:00
|
|
|
|
private static Image? GetSprite(SaveFile sav)
|
|
|
|
|
{
|
2022-04-15 21:58:40 +00:00
|
|
|
|
if (sav is IMultiplayerSprite ms)
|
2021-11-27 23:48:08 +00:00
|
|
|
|
{
|
2022-04-15 21:58:40 +00:00
|
|
|
|
// Gen6 only
|
|
|
|
|
string file = $"tr_{ms.MultiplayerSpriteID:00}";
|
2021-12-10 08:15:04 +00:00
|
|
|
|
return Resources.ResourceManager.GetObject(file) as Image ?? Resources.tr_00;
|
2021-11-27 23:48:08 +00:00
|
|
|
|
}
|
2021-12-10 08:15:04 +00:00
|
|
|
|
return null;
|
2021-11-27 23:48:08 +00:00
|
|
|
|
}
|
|
|
|
|
}
|