PKHeX/PKHeX.Drawing.Misc/Util/PlayerSpriteUtil.cs
Kurt aa968f56aa File scoped namespace for drawing projects
Extract color util to separate class as it's not entirely image related.
2021-12-10 00:15:04 -08:00

20 lines
516 B
C#

using System.Drawing;
using PKHeX.Core;
using PKHeX.Drawing.Misc.Properties;
namespace PKHeX.Drawing.Misc;
public static class PlayerSpriteUtil
{
public static Image? Sprite(this SaveFile sav) => GetSprite(sav);
private static Image? GetSprite(SaveFile sav)
{
if (sav is SAV6XY or SAV6AO)
{
string file = $"tr_{sav.MultiplayerSpriteID:00}";
return Resources.ResourceManager.GetObject(file) as Image ?? Resources.tr_00;
}
return null;
}
}