private void button1_Click(object sender, EventArgs e)
        {
            if (currentContentFolder.Equals(""))
            {
                MessageBox.Show("Please, first select the soundpool engine file (the '.cgbgi' file).");
                OpenFileDialog openBG = new OpenFileDialog();
                openBG.InitialDirectory = currentContentFolder;
                if (TBAGW.Game1.bIsDebug)
                {
                    openBG.Filter = "Sound engine file|*.cgbgic";
                }
                else
                {
                    openBG.Filter = "Sound engine file|*.cgbgi";
                }
                openBG.Title = "Load Sound File";

                if (TBAGW.Game1.bIsDebug)
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContent))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                    else
                    {
                        Console.WriteLine("Cheater");
                    }
                }
                else
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContentExtra) && !openBG.FileName.Contains(TBAGW.Game1.rootContent + @"Sounds"))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                }
            }
            else
            {
                MessageBox.Show("Please, first select the soundpool engine file (the '.cgbgi' file).");
                OpenFileDialog openBG = new OpenFileDialog();
                openBG.InitialDirectory = currentContentFolder;
                if (TBAGW.Game1.bIsDebug)
                {
                    openBG.Filter = "Sound engine file|*.cgbgic";
                }
                else
                {
                    openBG.Filter = "Sound engine file|*.cgbgi";
                }
                openBG.Title = "Load Sound File";

                if (TBAGW.Game1.bIsDebug)
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContent))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                    else
                    {
                        Console.WriteLine("Cheater");
                    }
                }
                else
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContentExtra) && !openBG.FileName.Contains(TBAGW.Game1.rootContent + @"Sounds"))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                }
            }

            textBox1.Text        = selectedBGI.songCollectionName;
            numericUpDown1.Value = selectedBGI.songCollectionID;
            listBox1.Items.Clear();
            listBox1.SelectedIndex = -1;
            foreach (var item in selectedBGI.songNames)
            {
                listBox1.Items.Add(item);
            }
        }
        private void button11_Click(object sender, EventArgs e)
        {
            if (currentContentFolder.Equals(""))
            {
                MessageBox.Show("Please, first select the soundpool engine file (the '.cgbgi' file).");
                OpenFileDialog openBG = new OpenFileDialog();
                openBG.InitialDirectory = currentContentFolder;
                if (TBAGW.Game1.bIsDebug)
                {
                    openBG.Filter = "Sound engine file|*.cgbgic";
                }
                else
                {
                    openBG.Filter = "Sound engine file|*.cgbgi";
                }
                openBG.Title = "Load Sound File";

                if (TBAGW.Game1.bIsDebug)
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContent))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                    else
                    {
                        Console.WriteLine("Cheater");
                    }
                }
                else
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContentExtra) && !openBG.FileName.Contains(TBAGW.Game1.rootContent + @"Sounds"))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                }
            }
            else
            {
                MessageBox.Show("Please, first select the soundpool engine file (the '.cgbgi' file).");
                OpenFileDialog openBG = new OpenFileDialog();
                openBG.InitialDirectory = currentContentFolder;
                if (TBAGW.Game1.bIsDebug)
                {
                    openBG.Filter = "Sound engine file|*.cgbgic";
                }
                else
                {
                    openBG.Filter = "Sound engine file|*.cgbgi";
                }
                openBG.Title = "Load Sound File";

                if (TBAGW.Game1.bIsDebug)
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContent))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                    else
                    {
                        Console.WriteLine("Cheater");
                    }
                }
                else
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContentExtra) && !openBG.FileName.Contains(TBAGW.Game1.rootContent + @"Sounds"))
                    {
                        selectedBGI = EditorFileWriter.BGReader(openBG.FileName);
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                }
            }


            if (!MapBuilder.parentMap.soundPools.Contains(selectedBGI))
            {
                MapBuilder.parentMap.soundPools.Add(selectedBGI);
                listBox3.Items.Add(selectedBGI);
            }
        }
        private void button9_Click(object sender, EventArgs e)
        {
            String engineLoc = "";
            String sbLoc     = "";
            String wbLoc     = "";

            {
                MessageBox.Show("Please, first select the soundpool engine file (the '.xgs' file).");
                OpenFileDialog openBG = new OpenFileDialog();
                openBG.InitialDirectory = currentContentFolder;
                if (TBAGW.Game1.bIsDebug)
                {
                    openBG.Filter = "Sound engine file|*.xgs";
                }
                else
                {
                    openBG.Filter = "Sound engine file|*.xgs";
                }
                openBG.Title = "Load Sound File";

                if (TBAGW.Game1.bIsDebug)
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContent) && !openBG.FileName.Contains(TBAGW.Game1.rootContent + @"Sounds"))
                    {
                        engineLoc = openBG.FileName.Replace(TBAGW.Game1.rootContent, "");
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                    else
                    {
                        Console.WriteLine("Cheater");
                    }
                }
                else
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContentExtra))
                    {
                        engineLoc = openBG.FileName.Replace(TBAGW.Game1.rootContent, "");
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                }
            }

            {
                MessageBox.Show("Please, first select the soundbank engine file (the '.xsb' file).");
                OpenFileDialog openBG = new OpenFileDialog();
                openBG.InitialDirectory = currentContentFolder;
                if (TBAGW.Game1.bIsDebug)
                {
                    openBG.Filter = "Sound engine file|*.xsb";
                }
                else
                {
                    openBG.Filter = "Sound engine file|*.xsb";
                }
                openBG.Title = "Load Sound File";

                if (TBAGW.Game1.bIsDebug)
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContent) && !openBG.FileName.Contains(TBAGW.Game1.rootContent + @"Sounds"))
                    {
                        sbLoc = openBG.FileName.Replace(TBAGW.Game1.rootContent, "");
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                    else
                    {
                        Console.WriteLine("Cheater");
                    }
                }
                else
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContentExtra))
                    {
                        sbLoc = openBG.FileName.Replace(TBAGW.Game1.rootContent, "");
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                }
            }

            {
                MessageBox.Show("Please, first select the WaveBank engine file (the '.xwb' file).");
                OpenFileDialog openBG = new OpenFileDialog();
                openBG.InitialDirectory = currentContentFolder;
                if (TBAGW.Game1.bIsDebug)
                {
                    openBG.Filter = "Sound engine file|*.xwb";
                }
                else
                {
                    openBG.Filter = "Sound engine file|*.xwb";
                }
                openBG.Title = "Load Sound File";

                if (TBAGW.Game1.bIsDebug)
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContent) && !openBG.FileName.Contains(TBAGW.Game1.rootContent + @"Sounds"))
                    {
                        wbLoc = openBG.FileName.Replace(TBAGW.Game1.rootContent, "");
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                    else
                    {
                        Console.WriteLine("Cheater");
                    }
                }
                else
                {
                    DialogResult dia = openBG.ShowDialog();
                    if (DialogResult.OK == dia && openBG.FileName.Contains(TBAGW.Game1.rootContentExtra))
                    {
                        wbLoc = openBG.FileName.Replace(TBAGW.Game1.rootContent, "");
                    }
                    else if (DialogResult.Cancel == dia)
                    {
                    }
                }
            }

            if (!engineLoc.Equals("") && !sbLoc.Equals("") && !wbLoc.Equals(""))
            {
                BGInfo tempBGI = new BGInfo();
                tempBGI.songELoc           = engineLoc;
                tempBGI.songSBLoc          = sbLoc;
                tempBGI.songWBLoc          = wbLoc;
                tempBGI.songCollectionName = engineLoc;
                selectedBGI = tempBGI;
                EditorFileWriter.BGWriter(tempBGI, Path.Combine(TBAGW.Game1.rootContent, currentContentFolder, tempBGI.songCollectionName));
                listBox1.Items.Clear();
                listBox1.SelectedIndex = -1;
                foreach (var item in tempBGI.songNames)
                {
                    listBox1.Items.Add(item);
                }
            }
        }