Защита от дурака (ARkLightning)

This commit is contained in:
Mikhail Abramov 2018-04-21 14:06:28 +03:00 committed by GitHub
parent 17be6b9daf
commit 1fcaee64ea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 78 additions and 7 deletions

View file

@ -413,6 +413,7 @@ namespace WindowsFormsApplication1
this.Name = "MainForm"; this.Name = "MainForm";
this.RightToLeftLayout = true; this.RightToLeftLayout = true;
this.Text = "Свойства персонажа"; this.Text = "Свойства персонажа";
this.Load += new System.EventHandler(this.MainForm_Load);
this.panel1.ResumeLayout(false); this.panel1.ResumeLayout(false);
this.panel1.PerformLayout(); this.panel1.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).EndInit(); ((System.ComponentModel.ISupportInitialize)(this.PictureBoxBackground)).EndInit();

View file

@ -31,20 +31,27 @@ namespace WindowsFormsApplication1
{ {
panel3.Visible = true; panel3.Visible = true;
pNomer = -120; pNomer = -120;
} }
private void DeletePics(string filename, int nomer) private void DeletePics(string filename, int nomer)
{ {
File.AppendAllText(filename, Environment.NewLine); File.AppendAllText(filename, Environment.NewLine);
for (int n1 = 0; n1 < nomer; n1++) for (int n1 = 0; n1 < nomer; n1++)
{ {
File.AppendAllText(filename, " txDeleteDC(" + Person.PersonName(n1) + ".texture);" + Environment.NewLine); File.AppendAllText(filename, " txDeleteDC(" + Person.PersonName(n1) + ".texture);" + Environment.NewLine);
} }
} }
private void SaveCharButtonClick(object sender, EventArgs e) private void SaveCharButtonClick(object sender, EventArgs e)
{ {
if (panel3.Visible == false)
{
MessageBox.Show("Где параметры? Покажи мне, ткни мне в них!");
return;
}
panel3.Visible = true;
if (pNomer == -120) if (pNomer == -120)
{ {
persons[nomerPersa].l1 = new Label(); persons[nomerPersa].l1 = new Label();
@ -80,7 +87,7 @@ namespace WindowsFormsApplication1
persons[nomerPersa].b1.MouseClick += persons[nomerPersa].b1.MouseClick +=
new MouseEventHandler(this.button1_Click_2); new MouseEventHandler(this.button1_Click_2);
this.panel1.Controls.Add(persons[nomerPersa].b1); this.panel1.Controls.Add(persons[nomerPersa].b1);
ToolTip tView = new ToolTip(); ToolTip tView = new ToolTip();
tView.IsBalloon = true; tView.IsBalloon = true;
tView.InitialDelay = 0; tView.InitialDelay = 0;
@ -218,8 +225,52 @@ namespace WindowsFormsApplication1
private void SaveMultButton_Click(object sender, EventArgs e) private void SaveMultButton_Click(object sender, EventArgs e)
{ {
if (saveFileDialog1.ShowDialog() == DialogResult.OK && if (PictureBoxBackground.Image == null)
PictureBoxBackground.Image != null) {
MessageBox.Show("Что ты собрался выводить то, поехавший (фон)?");
return;
}
for (int nomer = 0; nomer < nomerPersa; nomer++)
{
if (String.IsNullOrEmpty(persons[nomer].adress))
{
MessageBox.Show("Картинка №" + (nomer + 1).ToString() + " пустая");
return;
}
if (String.IsNullOrEmpty(persons[nomer].x1))
{
MessageBox.Show("Первая координата персонажа №" + (nomer + 1).ToString() + " пустая");
return;
}
if (String.IsNullOrEmpty(persons[nomer].y1))
{
MessageBox.Show("Первая координата персонажа №" + (nomer + 1).ToString() + " пустая");
return;
}
if (String.IsNullOrEmpty(persons[nomer].y2))
{
MessageBox.Show("Вторая координата персонажа №" + (nomer + 1).ToString() + " пустая");
return;
}
if (String.IsNullOrEmpty(persons[nomer].x2))
{
MessageBox.Show("Вторая координата персонажа №" + (nomer + 1).ToString() + " пустая");
return;
}
if (String.IsNullOrEmpty(persons[nomer].time1))
{
MessageBox.Show("Первая координата времени №" + (nomer + 1).ToString() + " пустая");
return;
}
if (String.IsNullOrEmpty(persons[nomer].time2))
{
MessageBox.Show("Вторая координата времени №" + (nomer + 1).ToString() + " пустая");
return;
}
}
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{ {
string filename = saveFileDialog1.FileName; string filename = saveFileDialog1.FileName;
@ -282,7 +333,7 @@ namespace WindowsFormsApplication1
Files.CloseWhile(filename); Files.CloseWhile(filename);
DeletePics(filename, nomerPersa); DeletePics(filename, nomerPersa);
Files.Ending(filename); Files.Ending(filename);
MessageBox.Show("Successfully"); MessageBox.Show("Successfully");
} }
} }
@ -339,5 +390,24 @@ namespace WindowsFormsApplication1
{ {
} }
private void MainForm_Load(object sender, EventArgs e)
{
ToolTip tView = new ToolTip();
tView.IsBalloon = true;
tView.InitialDelay = 0;
tView.ShowAlways = true;
tView.AutoPopDelay = 2000;
tView.SetToolTip(TextBoxWall1, "x.y");
ToolTip tView2 = new ToolTip();
tView2.IsBalloon = true;
tView2.InitialDelay = 0;
tView2.ShowAlways = true;
tView2.AutoPopDelay = 2000;
tView2.SetToolTip(TextBoxWall2, "x.y");
}
} }
} }