Ejemplo n.º 1
0
        private void readFile()
        {
            if (start)
            {
                return;
            }
            index   = CB_TrainerID.SelectedIndex;
            loading = true;

            if (index == 0)
            {
                return;
            }

            tabControl1.Enabled = true;
            byte[] trd = trdata[index];
            byte[] trp = trpoke[index];
            tr = new trdata6(trd, trp, Main.Config.ORAS);

            // Load Trainer Data
            CB_Trainer_Class.SelectedIndex = tr.Class;
            checkBox_Item.Checked          = tr.Item;
            checkBox_Moves.Checked         = tr.Moves;
            CB_Battle_Type.SelectedIndex   = tr.BattleType;
            CB_numPokemon.SelectedIndex    = tr.NumPokemon;
            CB_Item_1.SelectedIndex        = tr.Items[0];
            CB_Item_2.SelectedIndex        = tr.Items[1];
            CB_Item_3.SelectedIndex        = tr.Items[2];
            CB_Item_4.SelectedIndex        = tr.Items[3];
            CB_AI.SelectedIndex            = tr.AI;
            checkBox_Healer.Checked        = tr.Healer;
            CB_Money.SelectedIndex         = tr.Money;
            CB_Prize.SelectedIndex         = tr.Prize;

            // Load Pokemon Data
            for (int i = 0; i < tr.NumPokemon; i++)
            {
                trpk_IV[i].SelectedIndex  = tr.Team[i].IVs;
                trpk_lvl[i].SelectedIndex = tr.Team[i].Level;
                trpk_pkm[i].SelectedIndex = tr.Team[i].Species;
                FormUtil.setForms(tr.Team[i].Species, trpk_form[i], AltForms);
                trpk_form[i].SelectedIndex = tr.Team[i].Form % trpk_form[i].Items.Count; // stupid X/Y buggy edge cases (220 / 222)
                refreshPKMSlotAbility(i);                                                // Repopulate Abilities

                trpk_abil[i].SelectedIndex   = tr.Team[i].Ability;
                trpk_gender[i].SelectedIndex = tr.Team[i].Gender;

                trpk_item[i].SelectedIndex = tr.Team[i].Item;
                trpk_m1[i].SelectedIndex   = tr.Team[i].Moves[0];
                trpk_m2[i].SelectedIndex   = tr.Team[i].Moves[1];
                trpk_m3[i].SelectedIndex   = tr.Team[i].Moves[2];
                trpk_m4[i].SelectedIndex   = tr.Team[i].Moves[3];
            }
            loading = false;
            changeTrainerType(null, null); // Prompt cleaning update of PKM fields

            // Refresh Team View
            if (!loading)
            {
                for (int i = 0; i < 6; i++)
                {
                    showTeams(i);
                }
                // showText(); // Commented out for now, have to figure out how text is assigned.
            }
        }