Merge branch 'master' into ArkLightning-patch-1

This commit is contained in:
Mikhail Abramov 2018-04-03 18:41:53 +03:00 committed by GitHub
commit 5abc49dcb1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 121 additions and 283 deletions

View file

@ -1,4 +1,4 @@
namespace WindowsFormsApplication1
namespace WindowsFormsApplication1
{
partial class MainForm
{
@ -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();
@ -121,24 +103,6 @@
// 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);
@ -149,7 +113,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
@ -187,142 +151,6 @@
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";
//
// 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";
//
// 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";
//
// 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 = "Котенок";
//
// 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 = "Котенок";
//
// 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 = "Котенок";
//
// 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);
@ -352,7 +180,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;
@ -365,9 +193,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
@ -375,7 +203,7 @@
this.SaveCharButton.Dock = System.Windows.Forms.DockStyle.Bottom;
this.SaveCharButton.Location = new System.Drawing.Point(0, 315);
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;
@ -531,7 +359,7 @@
this.SaveMultButton.Dock = System.Windows.Forms.DockStyle.Bottom;
this.SaveMultButton.Location = new System.Drawing.Point(0, 345);
this.SaveMultButton.Name = "SaveMultButton";
this.SaveMultButton.Size = new System.Drawing.Size(392, 35);
this.SaveMultButton.Size = new System.Drawing.Size(377, 30);
this.SaveMultButton.TabIndex = 1;
this.SaveMultButton.Text = "Сохранить мульт";
this.SaveMultButton.UseVisualStyleBackColor = true;
@ -542,7 +370,7 @@
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;
@ -605,25 +433,6 @@
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;
}
}
}

View file

@ -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];
@ -99,52 +102,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)
@ -224,48 +228,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)
@ -282,6 +244,73 @@ 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)
{
}
private void SaveMultButton_Click(object sender, EventArgs e)
{
//надо