mirror of
https://github.com/kwsch/PKHeX
synced 2024-09-21 06:41:56 +00:00
Add Batch Editor => Shiny PID command
Also added Box/Slot filtering, for whatever reason is desired. Thanks /u/exegg for the suggestion!
This commit is contained in:
parent
654ff292e6
commit
cd909d5cc5
3 changed files with 7 additions and 0 deletions
|
@ -13,6 +13,8 @@ namespace PKHeX
|
|||
// Internal Attributes set on creation
|
||||
public byte[] Data; // Raw Storage
|
||||
public string Identifier; // User or Form Custom Attribute
|
||||
public int Box { get; set; } = -1; // Batch Editor
|
||||
public int Slot { get; set; } = -1; // Batch Editor
|
||||
|
||||
public byte[] EncryptedPartyData => Encrypt().Take(SIZE_PARTY).ToArray();
|
||||
public byte[] EncryptedBoxData => Encrypt().Take(SIZE_STORED).ToArray();
|
||||
|
|
|
@ -132,6 +132,8 @@ namespace PKHeX
|
|||
{
|
||||
data[i] = getStoredSlot(getBoxOffset(i/30) + SIZE_STORED*(i%30));
|
||||
data[i].Identifier = $"{getBoxName(i/30)}:{(i%30 + 1).ToString("00")}";
|
||||
data[i].Box = i/30 + 1;
|
||||
data[i].Slot = i%30 + 1;
|
||||
}
|
||||
return data;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ namespace PKHeX
|
|||
}
|
||||
|
||||
private const string CONST_RAND = "$rand";
|
||||
private const string CONST_SHINY = "$shiny";
|
||||
private int currentFormat = -1;
|
||||
private static readonly string[] pk6 = ReflectUtil.getPropertiesCanWritePublic(typeof(PK6)).OrderBy(i=>i).ToArray();
|
||||
private static readonly string[] pk5 = ReflectUtil.getPropertiesCanWritePublic(typeof(PK5)).OrderBy(i=>i).ToArray();
|
||||
|
@ -248,6 +249,8 @@ namespace PKHeX
|
|||
{
|
||||
if (cmd.PropertyValue == CONST_RAND && (cmd.PropertyName == "PID" || cmd.PropertyName == "EncryptionConstant"))
|
||||
ReflectUtil.SetValue(PKM, cmd.PropertyName, Util.rnd32().ToString());
|
||||
else if (cmd.PropertyValue == CONST_SHINY && cmd.PropertyName == "PID")
|
||||
PKM.setShinyPID();
|
||||
else
|
||||
ReflectUtil.SetValue(PKM, cmd.PropertyName, cmd.PropertyValue);
|
||||
|
||||
|
|
Loading…
Reference in a new issue