-
-
Notifications
You must be signed in to change notification settings - Fork 27
/
InitUtil.cs
36 lines (32 loc) · 936 Bytes
/
InitUtil.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#if NETFRAMEWORK
using PKHeX.Core;
using PKHeX.Drawing.PokeSprite;
namespace SysBot.Pokemon.WinForms
{
public static class InitUtil
{
public static void InitializeStubs(ProgramMode mode)
{
if (mode is ProgramMode.SCVI)
return;
SaveFile sav8 = mode switch
{
ProgramMode.SWSH => new SAV8SWSH(),
ProgramMode.BDSP => new SAV8BS(),
ProgramMode.LA => new SAV8LA(),
_ => throw new System.ArgumentOutOfRangeException(nameof(mode)),
};
SetUpSpriteCreator(sav8);
}
private static void SetUpSpriteCreator(SaveFile sav)
{
SpriteUtil.Initialize(sav);
StreamSettings.CreateSpriteFile = (pk, fn) =>
{
var png = pk.Sprite();
png.Save(fn);
};
}
}
}
#endif