From 21d2dbd993ab6f2d27c27b5770cae08bcebfe581 Mon Sep 17 00:00:00 2001 From: Mikhail Abramov Date: Tue, 3 Apr 2018 16:20:11 +0300 Subject: [PATCH] =?UTF-8?q?=D0=9A=D0=BB=D0=B8=D0=BA=20=D0=BD=D0=B0=20?= =?UTF-8?q?=D0=BA=D0=BD=D0=BE=D0=BF=D0=BA=D1=83=20(=D1=80=D0=B5=D0=B4?= =?UTF-8?q?=D0=B0=D0=BA=D1=82=D0=B8=D1=80=D0=BE=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D0=B5=20=D0=BF=D0=B5=D1=80=D1=81=D0=B0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../MainForm.Designer.cs | 251 +----------------- .../WindowsFormsApplication1/MainForm.cs | 195 ++++++++------ 2 files changed, 122 insertions(+), 324 deletions(-) diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs index cbd815b..8516e98 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.Designer.cs @@ -34,24 +34,6 @@ this.nazvanieTextBox = new System.Windows.Forms.TextBox(); this.panel1 = new System.Windows.Forms.Panel(); this.label13 = new System.Windows.Forms.Label(); - this.label12 = new System.Windows.Forms.Label(); - this.label11 = new System.Windows.Forms.Label(); - this.label10 = new System.Windows.Forms.Label(); - this.label9 = new System.Windows.Forms.Label(); - this.label8 = new System.Windows.Forms.Label(); - this.label7 = new System.Windows.Forms.Label(); - this.label6 = new System.Windows.Forms.Label(); - this.label4 = new System.Windows.Forms.Label(); - this.label5 = new System.Windows.Forms.Label(); - this.label3 = new System.Windows.Forms.Label(); - this.label2 = new System.Windows.Forms.Label(); - this.button4 = new System.Windows.Forms.Button(); - this.button3 = new System.Windows.Forms.Button(); - this.button2 = new System.Windows.Forms.Button(); - this.label1 = new System.Windows.Forms.Label(); - this.button6 = new System.Windows.Forms.Button(); - this.button5 = new System.Windows.Forms.Button(); - this.button1 = new System.Windows.Forms.Button(); this.PictureBoxBackground = new System.Windows.Forms.PictureBox(); this.LabelBackground = new System.Windows.Forms.Label(); this.dobavitFonButton = new System.Windows.Forms.Button(); @@ -93,7 +75,6 @@ this.LabelData.Size = new System.Drawing.Size(224, 23); this.LabelData.TabIndex = 0; this.LabelData.Text = "Данные о мултфильме:"; - //this.LabelData.Click += new System.EventHandler(this.label1_Click); // // LabelLengh // @@ -112,7 +93,6 @@ this.LabelName.Size = new System.Drawing.Size(60, 13); this.LabelName.TabIndex = 2; this.LabelName.Text = "Название:"; - //this.LabelName.Click += new System.EventHandler(this.label3_Click); // // nazvanieTextBox // @@ -120,29 +100,10 @@ this.nazvanieTextBox.Name = "nazvanieTextBox"; this.nazvanieTextBox.Size = new System.Drawing.Size(138, 20); this.nazvanieTextBox.TabIndex = 3; - //this.nazvanieTextBox.TextChanged += new System.EventHandler(this.nazvanieTextBox_TextChanged); // // panel1 // this.panel1.Controls.Add(this.label13); - this.panel1.Controls.Add(this.label12); - this.panel1.Controls.Add(this.label11); - this.panel1.Controls.Add(this.label10); - this.panel1.Controls.Add(this.label9); - this.panel1.Controls.Add(this.label8); - this.panel1.Controls.Add(this.label7); - this.panel1.Controls.Add(this.label6); - this.panel1.Controls.Add(this.label4); - this.panel1.Controls.Add(this.label5); - this.panel1.Controls.Add(this.label3); - this.panel1.Controls.Add(this.label2); - this.panel1.Controls.Add(this.button4); - this.panel1.Controls.Add(this.button3); - this.panel1.Controls.Add(this.button2); - this.panel1.Controls.Add(this.label1); - this.panel1.Controls.Add(this.button6); - this.panel1.Controls.Add(this.button5); - this.panel1.Controls.Add(this.button1); this.panel1.Controls.Add(this.PictureBoxBackground); this.panel1.Controls.Add(this.LabelBackground); this.panel1.Controls.Add(this.dobavitFonButton); @@ -153,7 +114,7 @@ this.panel1.Dock = System.Windows.Forms.DockStyle.Left; this.panel1.Location = new System.Drawing.Point(0, 0); this.panel1.Name = "panel1"; - this.panel1.Size = new System.Drawing.Size(282, 380); + this.panel1.Size = new System.Drawing.Size(297, 380); this.panel1.TabIndex = 4; // // label13 @@ -165,174 +126,6 @@ this.label13.TabIndex = 23; this.label13.Text = "ИНФОРМАЦИЯ О ПЕРСОНАЖАХ"; // - // label12 - // - this.label12.AutoSize = true; - this.label12.Location = new System.Drawing.Point(143, 308); - this.label12.Name = "label12"; - this.label12.Size = new System.Drawing.Size(39, 13); - this.label12.TabIndex = 22; - this.label12.Text = "номер"; - // - // label11 - // - this.label11.AutoSize = true; - this.label11.Location = new System.Drawing.Point(79, 308); - this.label11.Name = "label11"; - this.label11.Size = new System.Drawing.Size(39, 13); - this.label11.TabIndex = 22; - this.label11.Text = "время"; - // - // label10 - // - this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(9, 308); - this.label10.Name = "label10"; - this.label10.Size = new System.Drawing.Size(27, 13); - this.label10.TabIndex = 22; - this.label10.Text = "имя"; - // - // label9 - // - this.label9.AutoSize = true; - this.label9.Location = new System.Drawing.Point(143, 324); - this.label9.Name = "label9"; - this.label9.Size = new System.Drawing.Size(13, 13); - this.label9.TabIndex = 21; - this.label9.Text = "1"; - //this.label9.Click += new System.EventHandler(this.label7_Click); - // - // label8 - // - this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(143, 342); - this.label8.Name = "label8"; - this.label8.Size = new System.Drawing.Size(13, 13); - this.label8.TabIndex = 21; - this.label8.Text = "2"; - //this.label8.Click += new System.EventHandler(this.label7_Click); - // - // label7 - // - this.label7.AutoSize = true; - this.label7.Location = new System.Drawing.Point(143, 359); - this.label7.Name = "label7"; - this.label7.Size = new System.Drawing.Size(13, 13); - this.label7.TabIndex = 21; - this.label7.Text = "3"; - //this.label7.Click += new System.EventHandler(this.label7_Click); - // - // label6 - // - this.label6.AutoSize = true; - this.label6.Location = new System.Drawing.Point(61, 359); - this.label6.Name = "label6"; - this.label6.Size = new System.Drawing.Size(80, 13); - this.label6.TabIndex = 21; - this.label6.Text = "(2-12 секунды)"; - // - // label4 - // - this.label4.AutoSize = true; - this.label4.Location = new System.Drawing.Point(58, 342); - this.label4.Name = "label4"; - this.label4.Size = new System.Drawing.Size(80, 13); - this.label4.TabIndex = 21; - this.label4.Text = "(2-12 секунды)"; - // - // label5 - // - this.label5.AutoSize = true; - this.label5.Location = new System.Drawing.Point(6, 361); - this.label5.Name = "label5"; - this.label5.Size = new System.Drawing.Size(49, 13); - this.label5.TabIndex = 18; - this.label5.Text = "Котенок"; - //this.label5.Click += new System.EventHandler(this.label1_Click_1); - // - // label3 - // - this.label3.AutoSize = true; - this.label3.Location = new System.Drawing.Point(58, 324); - this.label3.Name = "label3"; - this.label3.Size = new System.Drawing.Size(80, 13); - this.label3.TabIndex = 21; - this.label3.Text = "(2-12 секунды)"; - // - // label2 - // - this.label2.AutoSize = true; - this.label2.Location = new System.Drawing.Point(6, 342); - this.label2.Name = "label2"; - this.label2.Size = new System.Drawing.Size(49, 13); - this.label2.TabIndex = 18; - this.label2.Text = "Котенок"; - //this.label2.Click += new System.EventHandler(this.label1_Click_1); - // - // button4 - // - this.button4.Location = new System.Drawing.Point(188, 356); - this.button4.Name = "button4"; - this.button4.Size = new System.Drawing.Size(26, 18); - this.button4.TabIndex = 19; - this.button4.Text = "X"; - this.button4.UseVisualStyleBackColor = true; - // - // button3 - // - this.button3.Location = new System.Drawing.Point(188, 339); - this.button3.Name = "button3"; - this.button3.Size = new System.Drawing.Size(26, 18); - this.button3.TabIndex = 19; - this.button3.Text = "X"; - this.button3.UseVisualStyleBackColor = true; - // - // button2 - // - this.button2.Location = new System.Drawing.Point(188, 319); - this.button2.Name = "button2"; - this.button2.Size = new System.Drawing.Size(26, 18); - this.button2.TabIndex = 19; - this.button2.Text = "X"; - this.button2.UseVisualStyleBackColor = true; - // - // label1 - // - this.label1.AutoSize = true; - this.label1.Location = new System.Drawing.Point(6, 324); - this.label1.Name = "label1"; - this.label1.Size = new System.Drawing.Size(49, 13); - this.label1.TabIndex = 18; - this.label1.Text = "Котенок"; - //this.label1.Click += new System.EventHandler(this.label1_Click_1); - // - // button6 - // - this.button6.Location = new System.Drawing.Point(259, 356); - this.button6.Name = "button6"; - this.button6.Size = new System.Drawing.Size(26, 18); - this.button6.TabIndex = 17; - this.button6.Text = "Р"; - this.button6.UseVisualStyleBackColor = true; - // - // button5 - // - this.button5.Location = new System.Drawing.Point(259, 339); - this.button5.Name = "button5"; - this.button5.Size = new System.Drawing.Size(26, 18); - this.button5.TabIndex = 17; - this.button5.Text = "Р"; - this.button5.UseVisualStyleBackColor = true; - // - // button1 - // - this.button1.Location = new System.Drawing.Point(259, 321); - this.button1.Name = "button1"; - this.button1.Size = new System.Drawing.Size(26, 18); - this.button1.TabIndex = 17; - this.button1.Text = "Р"; - this.button1.UseVisualStyleBackColor = true; - // // PictureBoxBackground // this.PictureBoxBackground.Location = new System.Drawing.Point(17, 160); @@ -362,7 +155,7 @@ // // splitter1 // - this.splitter1.Location = new System.Drawing.Point(282, 0); + this.splitter1.Location = new System.Drawing.Point(297, 0); this.splitter1.Name = "splitter1"; this.splitter1.Size = new System.Drawing.Size(3, 380); this.splitter1.TabIndex = 5; @@ -375,9 +168,9 @@ this.panel2.Controls.Add(this.SaveMultButton); this.panel2.Controls.Add(this.ButtonAddChar); this.panel2.Dock = System.Windows.Forms.DockStyle.Fill; - this.panel2.Location = new System.Drawing.Point(285, 0); + this.panel2.Location = new System.Drawing.Point(300, 0); this.panel2.Name = "panel2"; - this.panel2.Size = new System.Drawing.Size(392, 380); + this.panel2.Size = new System.Drawing.Size(377, 380); this.panel2.TabIndex = 6; // // SaveCharButton @@ -385,7 +178,7 @@ this.SaveCharButton.Dock = System.Windows.Forms.DockStyle.Bottom; this.SaveCharButton.Location = new System.Drawing.Point(0, 320); this.SaveCharButton.Name = "SaveCharButton"; - this.SaveCharButton.Size = new System.Drawing.Size(392, 30); + this.SaveCharButton.Size = new System.Drawing.Size(377, 30); this.SaveCharButton.TabIndex = 3; this.SaveCharButton.Text = "Сохранить персонажа"; this.SaveCharButton.UseVisualStyleBackColor = true; @@ -411,7 +204,7 @@ this.panel3.Dock = System.Windows.Forms.DockStyle.Fill; this.panel3.Location = new System.Drawing.Point(0, 26); this.panel3.Name = "panel3"; - this.panel3.Size = new System.Drawing.Size(392, 324); + this.panel3.Size = new System.Drawing.Size(377, 324); this.panel3.TabIndex = 2; this.panel3.Visible = false; // @@ -423,7 +216,6 @@ this.SpriteNumberLabel.Size = new System.Drawing.Size(119, 13); this.SpriteNumberLabel.TabIndex = 16; this.SpriteNumberLabel.Text = "Количество спрайтов:"; - //this.SpriteNumberLabel.Click += new System.EventHandler(this.label13_Click_1); // // SpriteNumberTextBox // @@ -441,6 +233,7 @@ this.OpenButton.Text = "Открыть персонажа"; this.OpenButton.UseVisualStyleBackColor = true; this.OpenButton.Click += new System.EventHandler(this.button5_Click); + this.OpenButton.MouseClick += new System.Windows.Forms.MouseEventHandler(this.OpenButton_MouseClick); // // AddPictureButton // @@ -450,7 +243,6 @@ this.AddPictureButton.TabIndex = 13; this.AddPictureButton.Text = "Добавить"; this.AddPictureButton.UseVisualStyleBackColor = true; - //this.AddPictureButton.Click += new System.EventHandler(this.button4_Click); // // LabelPic // @@ -478,7 +270,6 @@ this.LabelDef2.Size = new System.Drawing.Size(13, 13); this.LabelDef2.TabIndex = 10; this.LabelDef2.Text = "--"; - //this.LabelDef2.Click += new System.EventHandler(this.label10_Click); // // LabelDef1 // @@ -488,7 +279,6 @@ this.LabelDef1.Size = new System.Drawing.Size(13, 13); this.LabelDef1.TabIndex = 9; this.LabelDef1.Text = "--"; - //this.LabelDef1.Click += new System.EventHandler(this.label9_Click); // // LabelWalls // @@ -498,7 +288,6 @@ this.LabelWalls.Size = new System.Drawing.Size(107, 13); this.LabelWalls.TabIndex = 8; this.LabelWalls.Text = "Границы движения:"; - //this.LabelWalls.Click += new System.EventHandler(this.label8_Click); // // TextBoxTime1 // @@ -513,7 +302,6 @@ this.TextBoxTime2.Name = "TextBoxTime2"; this.TextBoxTime2.Size = new System.Drawing.Size(100, 20); this.TextBoxTime2.TabIndex = 4; - //this.TextBoxTime2.TextChanged += new System.EventHandler(this.textBox6_TextChanged); // // TextBoxWall2 // @@ -521,7 +309,6 @@ this.TextBoxWall2.Name = "TextBoxWall2"; this.TextBoxWall2.Size = new System.Drawing.Size(100, 20); this.TextBoxWall2.TabIndex = 3; - //this.TextBoxWall2.TextChanged += new System.EventHandler(this.TextBoxWall2_TextChanged); // // TextBoxWall1 // @@ -558,17 +345,18 @@ this.SaveMultButton.Dock = System.Windows.Forms.DockStyle.Bottom; this.SaveMultButton.Location = new System.Drawing.Point(0, 350); this.SaveMultButton.Name = "SaveMultButton"; - this.SaveMultButton.Size = new System.Drawing.Size(392, 30); + this.SaveMultButton.Size = new System.Drawing.Size(377, 30); this.SaveMultButton.TabIndex = 1; this.SaveMultButton.Text = "Сохранить мульт"; this.SaveMultButton.UseVisualStyleBackColor = true; + this.SaveMultButton.Click += new System.EventHandler(this.SaveMultButton_Click); // // ButtonAddChar // this.ButtonAddChar.Dock = System.Windows.Forms.DockStyle.Top; this.ButtonAddChar.Location = new System.Drawing.Point(0, 0); this.ButtonAddChar.Name = "ButtonAddChar"; - this.ButtonAddChar.Size = new System.Drawing.Size(392, 26); + this.ButtonAddChar.Size = new System.Drawing.Size(377, 26); this.ButtonAddChar.TabIndex = 0; this.ButtonAddChar.Text = "Добавить персонажа"; this.ButtonAddChar.UseVisualStyleBackColor = true; @@ -589,7 +377,6 @@ this.Name = "MainForm"; this.RightToLeftLayout = true; this.Text = "Свойства персонажа"; - //this.Load += new System.EventHandler(this.Form1_Load); this.panel1.ResumeLayout(false); this.panel1.PerformLayout(); ((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).EndInit(); @@ -633,25 +420,7 @@ private System.Windows.Forms.Label LabelBackground; private System.Windows.Forms.Button dobavitFonButton; private System.Windows.Forms.PictureBox PictureBoxBackground; - private System.Windows.Forms.Button button2; - private System.Windows.Forms.Button button1; - private System.Windows.Forms.Label label3; - private System.Windows.Forms.Label label1; - private System.Windows.Forms.Label label7; - private System.Windows.Forms.Label label6; - private System.Windows.Forms.Label label4; - private System.Windows.Forms.Label label5; - private System.Windows.Forms.Label label2; - private System.Windows.Forms.Label label12; - private System.Windows.Forms.Label label11; - private System.Windows.Forms.Label label10; - private System.Windows.Forms.Label label9; - private System.Windows.Forms.Label label8; private System.Windows.Forms.Label label13; - private System.Windows.Forms.Button button4; - private System.Windows.Forms.Button button3; - private System.Windows.Forms.Button button6; - private System.Windows.Forms.Button button5; } } diff --git a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs index 417324a..ab2eb9a 100644 --- a/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs +++ b/WindowsFormsApplication1/WindowsFormsApplication1/MainForm.cs @@ -18,6 +18,9 @@ namespace WindowsFormsApplication1 public Label l3; public Button b1; public Button b2; + + public int nomer; + public String coord; }; Person[] persons = new Person[200]; @@ -107,52 +110,53 @@ namespace WindowsFormsApplication1 private void SaveCharButtonClick(object sender, EventArgs e) { - if (saveFileDialog1.ShowDialog() == DialogResult.OK) - { - string filename = saveFileDialog1.FileName; + persons[nomerPersa].l1 = new Label(); + persons[nomerPersa].l1.Top = yPersa; + persons[nomerPersa].l1.Left = 30; + persons[nomerPersa].l1.Width = 20; + persons[nomerPersa].l1.Visible = true; + persons[nomerPersa].l1.Text = "1"; + this.panel1.Controls.Add(persons[nomerPersa].l1); - Files.CreateStruct(filename); - open_main(filename); + persons[nomerPersa].l2 = new Label(); + persons[nomerPersa].l2.Top = yPersa; + persons[nomerPersa].l2.Left = 60; + persons[nomerPersa].l2.Width = 60; + persons[nomerPersa].l2.Visible = true; + persons[nomerPersa].l2.Text = "Перс1"; + this.panel1.Controls.Add(persons[nomerPersa].l2); - if (ComboBoxMove.Text == "Прямо") - { - Sinus.CreatePerson(filename, "per", TextBoxWall1.Text); - old_place (filename, "per"); - Files.OpenWhile(filename); - go_pryamo(filename, "per"); - close_while(filename); - delete_pics(filename); - } - else if (ComboBoxMove.Text == "Волнами") - { - Sinus.CreatePerson(filename, "per", TextBoxWall1.Text); - Files.OpenWhile(filename); - Sinus.MovePerson(filename, "per"); - close_while(filename); - delete_pics2(filename, 5); - } - else if (ComboBoxMove.Text == "Кругами") - { - circle_create_person(filename, "per"); - Files.OpenWhile(filename); - circle(filename, "per"); - close_while(filename); - delete_pics(filename); - } + persons[nomerPersa].l3 = new Label(); + persons[nomerPersa].l3.Top = yPersa; + persons[nomerPersa].l3.Left = 120; + persons[nomerPersa].l3.Width = 40; + persons[nomerPersa].l3.Visible = true; + persons[nomerPersa].l3.Text = "ocphcghfgh"; + this.panel1.Controls.Add(persons[nomerPersa].l3); - Files.Ending(filename); + persons[nomerPersa].b1 = new Button(); + persons[nomerPersa].b1.Top = yPersa; + persons[nomerPersa].b1.Left = 170; + persons[nomerPersa].b1.Width = 50; + persons[nomerPersa].b1.Visible = true; + persons[nomerPersa].b1.Text = "R" + nomerPersa.ToString(); + persons[nomerPersa].b1.MouseClick += + new MouseEventHandler(this.button1_Click_2); + this.panel1.Controls.Add(persons[nomerPersa].b1); - //Add TXLib and pics - File.Copy(Path.Combine(Application.StartupPath, "TXLib.h"), filename.Replace(Path.GetFileName(filename), "TXLib.h"), true); - string adres_papki = filename.Replace(Path.GetFileName(filename), "Pictures"); - if (!Directory.Exists(adres_papki)) - { - Directory.CreateDirectory(adres_papki); - } - File.Copy(Path.Combine(Application.StartupPath, "kartinka.bmp"), adres_papki + "\\Personaj.bmp", true); + persons[nomerPersa].b2 = new Button(); + persons[nomerPersa].b2.Top = yPersa; + persons[nomerPersa].b2.Left = 230; + persons[nomerPersa].b2.Width = 50; + persons[nomerPersa].b2.Visible = true; + persons[nomerPersa].b2.Text = "X"; + this.panel1.Controls.Add(persons[nomerPersa].b2); - MessageBox.Show("Successfully"); - } + persons[nomerPersa].coord = TextBoxWall1.Text; + persons[nomerPersa].nomer = nomerPersa; + + nomerPersa++; + yPersa = yPersa + 30; } private void circle_create_person(string filename, string name) @@ -257,48 +261,6 @@ namespace WindowsFormsApplication1 private void button2_Click(object sender, EventArgs e) { - persons[nomerPersa].l1 = new Label(); - persons[nomerPersa].l1.Top = yPersa; - persons[nomerPersa].l1.Left = 30; - persons[nomerPersa].l1.Width = 20; - persons[nomerPersa].l1.Visible = true; - persons[nomerPersa].l1.Text = "1"; - this.panel1.Controls.Add(persons[nomerPersa].l1); - - persons[nomerPersa].l2 = new Label(); - persons[nomerPersa].l2.Top = yPersa; - persons[nomerPersa].l2.Left = 60; - persons[nomerPersa].l2.Width = 60; - persons[nomerPersa].l2.Visible = true; - persons[nomerPersa].l2.Text = "Перс1"; - this.panel1.Controls.Add(persons[nomerPersa].l2); - - persons[nomerPersa].l3 = new Label(); - persons[nomerPersa].l3.Top = yPersa; - persons[nomerPersa].l3.Left = 120; - persons[nomerPersa].l3.Width = 40; - persons[nomerPersa].l3.Visible = true; - persons[nomerPersa].l3.Text = "ocphcghfgh"; - this.panel1.Controls.Add(persons[nomerPersa].l3); - - persons[nomerPersa].b1 = new Button(); - persons[nomerPersa].b1.Top = yPersa; - persons[nomerPersa].b1.Left = 170; - persons[nomerPersa].b1.Width = 50; - persons[nomerPersa].b1.Visible = true; - persons[nomerPersa].b1.Text = "R"; - this.panel1.Controls.Add(persons[nomerPersa].b1); - - persons[nomerPersa].b2 = new Button(); - persons[nomerPersa].b2.Top = yPersa; - persons[nomerPersa].b2.Left = 230; - persons[nomerPersa].b2.Width = 50; - persons[nomerPersa].b2.Visible = true; - persons[nomerPersa].b2.Text = "X"; - this.panel1.Controls.Add(persons[nomerPersa].b2); - - nomerPersa++; - yPersa = yPersa + 30; } private void button3_Click(object sender, EventArgs e) @@ -314,5 +276,72 @@ namespace WindowsFormsApplication1 { } + + private void SaveMultButton_Click(object sender, EventArgs e) + { + + if (saveFileDialog1.ShowDialog() == DialogResult.OK) + { + string filename = saveFileDialog1.FileName; + + Files.CreateStruct(filename); + open_main(filename); + + if (ComboBoxMove.Text == "Прямо") + { + Sinus.CreatePerson(filename, "per", TextBoxWall1.Text); + old_place(filename, "per"); + Files.OpenWhile(filename); + go_pryamo(filename, "per"); + close_while(filename); + delete_pics(filename); + } + else if (ComboBoxMove.Text == "Волнами") + { + Sinus.CreatePerson(filename, "per", TextBoxWall1.Text); + Files.OpenWhile(filename); + Sinus.MovePerson(filename, "per"); + close_while(filename); + delete_pics2(filename, 5); + } + else if (ComboBoxMove.Text == "Кругами") + { + circle_create_person(filename, "per"); + Files.OpenWhile(filename); + circle(filename, "per"); + close_while(filename); + delete_pics(filename); + } + + Files.Ending(filename); + + //Add TXLib and pics + File.Copy(Path.Combine(Application.StartupPath, "TXLib.h"), filename.Replace(Path.GetFileName(filename), "TXLib.h"), true); + string adres_papki = filename.Replace(Path.GetFileName(filename), "Pictures"); + if (!Directory.Exists(adres_papki)) + { + Directory.CreateDirectory(adres_papki); + } + File.Copy(Path.Combine(Application.StartupPath, "kartinka.bmp"), adres_papki + "\\Personaj.bmp", true); + + MessageBox.Show("Successfully"); + } + } + + private void button1_Click_2(object sender, MouseEventArgs e) + { + for (int nomer = 0; nomer < nomerPersa; nomer++) + { + if (sender.Equals(persons[nomer].b1)) + { + TextBoxWall1.Text = persons[nomer].coord; + } + } + } + + private void OpenButton_MouseClick(object sender, MouseEventArgs e) + { + + } } }