mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-08-28 01:44:37 -05:00
Implement global settings for on-set methods
This makes it so that the program can turn off these methods for every instance unless the implemented method explicitly says otherwise. Nullable boolzzz
This commit is contained in:
27
Misc/SAV6.cs
27
Misc/SAV6.cs
@@ -13,6 +13,9 @@ public class BlockInfo
|
||||
}
|
||||
public class SAV6 : PKX
|
||||
{
|
||||
// Global Settings
|
||||
internal static bool SetUpdatePokedex = true;
|
||||
internal static bool SetUpdatePK6 = true;
|
||||
// Save Data Attributes
|
||||
public byte[] Data;
|
||||
public bool Exportable;
|
||||
@@ -307,41 +310,47 @@ public PK6 getPK6Stored(int offset)
|
||||
{
|
||||
return new PK6(decryptArray(getData(offset, PK6.SIZE_STORED)));
|
||||
}
|
||||
public void setPK6Party(PK6 pk6, int offset, bool trade = true)
|
||||
public void setPK6Party(PK6 pk6, int offset, bool? trade = null)
|
||||
{
|
||||
if (trade)
|
||||
if (SetUpdatePK6 || (trade ?? false))
|
||||
{
|
||||
// Apply to this Save File
|
||||
// pk6.Trade();
|
||||
// pk6.Write();
|
||||
}
|
||||
setPokeDex(pk6);
|
||||
if (SetUpdatePokedex)
|
||||
setPokeDex(pk6);
|
||||
|
||||
byte[] ek6 = encryptArray(pk6.Data);
|
||||
setData(ek6, offset);
|
||||
}
|
||||
public void setPK6Stored(PK6 pk6, int offset, bool trade = true)
|
||||
public void setPK6Stored(PK6 pk6, int offset, bool? trade = null)
|
||||
{
|
||||
if (trade)
|
||||
if (SetUpdatePK6 || (trade ?? false))
|
||||
{
|
||||
// Apply to this Save File
|
||||
// pk6.Trade();
|
||||
// pk6.Write();
|
||||
}
|
||||
setPokeDex(pk6);
|
||||
if (SetUpdatePokedex)
|
||||
setPokeDex(pk6);
|
||||
|
||||
byte[] ek6 = encryptArray(pk6.Data);
|
||||
Array.Resize(ref ek6, PK6.SIZE_STORED);
|
||||
setData(ek6, offset);
|
||||
}
|
||||
public void setEK6Stored(byte[] ek6, int offset, bool trade = true)
|
||||
public void setEK6Stored(byte[] ek6, int offset, bool? trade = null)
|
||||
{
|
||||
PK6 pk6 = new PK6(decryptArray(ek6));
|
||||
if (trade)
|
||||
if (SetUpdatePK6 || (trade ?? false))
|
||||
{
|
||||
// Apply to this Save File
|
||||
// pk6.Trade();
|
||||
// pk6.Write();
|
||||
}
|
||||
setPokeDex(pk6);
|
||||
if (SetUpdatePokedex)
|
||||
setPokeDex(pk6);
|
||||
|
||||
Array.Resize(ref ek6, PK6.SIZE_STORED);
|
||||
setData(ek6, offset);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user