Esempio n. 1
0
        private void setPokemon()
        {
            if (pkEntry < 0 || dumping) return;

            // Each File is 16 Bytes.
            Maison.Pokemon pkm = new Maison.Pokemon(File.ReadAllBytes(pkFiles[pkEntry]))
            {
                Species = (ushort) CB_Species.SelectedIndex,
                HP = CHK_HP.Checked,
                ATK = CHK_ATK.Checked,
                DEF = CHK_DEF.Checked,
                SPE = CHK_Spe.Checked,
                SPA = CHK_SpA.Checked,
                SPD = CHK_SpD.Checked,
                Nature = (byte) CB_Nature.SelectedIndex,
                Item = (ushort) CB_Item.SelectedIndex
            };
            pkm.Moves[0] = (ushort)CB_Move1.SelectedIndex;
            pkm.Moves[1] = (ushort)CB_Move2.SelectedIndex;
            pkm.Moves[2] = (ushort)CB_Move3.SelectedIndex;
            pkm.Moves[3] = (ushort)CB_Move4.SelectedIndex;

            byte[] data = pkm.Write();
            File.WriteAllBytes(pkFiles[pkEntry], data);
        }
Esempio n. 2
0
        private void getPokemon()
        {
            if (pkEntry < 0 || dumping) return;
            Maison.Pokemon pkm = new Maison.Pokemon(File.ReadAllBytes(pkFiles[pkEntry]));

            // Get
            CB_Move1.SelectedIndex = pkm.Moves[0];
            CB_Move2.SelectedIndex = pkm.Moves[1];
            CB_Move3.SelectedIndex = pkm.Moves[2];
            CB_Move4.SelectedIndex = pkm.Moves[3];
            CHK_HP.Checked = pkm.HP;
            CHK_ATK.Checked = pkm.ATK;
            CHK_DEF.Checked = pkm.DEF;
            CHK_Spe.Checked = pkm.SPE;
            CHK_SpA.Checked = pkm.SPA;
            CHK_SpD.Checked = pkm.SPD;
            CB_Nature.SelectedIndex = pkm.Nature;
            CB_Item.SelectedIndex = pkm.Item;

            CB_Species.SelectedIndex = pkm.Species; // Loaded last in order to refresh the sprite with all info.
            // Last 2 Bytes are unused.
        }