private void button8_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1)
            {
                BaseItem bi = (BaseItem)listBox1.SelectedItem;
                if (bi.itemTexLoc.Equals(""))
                {
                    MessageBox.Show("Please select base texture file.");
                    OpenFileDialog openTex = new OpenFileDialog();
                    openTex.Title = "Open texture file";
                    if (Game1.bIsDebug)
                    {
                        openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg;*.xnb";
                        openTex.InitialDirectory = Game1.rootContent;
                    }
                    else
                    {
                        openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg";
                        openTex.InitialDirectory = Game1.rootContentExtra;
                    }

                    bool bDone = false;

                    while (!bDone)
                    {
                        DialogResult dia = openTex.ShowDialog();
                        if (dia == DialogResult.OK && openTex.FileName.Contains(openTex.InitialDirectory))
                        {
                            bi.itemTexLoc = openTex.FileName.Replace(Game1.rootContent, "").Substring(0, openTex.FileName.Replace(Game1.rootContent, "").LastIndexOf("."));
                            Console.WriteLine("Successful item texture selection");
                            bDone = true;
                        }
                        else if (!openTex.FileName.Contains(openTex.InitialDirectory))
                        {
                            MessageBox.Show(@"Please select a file within the application folder under Content\Mods and it's subfolders");
                        }
                        else if (dia == DialogResult.Cancel)
                        {
                            bDone = true;
                        }
                    }
                }

                try
                {
                    bi.ReloadTexture();
                    FrameSelector.StartComplex(bi.itemTexAndAnimation, (int)frameWidth.Value, (int)frameHeight.Value, (int)xOffSet.Value, (int)yOffSet.Value);
                }
                catch
                {
                    throw;
                }
            }
        }
        private void button7_Click(object sender, EventArgs e)
        {
            if (listBox1.SelectedIndex != -1)
            {
                ParticleSystemSource ba = (ParticleSystemSource)listBox1.SelectedItem;
                if (ba.particleTexSource.Equals(""))
                {
                    MessageBox.Show("Please select base texture file.");
                    OpenFileDialog openTex = new OpenFileDialog();
                    openTex.Title = "Open texture file";
                    if (Game1.bIsDebug)
                    {
                        openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg;*.xnb";
                        openTex.InitialDirectory = Game1.rootContent;
                    }
                    else
                    {
                        openTex.Filter           = "Texture File|*.jpg;*.png;*.jpeg";
                        openTex.InitialDirectory = Game1.rootContentExtra;
                    }

                    bool bDone = false;

                    while (!bDone)
                    {
                        DialogResult dia = openTex.ShowDialog();
                        if (dia == DialogResult.OK && openTex.FileName.Contains(openTex.InitialDirectory))
                        {
                            ba.particleTexSource = openTex.FileName.Replace(Game1.rootContent, "").Substring(0, openTex.FileName.Replace(Game1.rootContent, "").LastIndexOf("."));
                            Console.WriteLine("Successful item texture selection");
                            bDone = true;
                        }
                        else if (!openTex.FileName.Contains(openTex.InitialDirectory))
                        {
                            MessageBox.Show(@"Please select a file within the application folder under Content\Mods and it's subfolders");
                        }
                        else if (dia == DialogResult.Cancel)
                        {
                            bDone = true;
                        }
                    }
                }

                try
                {
                    ba.ReloadTextures();
                    FrameSelector.StartComplex(ba.particleTex, ba.particleFrames, (int)numericUpDown2.Value, (int)numericUpDown1.Value, (int)numericUpDown4.Value, (int)numericUpDown3.Value);
                }
                catch
                {
                    throw;
                }
            }
        }