public bool Filter(EncounterMod encounterMod)
        {
            switch (encounterMod)
            {
            case EncounterMod.CuteCharmFemale:
                return(GenderCriteria != GenderCriteria.Male && GenderValue != 0 && GenderValue != 254);

            case EncounterMod.CuteCharm875M:
                return(GenderValue == 255 || GenderValue == 31);

            case EncounterMod.CuteCharm50M:
                return(GenderValue == 255 || GenderValue == 127);

            case EncounterMod.CuteCharm75M:
                return(GenderValue == 255 || GenderValue == 63);

            case EncounterMod.CuteCharm25M:
                return(GenderValue == 255 || GenderValue == 191);

            case EncounterMod.CuteCharm125F:
                return(GenderValue == 255 || GenderValue == 31);

            case EncounterMod.CuteCharm50F:
                return(GenderValue == 255 || GenderValue == 127);

            case EncounterMod.CuteCharm75F:
                return(GenderValue == 255 || GenderValue == 191);

            case EncounterMod.CuteCharm25F:
                return(GenderValue == 255 || GenderValue == 63);

            default:
                return(true);
            }
        }
Example #2
0
        public static string StringMod(EncounterMod encounterMod)
        {
            switch (encounterMod)
            {
            case EncounterMod.Synchronize:
                return(EncounterString(1));

            case EncounterMod.CuteCharm:
                return(EncounterString(2));

            case EncounterMod.SuctionCups:
                return(EncounterString(3));

            case EncounterMod.Compoundeyes:
                return(EncounterString(4));

            case EncounterMod.CuteCharm50M:
                return(EncounterString(2) + " (50% M)");

            case EncounterMod.CuteCharm75M:
                return(EncounterString(2) + " (75% M)");

            case EncounterMod.CuteCharm25M:
                return(EncounterString(2) + " (25% M)");

            case EncounterMod.CuteCharm875M:
                return(EncounterString(2) + " (87.5% M)");

            case EncounterMod.CuteCharm50F:
                return(EncounterString(2) + " (50% F)");

            case EncounterMod.CuteCharm75F:
                return(EncounterString(2) + " (75% F)");

            case EncounterMod.CuteCharm25F:
                return(EncounterString(2) + " (25% F)");

            case EncounterMod.CuteCharm125F:
                return(EncounterString(2) + " (12.5% F)");

            case EncounterMod.CuteCharmFemale:
                return(EncounterString(2) + " (Female)");

            case EncounterMod.Everstone:
                return(EncounterString(5));

            case EncounterMod.None:
                return(EncounterString(0));

            default:
                return("Unknown");
            }
        }
Example #3
0
 public static string StringMod(EncounterMod encounterMod)
 {
     switch (encounterMod)
     {
         case EncounterMod.Synchronize:
             return EncounterString(1);
         case EncounterMod.CuteCharm:
             return EncounterString(2);
         case EncounterMod.SuctionCups:
             return EncounterString(3);
         case EncounterMod.Compoundeyes:
             return EncounterString(4);
         case EncounterMod.CuteCharm50M:
             return EncounterString(2) + " (50% M)";
         case EncounterMod.CuteCharm75M:
             return EncounterString(2) + " (75% M)";
         case EncounterMod.CuteCharm25M:
             return EncounterString(2) + " (25% M)";
         case EncounterMod.CuteCharm875M:
             return EncounterString(2) + " (87.5% M)";
         case EncounterMod.CuteCharm50F:
             return EncounterString(2) + " (50% F)";
         case EncounterMod.CuteCharm75F:
             return EncounterString(2) + " (75% F)";
         case EncounterMod.CuteCharm25F:
             return EncounterString(2) + " (25% F)";
         case EncounterMod.CuteCharm125F:
             return EncounterString(2) + " (12.5% F)";
         case EncounterMod.CuteCharmFemale:
             return EncounterString(2) + " (Female)";
         case EncounterMod.Everstone:
             return EncounterString(5);
         case EncounterMod.None:
             return EncounterString(0);
         default:
             return "Unknown";
     }
 }
        public override bool ParseInput()
        {
            // passes each of the fields into a function to parse the input
            // also validates the ranges
            // min/max frame can be larger in the input box than the limit of a uint but it's low priority to fix that
            if (!(FormsFunctions.ParseInputD(searchParams.minFrame, out minFrame) &&
                  FormsFunctions.ParseInputD(searchParams.maxFrame, out maxFrame) &&
                  minFrame <= maxFrame &&
                  FormsFunctions.ParseInputD(searchParams.minHour, out minHour) &&
                  FormsFunctions.ParseInputD(searchParams.maxHour, out maxHour) &&
                  minHour <= maxHour && maxHour <= 23 &&
                  FormsFunctions.ParseInputD(searchParams.minMinute, out minMinute) &&
                  FormsFunctions.ParseInputD(searchParams.maxMinute, out maxMinute) &&
                  minMinute <= maxMinute && maxMinute <= 59))
            {
                return(false);
            }
            //parse the id/sid defaulting to 0
            FormsFunctions.ParseInputD(searchParams.id, out id);
            FormsFunctions.ParseInputD(searchParams.sid, out sid);

            // everything from here on should always be valid input
            seedDate = searchParams.date.Value;
            bool     shiny    = searchParams.isShiny.Checked;
            bool     synch    = searchParams.isSynch.Checked;
            IVFilter ivfilter = searchParams.ivfilters.IVFilter;

            List <int> encounterSlots = null;

            if (searchParams.encounterSlot.Text != "Any" && searchParams.encounterSlot.CheckBoxItems.Count > 0)
            {
                encounterSlots = new List <int>();
                for (int i = 0; i < searchParams.encounterSlot.CheckBoxItems.Count; i++)
                {
                    if (searchParams.encounterSlot.CheckBoxItems[i].Checked)
                    {
                        // We have to subtract 1 because this custom control contains a hidden item for text display
                        encounterSlots.Add(i - 1);
                    }
                }
            }

            List <uint> natures = null;

            if (searchParams.nature.Text != "Any" && searchParams.nature.CheckBoxItems.Count > 0)
            {
                natures =
                    (from t in searchParams.nature.CheckBoxItems
                     where t.Checked
                     select(uint) ((Nature)t.ComboBoxItem).Number).ToList();
            }

            frameCompare = new FrameCompare(ivfilter, natures,
                                            (int)((ComboBoxItem)searchParams.ability.SelectedItem).Reference, shiny,
                                            synch, false, encounterSlots,
                                            (GenderFilter)(searchParams.gender.SelectedItem));

            EncounterMod currentMod = synch ? EncounterMod.Synchronize : EncounterMod.None;

            generator = new FrameGenerator
            {
                FrameType =
                    (FrameType)((ComboBoxItem)searchParams.frameType.SelectedItem).Reference,
                EncounterMod = currentMod
            };
            if (currentMod == EncounterMod.Synchronize && natures == null)
            {
                generator.EncounterMod = EncounterMod.None;
            }

            generator.SynchNature = ((Nature)searchParams.synchNature.SelectedItem).Number;

            generator.EncounterType = EncounterTypeCalc.EncounterString(searchParams.encounterType.Text);

            return(true);
        }
Example #5
0
        private void comboBoxMethod_SelectedIndexChanged(object sender, EventArgs e)
        {
            string[] encounterMenu;
            string previousEncounter = "Wild Pokémon";
            if (comboBoxEncounterType.SelectedItem != null)
                previousEncounter = comboBoxEncounterType.SelectedItem.ToString();

            if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodK))
            {
                encounterMenu = new[]
                    {
                        "Wild Pokémon",
                        "Wild Pokémon (Surfing)",
                        "Wild Pokémon (Old Rod)",
                        "Wild Pokémon (Good Rod)",
                        "Wild Pokémon (Super Rod)",
                        "Stationary Pokémon",
                        "Bug-Catching Contest",
                        "Safari Zone",
                        "Headbutt"
                    };

                comboBoxEncounterType.DataSource = encounterMenu;
            }
            else if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH1) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH2) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH4) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodJ))
            {
                encounterMenu = new[]
                    {
                        "Wild Pokémon",
                        "Wild Pokémon (Surfing)",
                        "Wild Pokémon (Old Rod)",
                        "Wild Pokémon (Good Rod)",
                        "Wild Pokémon (Super Rod)",
                        "Stationary Pokémon",
                        "Safari Zone"
                    };

                comboBoxEncounterType.DataSource = encounterMenu;
            }
            else if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Natures))
            {
                encounterMenu = new[]
                    {
                        "Wild Pokémon",
                        "Wild Pokémon (Swarm)",
                        "Wild Pokémon (Surfing)",
                        "Wild Pokémon (Fishing)",
                        "Wild Pokémon (Shaking Grass)",
                        "Wild Pokémon (Bubble Spot)",
                        "Wild Pokémon (Cave Spot)",
                        "Stationary Pokémon",
                        "Roaming Pokémon",
                        "Gift Pokémon",
                        "Entralink Pokémon",
                        "Larvesta Egg",
                        "Hidden Grotto"
                    };

                comboBoxEncounterType.DataSource = encounterMenu;
            }
            else if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Standard) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5CGear))
            {
                encounterMenu = new[]
                    {
                        "Wild Pokémon",
                        "Stationary Pokémon",
                        "Roaming Pokémon",
                        "Gift Pokémon"
                    };

                comboBoxEncounterType.DataSource = encounterMenu;
            }
            else if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.WondercardIVs))
            {
                encounterMenu = new[]
                    {
                        "Normal Wondercard",
                        "Manaphy Egg"
                    };

                comboBoxEncounterType.DataSource = encounterMenu;
            }
            else
            {
                encounterMenu = new[]
                    {
                        "Wild Pokémon"
                    };
            }

            for (int i = 0; i < encounterMenu.Length; i++)
            {
                if (encounterMenu[i] == previousEncounter)
                {
                    comboBoxEncounterType.SelectedIndex = i;
                    break;
                }
            }

            if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.BWBred) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.BWBredInternational))
            {
                currentMod = EncounterMod.Everstone;
                buttonLead.Text = EncounterTypeCalc.StringMod(currentMod);
                buttonLead.FlatStyle = FlatStyle.Flat;
                buttonLead.TextAlign = ContentAlignment.MiddleRight;
                comboBoxSynchNatures.DataSource = Objects.Nature.NatureDropDownCollectionSynch();

                checkBoxDreamWorld.Enabled = true;
                checkBoxDittoParent.Enabled = true;
                cbNidoBeat.Enabled = true;
                cbShinyCharm.Enabled = true;
                comboBoxSynchNatures.Enabled = true;
                buttonLead.Enabled = true;
            }
            else if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH1) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH2) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH4) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodJ) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodK) ||
                     ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Natures))
            {
                if (currentMod == EncounterMod.Everstone)
                    currentMod = EncounterMod.Synchronize;

                buttonLead.Text = EncounterTypeCalc.StringMod(currentMod);
                buttonLead.FlatStyle = FlatStyle.Standard;
                buttonLead.TextAlign = ContentAlignment.MiddleCenter;
                checkBoxDreamWorld.Enabled = false;
                checkBoxDittoParent.Enabled = false;
                cbNidoBeat.Enabled = false;
                cbShinyCharm.Enabled = false;
                checkBoxDreamWorld.Checked = false;
                checkBoxDittoParent.Checked = false;
                cbNidoBeat.Checked = false;
                cbShinyCharm.Checked = false;
                comboBoxSynchNatures.Enabled = true;
                buttonLead.Enabled = true;
            }
            else
            {
                if (currentMod == EncounterMod.Everstone)
                {
                    currentMod = EncounterMod.Synchronize;
                    buttonLead.Text = EncounterTypeCalc.StringMod(currentMod);
                    buttonLead.FlatStyle = FlatStyle.Standard;
                    buttonLead.TextAlign = ContentAlignment.MiddleCenter;
                }

                checkBoxDreamWorld.Enabled = false;
                checkBoxDittoParent.Enabled = false;
                cbNidoBeat.Enabled = false;
                cbShinyCharm.Enabled = false;
                checkBoxDreamWorld.Checked = false;
                checkBoxDittoParent.Checked = false;
                cbNidoBeat.Checked = false;
                cbShinyCharm.Checked = false;

                comboBoxSynchNatures.Enabled = false;
                buttonLead.Enabled = false;
            }

            if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Standard) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Wondercard5thGen) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Wondercard5thGenFixed) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Natures) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.BWBred) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.BWBredInternational))
            {
                textBoxSeed.Mask = "AAAAAAAAAAAAAAAA";
                checkBoxBW2.Visible = true;
                checkBoxMemoryLink.Visible = true;
            }
            else
            {
                if (!textBoxSeed.Text.Equals("") && textBoxSeed.Text.Length > 8)
                {
                    textBoxSeed.Text = textBoxSeed.Text.Substring(0, textBoxSeed.Text.Length - 8);
                }
                textBoxSeed.Mask = "AAAAAAAA";
                checkBoxBW2.Visible = false;
                checkBoxMemoryLink.Visible = false;
            }

            if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Wondercard5thGen) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Wondercard5thGenFixed) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Natures) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.BWBred) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.BWBredInternational))
            {
                buttonCalcInitialFrame.Visible = true;
                checkBoxRoamerReleased.Visible = true;
                labelCalcWarning.Visible = true;
            }
            else
            {
                buttonCalcInitialFrame.Visible = false;
                checkBoxRoamerReleased.Visible = false;
                labelCalcWarning.Visible = false;
            }

            if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Natures) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Standard) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5CGear) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH1) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH2) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH4) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodJ) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodK) ||
                ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.WondercardIVs))
            {
                comboBoxEncounterType.Enabled = true;
            }
            else
            {
                comboBoxEncounterType.Enabled = false;
            }
        }
Example #6
0
        private void MainForm_Load(object sender, EventArgs e)
        {
            // Add smart comboBox items
            // Would be nice if we left these in the Designer file
            // But Visual Studio seems to like deleting them without warning
            comboBoxMethod.Items.AddRange(new object[]
                {
                    new ComboBoxItem("Method 1", FrameType.Method1),
                    new ComboBoxItem("Method 2 (Gen 3)", FrameType.Method2),
                    new ComboBoxItem("Method 4 (Gen 3)", FrameType.Method4),
                    new ComboBoxItem("Method H-1 (Gen 3)", FrameType.MethodH1),
                    new ComboBoxItem("Method H-2 (Gen 3)", FrameType.MethodH2),
                    new ComboBoxItem("Method H-4 (Gen 3)", FrameType.MethodH4),
                    new ComboBoxItem("Method J (DPPt)", FrameType.MethodJ),
                    new ComboBoxItem("Method K (HGSS)", FrameType.MethodK),
                    new ComboBoxItem("Gen 5 IVs (Standard Seed)",
                                     FrameType.Method5Standard),
                    new ComboBoxItem("Gen 5 IVs (C-Gear Seed)", FrameType.Method5CGear),
                    new ComboBoxItem("Gen 5 PIDRNG", FrameType.Method5Natures),
                    new ComboBoxItem("Chained Shiny", FrameType.ChainedShiny),
                    new ComboBoxItem("Gen 4 Egg PID (Normal)", FrameType.Gen4Normal),
                    new ComboBoxItem("Gen 4 Egg PID (International)",
                                     FrameType.Gen4International),
                    new ComboBoxItem("Breeding (Emerald No Splits)", FrameType.Bred),
                    new ComboBoxItem("Breeding (Emerald Splits)", FrameType.BredSplit),
                    new ComboBoxItem("Breeding (Emerald Alternate)",
                                     FrameType.BredAlternate),
                    new ComboBoxItem("Breeding (RSUpper No Splits)", FrameType.RSBredUpper)
                    ,
                    new ComboBoxItem("Breeding (RSUpper Splits)",
                                     FrameType.RSBredUpperSplit),
                    // removing alternate since it's untested
                    // new ComboBoxItem("Breeding (RSUpper Alternate)",
                    // FrameType.RSBredUpperAlt),
                    new ComboBoxItem("Breeding (DPPt)", FrameType.DPPtBred),
                    new ComboBoxItem("Breeding (HGSS)", FrameType.HGSSBred),
                    new ComboBoxItem("Breeding (BW)", FrameType.BWBred),
                    new ComboBoxItem("Breeding (BW, International)",
                                     FrameType.BWBredInternational),
                    new ComboBoxItem("Wondercard IVs (4th Gen)", FrameType.WondercardIVs),
                    new ComboBoxItem("Wondercard (5th Gen)", FrameType.Wondercard5thGen),
                    new ComboBoxItem("GLAN Wondercard (5th Gen)",
                                     FrameType.Wondercard5thGenFixed),
                    new ComboBoxItem("Colosseum\\XD", FrameType.ColoXD)
                });

            cuteCharm = new[]
                {
                    new ComboBoxItem("Male Lead (50% F Target)", -1),
                    new ComboBoxItem("Male Lead (75% F Target)", -2),
                    new ComboBoxItem("Male Lead (25% F Target)", -3),
                    new ComboBoxItem("Male Lead (12.5% F Target)", -4),
                    new ComboBoxItem("Female Lead (50% M Target)", 1),
                    new ComboBoxItem("Female Lead (75% M Target)", 2),
                    new ComboBoxItem("Female Lead (25% M Target)", 3),
                    new ComboBoxItem("Female Lead (87.5% M Target)", 4)
                };

            var ability = new[]
                {
                    new ComboBoxItem("Any", -1),
                    new ComboBoxItem("Ability 0", 0),
                    new ComboBoxItem("Ability 1", 1)
                };

            currentMod = EncounterMod.Synchronize;

            try
            {
                if (Settings.Default.CPUs == 0)
                    Settings.Default.CPUs = Environment.ProcessorCount;
            }
            catch (ConfigurationErrorsException ex)
            {
                string filename = ((ConfigurationException) ex.InnerException).Filename;

                File.Delete(filename);
                Settings.Default.Reload();

                MessageBox.Show(
                    "RNG Reporter has detected a corrupt configuration file, which has been deleted.  RNG Reporter must be restarted.");

                Process.GetCurrentProcess().Kill();
            }

            comboBoxNature.Items.AddRange(Objects.Nature.NatureDropDownCollectionSearchNatures());
            ChangeLanguage((Language) Settings.Default.Language);

            showToolTipsToolStripMenuItem.Checked = Settings.Default.ShowToolTips;

            comboBoxSynchNatures.DataSource = Objects.Nature.NatureDropDownCollectionSynch();
            comboBoxAbility.DataSource = ability;

            comboBoxGender.DataSource = GenderFilter.GenderFilterCollectionMain();

            Size = Settings.Default.MySize;
            Location = Settings.Default.MyLoc;
            WindowState = Settings.Default.MyState;

            comboBoxCPUCount.SelectedIndex = Settings.Default.CPUs - 1;
            comboBoxMethod.SelectedIndex = 0;
            comboBoxNature.SelectedIndex = 0;
            comboBoxAbility.SelectedIndex = 0;
            comboBoxGender.SelectedIndex = 0;

            comboBoxSynchNatures.SelectedIndex = 0;
            comboBoxEncounterType.SelectedIndex = 0;
            comboBoxEncounterSlot.SelectedIndex = 0;

            //  Set up the DoubleBufferedDataGridView to act as we would like it.
            dataGridViewValues.AutoGenerateColumns = false;
            PID.DefaultCellStyle.Format = "X8";

            /*
            RegistryKey registrySoftware = Registry.CurrentUser.OpenSubKey("Software", true);
            if (Settings.Default.LastVersion < VersionNumber && registrySoftware != null)
            {
                //load registry
                RegistryKey registryRngReporter = registrySoftware.OpenSubKey("RNGReporter");
                if (registryRngReporter != null)
                {
                    maskedTextBoxSID.Text = (string) registryRngReporter.GetValue("sid", "0");
                    maskedTextBoxID.Text = (string) registryRngReporter.GetValue("id", "0");

                    //int lastVersion = Convert.ToInt32(registryRngReporter.GetValue("lastVersion", 0));

                    if (Settings.Default.LastVersion < VersionNumber)
                    {
                        var donationBox = new DonationBox();
                        donationBox.ShowDialog();

                        Settings.Default.LastVersion = VersionNumber;
                        Settings.Default.Save();
                    }

                    //build profile and start it
                    ushort id, sid;
                    uint vcount, timer0, gxstat, vframe;
                    ulong mac;

                    ushort.TryParse(maskedTextBoxID.Text, out id);
                    ushort.TryParse(maskedTextBoxSID.Text, out sid);
                    uint.TryParse((string) registryRngReporter.GetValue("vcount"),
                                  NumberStyles.HexNumber, null, out vcount);
                    uint.TryParse((string) registryRngReporter.GetValue("timer0"),
                                  NumberStyles.HexNumber, null, out timer0);
                    uint.TryParse((string) registryRngReporter.GetValue("gxstat"),
                                  NumberStyles.HexNumber, null, out gxstat);
                    uint.TryParse((string) registryRngReporter.GetValue("vframe"),
                                  NumberStyles.HexNumber, null, out vframe);
                    ulong.TryParse((string) registryRngReporter.GetValue("mac_address"),
                                   NumberStyles.HexNumber, null, out mac);
                    //note: the tryparse should return a 0 value if it fales, remove the redundant ? operators
                    var profile = new Profile
                                      {
                                          ID = id,
                                          SID = sid,
                                          VCount = vcount,
                                          Timer0Min = timer0,
                                          GxStat = gxstat,
                                          VFrame = vframe,
                                          MAC_Address = mac
                                      };
                    MessageBox.Show(
                        "RNG Reporter now has a new profile manager.\r\nPlease save your information in a profile.");
                    Profiles.ProfileManager.AddProfile(profile);
                    if (!Profiles.ProfileManager.Visible)
                        Profiles.ProfileManager.Show();
                }
            }*/
            maskedTextBoxSID.Text = Settings.Default.SID;
            maskedTextBoxID.Text = Settings.Default.ID;

            if (Settings.Default.LastVersion < VersionNumber)
            {
                var donationBox = new DonationBox();
                donationBox.ShowDialog();
                Settings.Default.LastVersion = VersionNumber;
            }

            if (File.Exists(Settings.Default.ProfileLocation))
                Profiles.LoadProfiles(Settings.Default.ProfileLocation);
            // used for update checks, only do it once a day
            #if !DEBUG
            if ((DateTime.Now - Settings.Default.LastUpdate).Days > 0)
            {
                var checkUpdates = new Thread(CheckUpdates);
                checkUpdates.Start();
                Settings.Default.LastUpdate = DateTime.Now;
            }
            #endif
        }
Example #7
0
        private void buttonLead_Click(object sender, EventArgs e)
        {
            if (currentMod == EncounterMod.Synchronize)
            {
                currentMod = EncounterMod.CuteCharm;
                comboBoxSynchNatures.DataSource = cuteCharm;
            }
            else if (currentMod == EncounterMod.CuteCharm)
            {
                currentMod = EncounterMod.SuctionCups;
                comboBoxSynchNatures.DataSource = Objects.Nature.NatureDropDownCollectionSynch();
                comboBoxSynchNatures.Enabled = false;
            }
            else if (currentMod == EncounterMod.SuctionCups)
            {
                currentMod = EncounterMod.Synchronize;
                comboBoxSynchNatures.DataSource = Objects.Nature.NatureDropDownCollectionSynch();

                if (((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH1) ||
                    ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH2) ||
                    ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodH4) ||
                    ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodJ) ||
                    ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.MethodK) ||
                    ((ComboBoxItem) comboBoxMethod.SelectedItem).Reference.Equals(FrameType.Method5Natures))
                    comboBoxSynchNatures.Enabled = true;
                else
                    comboBoxSynchNatures.Enabled = false;
            }

            buttonLead.Text = EncounterTypeCalc.StringMod(currentMod);
        }
 public bool Filter(EncounterMod encounterMod)
 {
     switch (encounterMod)
     {
         case EncounterMod.CuteCharmFemale:
             return GenderCriteria != GenderCriteria.Male && GenderValue != 0 && GenderValue != 254;
         case EncounterMod.CuteCharm875M:
             return GenderValue == 255 || GenderValue == 31;
         case EncounterMod.CuteCharm50M:
             return GenderValue == 255 || GenderValue == 127;
         case EncounterMod.CuteCharm75M:
             return GenderValue == 255 || GenderValue == 63;
         case EncounterMod.CuteCharm25M:
             return GenderValue == 255 || GenderValue == 191;
         case EncounterMod.CuteCharm125F:
             return GenderValue == 255 || GenderValue == 31;
         case EncounterMod.CuteCharm50F:
             return GenderValue == 255 || GenderValue == 127;
         case EncounterMod.CuteCharm75F:
             return GenderValue == 255 || GenderValue == 191;
         case EncounterMod.CuteCharm25F:
             return GenderValue == 255 || GenderValue == 63;
         default:
             return true;
     }
 }