mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-10-01 22:16:42 -05:00
Allow SaveFile constructor to specify exportable state
Useful for partially-supported savefiles that can't be exported yet (Stadium)
This commit is contained in:
@@ -70,7 +70,7 @@ protected override PKM GetPKM(byte[] data)
|
||||
|
||||
public SAV1Stadium(byte[] data) : this(data, IsStadiumJ(data)) { }
|
||||
|
||||
public SAV1Stadium(byte[] data, bool japanese) : base(data)
|
||||
public SAV1Stadium(byte[] data, bool japanese) : base(data, false)
|
||||
{
|
||||
Japanese = japanese;
|
||||
Box = 0;
|
||||
@@ -113,7 +113,7 @@ public static bool IsStadiumU(byte[] data)
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
if (BitConverter.ToUInt32(data, 0x15A + (i * SAV1Stadium.TeamSizeU)) != 0x454B4F50) // POKE
|
||||
if (BitConverter.ToUInt32(data, 0x15A + (i * TeamSizeU)) != 0x454B4F50) // POKE
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
@@ -126,7 +126,7 @@ public static bool IsStadiumJ(byte[] data)
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
if (BitConverter.ToUInt32(data, 0x122 + (i * SAV1Stadium.TeamSizeJ)) != 0x454B4F50) // POKE
|
||||
if (BitConverter.ToUInt32(data, 0x122 + (i * TeamSizeJ)) != 0x454B4F50) // POKE
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -16,14 +16,14 @@ public abstract class SaveFile : ITrainerInfo, IGameValueLimit, IBoxDetailWallpa
|
||||
public readonly bool Exportable;
|
||||
public readonly byte[] BAK;
|
||||
|
||||
protected SaveFile(byte[] data, byte[] bak)
|
||||
protected SaveFile(byte[] data, byte[] bak, bool exportable = true)
|
||||
{
|
||||
Data = data;
|
||||
BAK = bak;
|
||||
Exportable = true;
|
||||
Exportable = exportable;
|
||||
}
|
||||
|
||||
protected SaveFile(byte[] data) : this(data, (byte[])data.Clone()) { }
|
||||
protected SaveFile(byte[] data, bool exportable = true) : this(data, (byte[])data.Clone(), exportable) { }
|
||||
|
||||
protected SaveFile()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user