private void clickClone(object sender, EventArgs e)
{
if (getSlot(sender) > 30) return; // only perform action if cloning to boxes
if (!verifiedPKX()) { return; } // don't copy garbage to the box
byte[] pkxdata;
int box = CB_BoxSelect.SelectedIndex + 1; // get box we're cloning to
{
if (Util.Prompt(MessageBoxButtons.YesNo, String.Format("Clone Pokemon from Editing Tabs to all slots in Box {0}?", box)) == DialogResult.Yes)
{
pkxdata = preparepkx();
setPokedex(pkxdata);
}
else if (Util.Prompt(MessageBoxButtons.YesNo, String.Format("Delete Pokemon from all slots in Box {0}?", box)) == DialogResult.Yes)
pkxdata = new Byte[0xE8];
else
return; // abort clone/delete
}
byte[] ekxdata = PKX.encryptArray(pkxdata);
for (int i = 0; i < 30; i++) // write encrypted array to all box slots
Array.Copy(ekxdata, 0, savefile, getPKXOffset(i), 0xE8);
for (int i = 0; i < 30; i++)
getQuickFiller(getPictureBox(i), pkxdata);
savedited = true;
}
// Generic Subfunctions //