private void GetComboBoxes() { CB_3DSReg.InitializeBinding(); CB_3DSReg.DataSource = GameInfo.Regions; CB_Language.InitializeBinding(); CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation); CB_Country.InitializeBinding(); CB_Region.InitializeBinding(); Main.SetCountrySubRegion(CB_Country, "countries"); var names = Enum.GetNames(typeof(TrainerSprite6)); var values = (int[])Enum.GetValues(typeof(TrainerSprite6)); var data = names.Zip(values, (a, b) => new ComboItem { Text = a, Value = b }) .Where(z => z.Value >= 2) // ignore Calem & Serena (no sprite) .ToList(); CB_MultiplayerSprite.InitializeBinding(); CB_MultiplayerSprite.DataSource = data; L_Vivillon.Text = GameInfo.Strings.specieslist[(int)Species.Vivillon] + ":"; CB_Vivillon.InitializeBinding(); CB_Vivillon.DataSource = PKX.GetFormList((int)Species.Vivillon, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, 6).ToList(); }
private void GetComboBoxes() { CB_3DSReg.InitializeBinding(); CB_3DSReg.DataSource = GameInfo.Regions; CB_Language.InitializeBinding(); CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation); CB_Country.InitializeBinding(); CB_Region.InitializeBinding(); Main.SetCountrySubRegion(CB_Country, "countries"); var names = Enum.GetNames(typeof(TrainerSprite6)); var values = (int[])Enum.GetValues(typeof(TrainerSprite6)); var data = names.Zip(values, (a, b) => new ComboItem(a, b)) .ToList(); if (SAV is not SAV6AO) { data.RemoveAll(z => z.Value > 36); } CB_MultiplayerSprite.InitializeBinding(); CB_MultiplayerSprite.DataSource = data; L_Vivillon.Text = GameInfo.Strings.specieslist[(int)Species.Vivillon] + ":"; CB_Vivillon.InitializeBinding(); CB_Vivillon.DataSource = FormConverter.GetFormList((int)Species.Vivillon, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, 6); }
private int SkipFlag => SAV.USUM ? 4160 : 3200; // FlagMax - 768 private void GetComboBoxes() { var dsregion_list = Util.GetUnsortedCBList("regions3ds"); var alolatime_list = new[] { new { Text = "Sun Time", Value = 24 * 60 * 60 } }; Array.Resize(ref alolatime_list, 24); for (int i = 1; i < 24; i++) { alolatime_list[i] = new { Text = $"+{i:00} Hours", Value = i * 60 * 60 } } ; alolatime_list[12] = new { Text = "Moon Time", Value = 12 * 60 * 60 }; CB_3DSReg.InitializeBinding(); CB_3DSReg.DataSource = dsregion_list; CB_Language.InitializeBinding(); CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation); CB_AlolaTime.InitializeBinding(); CB_AlolaTime.DataSource = alolatime_list; CB_Country.InitializeBinding(); CB_Region.InitializeBinding(); Main.SetCountrySubRegion(CB_Country, "countries"); CB_SkinColor.Items.Clear(); CB_SkinColor.Items.AddRange(Enum.GetNames(typeof(SkinColor7))); L_Vivillon.Text = GameInfo.Strings.Species[(int)Species.Vivillon] + ":"; CB_Vivillon.InitializeBinding(); CB_Vivillon.DataSource = PKX.GetFormList((int)Species.Vivillon, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, SAV.Generation).ToList(); if (!SAV.USUM) { BattleStyles.RemoveAt(BattleStyles.Count - 1); // remove Nihilist } foreach (string t in BattleStyles) { CB_BallThrowType.Items.Add(t); LB_BallThrowTypeUnlocked.Items.Add(t); LB_BallThrowTypeLearned.Items.Add(t); } var stamps = Enum.GetNames(typeof(Stamp7)).Select(z => z.Replace("_", " ")); foreach (string t in stamps) { LB_Stamps.Items.Add(t); } }
private void GetComboBoxes() { CB_3DSReg.InitializeBinding(); CB_3DSReg.DataSource = GameInfo.Regions; CB_Language.InitializeBinding(); CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation); CB_Country.InitializeBinding(); CB_Region.InitializeBinding(); Main.SetCountrySubRegion(CB_Country, "countries"); L_Vivillon.Text = GameInfo.Strings.Species[(int)Species.Vivillon] + ":"; // todo : did they replace this with the new multiform species? CB_Vivillon.InitializeBinding(); CB_Vivillon.DataSource = FormConverter.GetFormList((int)Species.Vivillon, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, SAV.Generation); }
private int SkipFlag => SAV is SAV7USUM ? 4160 : 3200; // FlagMax - 768 private void GetComboBoxes() { CB_3DSReg.InitializeBinding(); CB_3DSReg.DataSource = GameInfo.Regions; CB_Language.InitializeBinding(); CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation); CB_AlolaTime.InitializeBinding(); CB_AlolaTime.DataSource = GetAlolaTimeList(); CB_Country.InitializeBinding(); CB_Region.InitializeBinding(); Main.SetCountrySubRegion(CB_Country, "countries"); CB_SkinColor.Items.Clear(); CB_SkinColor.Items.AddRange(Enum.GetNames(typeof(SkinColor7))); L_Vivillon.Text = GameInfo.Strings.Species[(int)Species.Vivillon] + ":"; CB_Vivillon.InitializeBinding(); CB_Vivillon.DataSource = FormConverter.GetFormList((int)Species.Vivillon, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, SAV.Generation); if (!(SAV is SAV7USUM)) { BattleStyles.RemoveAt(BattleStyles.Count - 1); // remove Nihilist } foreach (string t in BattleStyles) { CB_BallThrowType.Items.Add(t); LB_BallThrowTypeUnlocked.Items.Add(t); LB_BallThrowTypeLearned.Items.Add(t); } var stamps = Enum.GetNames(typeof(Stamp7)).Select(z => z.Replace("_", " ")); foreach (string t in stamps) { LB_Stamps.Items.Add(t); } }
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 } }; CB_3DSReg.InitializeBinding(); CB_3DSReg.DataSource = dsregion_list; CB_Language.InitializeBinding(); CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation); CB_Country.InitializeBinding(); CB_Region.InitializeBinding(); 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 }, new { Text = "Pokécenter", Value = 0x80 }, new { Text = "Gift", Value = 0x81 }, }; CB_MultiplayerSprite.InitializeBinding(); CB_MultiplayerSprite.DataSource = oras_sprite_list; L_Vivillon.Text = GameInfo.Strings.specieslist[666] + ":"; CB_Vivillon.InitializeBinding(); CB_Vivillon.DataSource = PKX.GetFormList(666, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, 6).ToList(); }
public string[] parseTrainerData(SAVEditor C_SAV) { // Defaults string TID = "23456"; string SID = "34567"; string OT = "Archit"; string Gender = "M"; string Country = ""; string SubRegion = ""; string ConsoleRegion = ""; if (!System.IO.File.Exists(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\trainerdata.txt")) { return(new string[] { TID, SID, OT, Gender, Country, SubRegion, ConsoleRegion }); // Default No trainerdata.txt handling } string[] trainerdataLines = System.IO.File.ReadAllText(System.IO.Path.GetDirectoryName(Application.ExecutablePath) + "\\trainerdata.txt", System.Text.Encoding.UTF8) .Split(new string[] { Environment.NewLine }, StringSplitOptions.None); List <string> lstlines = trainerdataLines.OfType <string>().ToList(); int count = lstlines.Count; for (int i = 0; i < count; i++) { string item = lstlines[0]; if (item.TrimEnd() == "" || item.TrimEnd() == "auto") { continue; } string key = item.Split(':')[0].TrimEnd(); string value = item.Split(':')[1].TrimEnd(); lstlines.RemoveAt(0); if (key == "TID") { TID = value; } else if (key == "SID") { SID = value; } else if (key == "OT") { OT = value; } else if (key == "Gender") { Gender = value; } else if (key == "Country") { Country = value; } else if (key == "SubRegion") { SubRegion = value; } else if (key == "3DSRegion") { ConsoleRegion = value; } else { continue; } } // Automatic loading if (trainerdataLines[0] == "auto") { try { if (C_SAV.SAV.Gender == 1) { Gender = "F"; } return(new string[] { C_SAV.SAV.TID.ToString("00000"), C_SAV.SAV.SID.ToString("00000"), C_SAV.SAV.OT, Gender, CB_Country.GetItemText(CB_Country.Items[C_SAV.SAV.Country]), CB_SubRegion.GetItemText(CB_SubRegion.Items[C_SAV.SAV.SubRegion]), CB_3DSReg.GetItemText(CB_3DSReg.Items[C_SAV.SAV.ConsoleRegion]) }); } catch { return(new string[] { TID, SID, OT, Gender, Country, SubRegion, ConsoleRegion }); } } return(new string[] { TID, SID, OT, Gender, Country, SubRegion, ConsoleRegion }); }
private int skipFlag => SAV.USUM ? 4160 : 3200; // FlagMax - 768 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 alolatime_list = new[] { new { Text = "Sun Time", Value = 24 * 60 * 60 } }; Array.Resize(ref alolatime_list, 24); for (int i = 1; i < 24; i++) { alolatime_list[i] = new { Text = $"+{i:00} Hours", Value = i * 60 * 60 } } ; alolatime_list[12] = new { Text = "Moon Time", Value = 12 * 60 * 60 }; CB_3DSReg.InitializeBinding(); CB_3DSReg.DataSource = dsregion_list; CB_Language.InitializeBinding(); CB_Language.DataSource = GameInfo.LanguageDataSource(SAV.Generation); CB_AlolaTime.InitializeBinding(); CB_AlolaTime.DataSource = alolatime_list; CB_Country.InitializeBinding(); CB_Region.InitializeBinding(); Main.SetCountrySubRegion(CB_Country, "countries"); CB_SkinColor.Items.Clear(); string[] skinColors = { "Pale", "Default", "Tan", "Dark" }; foreach (string c in skinColors) { CB_SkinColor.Items.Add($"{Main.GenderSymbols[0]} - {c}"); // M CB_SkinColor.Items.Add($"{Main.GenderSymbols[1]} - {c}"); // F } L_Vivillon.Text = GameInfo.Strings.specieslist[666] + ":"; CB_Vivillon.InitializeBinding(); CB_Vivillon.DataSource = PKX.GetFormList(666, GameInfo.Strings.types, GameInfo.Strings.forms, Main.GenderSymbols, SAV.Generation).ToList(); var styles = new List <string>(BattleStyles); if (SAV.USUM) { styles.Add("Nihilist"); } foreach (string t in styles) { CB_BallThrowType.Items.Add(t); LB_BallThrowTypeUnlocked.Items.Add(t); LB_BallThrowTypeLearned.Items.Add(t); } foreach (string t in TrainerStampTitle) { LB_Stamps.Items.Add(t); } }