private void updateSpecies(object sender, EventArgs e) { int species = Util.getIndex(CB_Species); Main.setForms(species, CB_Form); updateNickname(null, null); }
private void updateSpecies(object sender, EventArgs e) { // Get Forms for Given Species Main.setForms(Util.getIndex(CB_Species), CB_Form); // Check for Gender Changes // Get Gender Threshold int gt = PKX.Personal[Util.getIndex(CB_Species)].Gender; if (gt == 255) // Genderless { genderflag = 2; } else if (gt == 254) // Female Only { genderflag = 1; } else if (gt == 0) // Male Only { genderflag = 0; } setGenderLabel(); Main.setAbilityList(MT_AbilNo, Util.getIndex(CB_Species), CB_Ability, CB_Form); }
private void NUP_PartyIndex_ValueChanged(object sender, EventArgs e) { editing = false; int index = LB_DataEntry.SelectedIndex; int offset = index * 0x1B4 + (Convert.ToInt32(NUP_PartyIndex.Value) - 1) * 0x48; if (offset < 0) { return; } int species = BitConverter.ToUInt16(data, offset + 0x00); CB_Species.SelectedValue = species; int item = BitConverter.ToUInt16(data, offset + 0x02); CB_HeldItem.SelectedValue = item; int move1 = BitConverter.ToUInt16(data, offset + 0x04); int move2 = BitConverter.ToUInt16(data, offset + 0x06); int move3 = BitConverter.ToUInt16(data, offset + 0x08); int move4 = BitConverter.ToUInt16(data, offset + 0x0A); CB_Move1.SelectedValue = move1; CB_Move2.SelectedValue = move2; CB_Move3.SelectedValue = move3; CB_Move4.SelectedValue = move4; uint EC = BitConverter.ToUInt32(data, offset + 0xC); TB_EC.Text = EC.ToString("X8"); TB_TID.Text = BitConverter.ToUInt16(data, offset + 0x10).ToString("00000"); TB_SID.Text = BitConverter.ToUInt16(data, offset + 0x12).ToString("00000"); TB_Nickname.Text = Util.TrimFromZero(Encoding.Unicode.GetString(data, offset + 0x18, 22)); TB_OT.Text = Util.TrimFromZero(Encoding.Unicode.GetString(data, offset + 0x30, 22)); uint slgf = BitConverter.ToUInt32(data, offset + 0x14); uint form = slgf & 0x1F; uint gender = (slgf >> 5) & 3; // 0 M; 1 F; 2 G uint level = (slgf >> 7) & 0x7F; uint shiny = (slgf >> 14) & 0x1; uint nick = BitConverter.ToUInt16(data, offset + 0x16); CHK_Shiny.Checked = shiny == 1; TB_Level.Text = level.ToString("000"); CHK_Nicknamed.Checked = nick == 1; Main.setForms(species, CB_Form); CB_Form.SelectedIndex = (int)form; setGenderLabel((int)gender); updateNickname(sender, e); bpkx.Image = PKX.getSprite(species, (int)form, (int)gender, item, false, shiny == 1); editing = true; }
private void getComboBoxes() { var dsregion_list = new[] { new { Text = "NA/SA", Value = 1 }, new { Text = "EUR", Value = 2 }, new { Text = "JPN", Value = 0 }, new { Text = "CN", Value = 4 }, new { Text = "KOR", Value = 5 }, new { Text = "TW", Value = 6 } }; var language_list = new[] { new { Text = "ENG", Value = 2 }, new { Text = "JPN", Value = 1 }, new { Text = "FRE", Value = 3 }, new { Text = "ITA", Value = 4 }, new { Text = "GER", Value = 5 }, new { Text = "SPA", Value = 7 }, new { Text = "KOR", Value = 8 } }; CB_3DSReg.DisplayMember = "Text"; CB_3DSReg.ValueMember = "Value"; CB_3DSReg.DataSource = dsregion_list; CB_Language.DisplayMember = "Text"; CB_Language.ValueMember = "Value"; CB_Language.DataSource = language_list; CB_Country.DisplayMember = "Text"; CB_Country.ValueMember = "Value"; CB_Region.DisplayMember = "Text"; CB_Region.ValueMember = "Value"; Main.setCountrySubRegion(CB_Country, "countries"); var oras_sprite_list = new[] { //new { Text = "Calem", Value = 00 }, //new { Text = "Serena", Value = 01 }, new { Text = "Sycamore", Value = 02 }, new { Text = "Diantha", Value = 03 }, new { Text = "Wikstrom", Value = 04 }, new { Text = "Malva", Value = 05 }, new { Text = "Drasna", Value = 06 }, new { Text = "Siebold", Value = 07 }, new { Text = "Viola", Value = 08 }, new { Text = "Grant", Value = 09 }, new { Text = "Korrina", Value = 10 }, new { Text = "Ramos", Value = 11 }, new { Text = "Clemont", Value = 12 }, new { Text = "Valerie", Value = 13 }, new { Text = "Olympia", Value = 14 }, new { Text = "Wulfric", Value = 15 }, new { Text = "Youngster (XY)", Value = 16 }, //new { Text = "(None)", Value = 17 }, new { Text = "Lass (XY)", Value = 18 }, new { Text = "Lady (XY)", Value = 19 }, new { Text = "Schoolgirl (XY)", Value = 20 }, new { Text = "Battle Girl (XY)", Value = 21 }, new { Text = "Schoolboy (XY)", Value = 22 }, new { Text = "Rich Boy (XY)", Value = 23 }, new { Text = "Female Ace Trainer (XY)", Value = 24 }, //new { Text = "(None)", Value = 25 }, new { Text = "Female Ranger (XY)", Value = 26 }, new { Text = "Male Ace Trainer (XY)", Value = 27 }, new { Text = "Male Ranger (XY)", Value = 28 }, new { Text = "Madame", Value = 29 }, new { Text = "Monsieur", Value = 30 }, new { Text = "Black Belt (XY)", Value = 31 }, new { Text = "Male Punk (XY)", Value = 32 }, new { Text = "Fairy Tale Girl (XY)", Value = 33 }, new { Text = "Shauna", Value = 34 }, new { Text = "Tierno", Value = 35 }, new { Text = "Trevor", Value = 36 }, new { Text = "Brendan", Value = 37 }, new { Text = "May", Value = 38 }, //new { Text = "(None)", Value = 39 }, new { Text = "Hiker", Value = 40 }, new { Text = "Aroma Lady", Value = 41 }, new { Text = "Male Schoolkid", Value = 42 }, new { Text = "Female Schoolkid", Value = 43 }, new { Text = "Black Belt (ORAS)", Value = 44 }, new { Text = "Battle Girl (ORAS)", Value = 45 }, new { Text = "Pokemaniac (ORAS)", Value = 46 }, new { Text = "Fairy Tale Girl (ORAS)", Value = 47 }, new { Text = "Victor Winstrate", Value = 48 }, new { Text = "Victoria Winstrate", Value = 49 }, new { Text = "Male Ranger (ORAS)", Value = 50 }, new { Text = "Female Ranger (ORAS)", Value = 51 }, new { Text = "Male Swimmer (ORAS)", Value = 52 }, new { Text = "Hex Maniac", Value = 53 }, new { Text = "Male Ace Trainer (ORAS)", Value = 54 }, new { Text = "Female Ace Trainer (ORAS)", Value = 55 }, new { Text = "Street Thug", Value = 56 }, new { Text = "Delinquent", Value = 57 }, new { Text = "Male Expert", Value = 58 }, new { Text = "Female Expert", Value = 59 }, new { Text = "Lady (ORAS)", Value = 60 }, new { Text = "Rich Boy (ORAS)", Value = 61 }, new { Text = "Ninja Boy", Value = 62 }, new { Text = "Beauty (ORAS)", Value = 63 }, new { Text = "Guitarist", Value = 64 }, new { Text = "Lass (ORAS)", Value = 65 }, new { Text = "Male Breeder (ORAS)", Value = 66 }, new { Text = "Female Breeder (ORAS)", Value = 67 }, new { Text = "Camper", Value = 68 }, new { Text = "Picnicker", Value = 69 }, new { Text = "Wally", Value = 70 }, new { Text = "Steven", Value = 71 }, new { Text = "Maxie", Value = 72 }, new { Text = "Archie", Value = 73 }, }; CB_Multi.DisplayMember = "Text"; CB_Multi.ValueMember = "Value"; CB_Multi.DataSource = oras_sprite_list; L_Vivillon.Text = Main.specieslist[666] + ":"; Main.setForms(666, CB_Vivillon); }
private void loadFavPKM() { int index = currentpkm - 1; byte[] fpkm = new byte[0x34]; for (int i = 0; i < 0x34; i++) { fpkm[i] = pkmdata[index, i]; } uint ec = BitConverter.ToUInt32(fpkm, 0); // uint unk = BitConverter.ToUInt32(fpkm, 4); int spec = BitConverter.ToInt16(fpkm, 8); int item = BitConverter.ToInt16(fpkm, 0xA); // int abil = fpkm[0xC]; int abil_no = fpkm[0xD]; MT_AbilNo.Text = abil_no.ToString(); // 6 unknown bytes, contest? int nature = fpkm[0x14]; byte genform = fpkm[0x15]; genderflag = genform >> 1 & 0x3; setGenderLabel(); byte HP_EV = fpkm[0x16]; byte AT_EV = fpkm[0x17]; byte DE_EV = fpkm[0x18]; byte SA_EV = fpkm[0x19]; byte SD_EV = fpkm[0x1A]; byte SP_EV = fpkm[0x1B]; int move1 = BitConverter.ToInt16(fpkm, 0x1C); int move2 = BitConverter.ToInt16(fpkm, 0x1E); int move3 = BitConverter.ToInt16(fpkm, 0x20); int move4 = BitConverter.ToInt16(fpkm, 0x22); byte ppu1 = fpkm[0x24]; byte ppu2 = fpkm[0x25]; byte ppu3 = fpkm[0x26]; byte ppu4 = fpkm[0x27]; byte HP_IV = fpkm[0x28]; byte AT_IV = fpkm[0x29]; byte DE_IV = fpkm[0x2A]; byte SA_IV = fpkm[0x2B]; byte SD_IV = fpkm[0x2C]; byte SP_IV = fpkm[0x2D]; bool isshiny = (SP_IV & 0x40) > 0; SP_IV &= 0x1F; byte friendship = fpkm[0x2E]; int ball = fpkm[0x2F]; byte level = fpkm[0x30]; // Put data into fields. TB_EC.Text = ec.ToString("X8"); CB_Species.SelectedValue = spec; CB_HeldItem.SelectedValue = item; CB_Nature.SelectedValue = nature; CB_Ball.SelectedValue = ball; TB_HPIV.Text = HP_IV.ToString(); TB_ATKIV.Text = AT_IV.ToString(); TB_DEFIV.Text = DE_IV.ToString(); TB_SPAIV.Text = SA_IV.ToString(); TB_SPDIV.Text = SD_IV.ToString(); TB_SPEIV.Text = SP_IV.ToString(); TB_HPEV.Text = HP_EV.ToString(); TB_ATKEV.Text = AT_EV.ToString(); TB_DEFEV.Text = DE_EV.ToString(); TB_SPAEV.Text = SA_EV.ToString(); TB_SPDEV.Text = SD_EV.ToString(); TB_SPEEV.Text = SP_EV.ToString(); TB_Friendship.Text = friendship.ToString(); TB_Level.Text = level.ToString(); CB_Move1.SelectedValue = move1; CB_Move2.SelectedValue = move2; CB_Move3.SelectedValue = move3; CB_Move4.SelectedValue = move4; CB_PPu1.SelectedIndex = ppu1; CB_PPu2.SelectedIndex = ppu2; CB_PPu3.SelectedIndex = ppu3; CB_PPu4.SelectedIndex = ppu4; CHK_Shiny.Checked = isshiny; // Set Form Main.setForms(spec, CB_Form); int form = genform >> 3; CB_Form.SelectedIndex = form; // Set Ability Main.setAbilityList(MT_AbilNo, spec, CB_Ability, CB_Form); }