public void PopulateData(byte[] InputData, int savindex) { SaveData = new byte[InputData.Length]; Array.Copy(InputData, SaveData, InputData.Length); PokemonList PL = new PokemonList(); SaveGames.SaveStruct SaveGame = new SaveGames.SaveStruct("XY"); if (savindex > 1) { savindex = 0; } for (int BoxNum = 0; BoxNum < 31; BoxNum++) { int boxoffset = 0x27A00 + 0x7F000 * savindex + BoxNum * (0xE8 * 30); for (int SlotNum = 0; SlotNum < 30; SlotNum++) { int offset = boxoffset + 0xE8 * SlotNum; byte[] slotdata = new Byte[0xE8]; Array.Copy(SaveData, offset, slotdata, 0, 0xE8); byte[] dslotdata = PKX.decryptArray(slotdata); PKX pkm = new PKX(dslotdata); if ((pkm.EC == "00000000") && (pkm.Species == "---")) { continue; } PL.Add(pkm); } } dgData.DataSource = PL; dgData.AutoGenerateColumns = true; }
public CodeGenerator(Form1 frm1) { m_parent = frm1; InitializeComponent(); this.CenterToParent(); RTB_Code.Clear(); TB_Write.Clear(); SaveGame = m_parent.SaveGame; CB_Box.Items.Clear(); for (int i = 1; i <= 31; i++) { CB_Box.Items.Add(i.ToString()); } CB_Source.SelectedIndex = 0; CB_Slot.SelectedIndex = 0; CB_Box.SelectedIndex = 0; }