Exemple #1
0
        private void okButton_Click(object sender, EventArgs e)
        {
            List <Item> selection = items.GetSelection();

            foreach (Item item in selection)
            {
                if (item is SETItem)
                {
                    SETItem itemConv = (SETItem)item;

                    if (sonicCheckBox.Checked)
                    {
                        LevelData.AddSETItem(0, new SETItem(itemConv.GetBytes(), 0, items));
                    }

                    if (tailsCheckBox.Checked)
                    {
                        LevelData.AddSETItem(1, new SETItem(itemConv.GetBytes(), 0, items));
                    }

                    if (knucklesCheckBox.Checked)
                    {
                        LevelData.AddSETItem(2, new SETItem(itemConv.GetBytes(), 0, items));
                    }

                    if (amyCheckBox.Checked)
                    {
                        LevelData.AddSETItem(3, new SETItem(itemConv.GetBytes(), 0, items));
                    }

                    if (gammaCheckBox.Checked)
                    {
                        LevelData.AddSETItem(4, new SETItem(itemConv.GetBytes(), 0, items));
                    }

                    if (bigCheckBox.Checked)
                    {
                        LevelData.AddSETItem(5, new SETItem(itemConv.GetBytes(), 0, items));
                    }
                }
                else if (item is CAMItem)
                {
                    CAMItem itemConv = (CAMItem)item;

                    if ((sonicCheckBox.Checked) && (LevelData.CAMItems[0] != null))
                    {
                        LevelData.CAMItems[0].Add(new CAMItem(itemConv.GetBytes(), 0, items));
                    }

                    if (tailsCheckBox.Checked)
                    {
                        LevelData.CAMItems[1].Add(new CAMItem(itemConv.GetBytes(), 0, items));
                    }

                    if (knucklesCheckBox.Checked)
                    {
                        LevelData.CAMItems[2].Add(new CAMItem(itemConv.GetBytes(), 0, items));
                    }

                    if (amyCheckBox.Checked)
                    {
                        LevelData.CAMItems[3].Add(new CAMItem(itemConv.GetBytes(), 0, items));
                    }

                    if (gammaCheckBox.Checked)
                    {
                        LevelData.CAMItems[4].Add(new CAMItem(itemConv.GetBytes(), 0, items));
                    }

                    if (bigCheckBox.Checked)
                    {
                        LevelData.CAMItems[5].Add(new CAMItem(itemConv.GetBytes(), 0, items));
                    }
                }
            }

            Close();
        }