Пример #1
0
 void EditObject(int id)
 {
     if (ObjectsData[id] != null)
     {
         string[] objdata = ObjectsData[id].Split(' ');
         bool     edit    = false;
         if (objdata[0] == "Camera")
         {
             Camera editcamera = new Camera();
             editcamera.textBox1.Text        = objdata[1];
             editcamera.checkBox1.Checked    = Convert.ToBoolean(objdata[2]);
             editcamera.textBox2.Text        = objdata[3];
             editcamera.textBox3.Text        = objdata[4];
             editcamera.textBox4.Text        = objdata[5];
             editcamera.textBox5.Text        = objdata[6];
             editcamera.textBox6.Text        = objdata[7];
             editcamera.textBox7.Text        = objdata[8];
             editcamera.numericUpDown1.Value = Convert.ToDecimal(objdata[9]);
             for (int i = 0; i < objdata.Length - 9; i++)
             {
                 editcamera.OBJR += objdata[9 + i] + " ";
             }
             if (editcamera.ShowDialog() == DialogResult.OK)
             {
                 edit = true;
             }
         }
         if (objdata[0] == "SkyColor")
         {
             Skycolor editskycolor = new Skycolor();
             editskycolor.textBox1.Text     = objdata[1];
             editskycolor.checkBox1.Checked = Convert.ToBoolean(objdata[2]);
             editskycolor.textBox2.Text     = objdata[3];
             editskycolor.textBox3.Text     = objdata[4];
             editskycolor.textBox4.Text     = objdata[5];
             if (editskycolor.ShowDialog() == DialogResult.OK)
             {
                 edit = true;
             }
         }
         if (objdata[0] == "EOL")
         {
             EOL eol = new EOL();
             eol.textBox1.Text     = objdata[1];
             eol.checkBox1.Checked = Convert.ToBoolean(objdata[2]);
             eol.type = Convert.ToInt32(objdata[3]);
             eol.SelectType();
             eol.textBox2.Text = objdata[4];
             eol.textBox3.Text = objdata[5];
             eol.textBox4.Text = objdata[6];
             eol.textBox7.Text = objdata[7];
             eol.textBox6.Text = objdata[8];
             eol.textBox5.Text = objdata[9];
             if (eol.ShowDialog() == DialogResult.OK)
             {
                 edit = true;
             }
         }
         if (objdata[0] == "Skinmesh")
         {
             Skinmesh skinmesh = new Skinmesh();
             skinmesh.textBox1.Text               = objdata[1];
             skinmesh.checkBox1.Checked           = Convert.ToBoolean(objdata[2]);
             skinmesh.textBox2.Text               = objdata[3];
             skinmesh.textBox3.Text               = objdata[4];
             skinmesh.textBox4.Text               = objdata[5];
             skinmesh.textBox5.Text               = objdata[6];
             skinmesh.textBox6.Text               = objdata[7];
             skinmesh.textBox7.Text               = objdata[8];
             skinmesh.domainUpDown1.SelectedIndex = Convert.ToInt32(objdata[9]);
             skinmesh.textBox8.Text               = "";
             for (int i = 10; i < objdata.Length; i++)
             {
                 skinmesh.textBox8.Text += objdata[i] + " ";
             }
             if (skinmesh.ShowDialog() == DialogResult.OK)
             {
                 edit = true;
             }
         }
         if (objdata[0] == "TextPrint")
         {
             TextPrint textPrint = new TextPrint();
             textPrint.textBox1.Text     = objdata[1];
             textPrint.textBox2.Text     = "";
             textPrint.checkBox1.Checked = Convert.ToBoolean(objdata[2]);
             textPrint.textBox3.Text     = objdata[3];
             textPrint.textBox4.Text     = objdata[4];
             textPrint.Colour            = System.Drawing.Color.FromArgb(Convert.ToInt16(objdata[5]),
                                                                         Convert.ToInt16(objdata[6]), Convert.ToInt16(objdata[7]));
             for (int i = 8; i < objdata.Length; i++)
             {
                 textPrint.textBox2.Text += objdata[i] + " ";
             }
             if (textPrint.ShowDialog() == DialogResult.OK)
             {
                 edit = true;
             }
         }
         if (objdata[0] == "Fog")
         {
             Fog fog = new Fog();
             fog.textBox1.Text     = objdata[1];
             fog.checkBox1.Checked = Convert.ToBoolean(objdata[2]);
             fog.textBox2.Text     = objdata[3];
             fog.textBox3.Text     = objdata[4];
             fog.textBox4.Text     = objdata[5];
             fog.textBox5.Text     = objdata[6];
             fog.textBox6.Text     = objdata[7];
             if (fog.ShowDialog() == DialogResult.OK)
             {
                 edit = true;
             }
         }
         if (edit)
         {
             ObjectsData[id] = LastObj;
             LastObj         = "";
         }
         ObjectsBoxItems();
     }
 }