This commit is contained in:
Слава 2024-06-03 02:41:15 +04:00
parent e74ff37357
commit c1eff43270
2 changed files with 113 additions and 72 deletions

View File

@ -38,36 +38,55 @@ namespace ProjectPlane.Drawnings
return;
}
Pen pen = new(entitySeaPlane.BodyColor, 2);
Brush additionalBrush = new SolidBrush(Color.Black);
Brush floatsBrush = new SolidBrush(Color.Black);
Brush floatsBrush2 = new SolidBrush(entitySeaPlane.AdditionalColor);
Brush lineBrush = new HatchBrush(HatchStyle.ZigZag, entitySeaPlane.AdditionalColor, Color.FromArgb(163, 163, 163));
Brush boatBrush = new SolidBrush(entitySeaPlane.AdditionalColor);
Pen pen3 = new(EntityPlane.BodyColor, 2);
Pen pen = new(Color.Black, 2);
Pen pen5 = new(Color.Black, 4);
Pen pen2 = new(Color.Black, 6);
Pen pen4 = new(Color.White, 4);
Pen pen6 = new(Color.Black, 1);
Brush Brush = new SolidBrush(EntityPlane.BodyColor);
Brush Brush2 = new SolidBrush(Color.Black);
Brush glassBrush = new SolidBrush(Color.SkyBlue);
Brush glassBrush2 = new SolidBrush(entitySeaPlane.AdditionalColor);
Brush boatBrush = new HatchBrush(HatchStyle.ZigZag, entitySeaPlane.AdditionalColor, Color.FromArgb(163, 163, 163));
Brush additionalBrush = new SolidBrush(entitySeaPlane.AdditionalColor);
base.DrawTransport(g);
//внутренности самолета
//g.DrawRectangle(pen, _startPosX.Value + 25, _startPosY.Value + 10, 80, 30);
//g.FillRectangle(additionalBrush, _startPosX.Value + 25, _startPosY.Value + 10, 80, 30);
if (entitySeaPlane.Line)
{
g.FillEllipse(lineBrush, _startPosX.Value + 5, _startPosY.Value + 9, 25, 30);
g.DrawEllipse(pen, _startPosX.Value + 5, _startPosY.Value + 9, 25, 30);
}
Point[] points3 = { new Point(_startPosX.Value + 35, _startPosY.Value + 15), new Point(_startPosX.Value + 20, _startPosY.Value + 15), new Point(_startPosX.Value + 10, _startPosY.Value + 20), new Point(_startPosX.Value + 10, _startPosY.Value + 25), new Point(_startPosX.Value + 15, _startPosY.Value + 30), new Point(_startPosX.Value + 145, _startPosY.Value + 20), new Point(_startPosX.Value + 140, _startPosY.Value + 20), new Point(_startPosX.Value + 140, _startPosY.Value + 10), new Point(_startPosX.Value + 135, _startPosY.Value + 20), new Point(_startPosX.Value + 30, _startPosY.Value + 20) };
g.FillPolygon(additionalBrush, points3);
g.DrawPolygon(pen6, points3);
if (entitySeaPlane.Boat)
{
g.DrawEllipse(pen, _startPosX.Value + 34, _startPosY.Value + 2, 30, 7);
g.FillEllipse(boatBrush, _startPosX.Value + 34, _startPosY.Value + 2, 30, 7);
g.DrawEllipse(pen, _startPosX.Value + 34, _startPosY.Value + 39, 30, 7);
g.FillEllipse(boatBrush, _startPosX.Value + 34, _startPosY.Value + 39, 30, 7);
}
if (entitySeaPlane.Floats)
{
g.DrawEllipse(pen, _startPosX.Value + 97, _startPosY.Value + 36, 10, 10);
g.FillEllipse(floatsBrush2, _startPosX.Value + 97, _startPosY.Value + 36, 10, 10);
Point[] points4 = { new Point(_startPosX.Value + 10, _startPosY.Value + 40), new Point(_startPosX.Value + 110, _startPosY.Value + 40), new Point(_startPosX.Value + 110, _startPosY.Value + 41), new Point(_startPosX.Value + 70, _startPosY.Value + 50), new Point(_startPosX.Value + 30, _startPosY.Value + 50) };
g.FillPolygon(additionalBrush, points4);
g.DrawPolygon(pen, points4);
g.DrawLine(pen, _startPosX.Value + 30, _startPosY.Value + 45, _startPosX.Value + 80, _startPosY.Value + 45);
}
if (entitySeaPlane.Boat)
{
g.DrawRectangle(pen, _startPosX.Value + 85, _startPosY.Value + 15, 25, 10);
g.FillRectangle(boatBrush, _startPosX.Value + 85, _startPosY.Value + 15, 25, 10);
Point[] points5 = { new Point(_startPosX.Value + 80, _startPosY.Value + 15), new Point(_startPosX.Value + 85, _startPosY.Value + 10), new Point(_startPosX.Value + 115, _startPosY.Value + 10), new Point(_startPosX.Value + 115, _startPosY.Value + 15), new Point(_startPosX.Value + 85, _startPosY.Value + 15), new Point(_startPosX.Value + 85, _startPosY.Value + 25), new Point(_startPosX.Value + 115, _startPosY.Value + 25), new Point(_startPosX.Value + 115, _startPosY.Value + 30), new Point(_startPosX.Value + 85, _startPosY.Value + 30), new Point(_startPosX.Value + 80, _startPosY.Value + 25) };
g.FillPolygon(additionalBrush, points5);
g.DrawPolygon(pen, points5);
g.FillRectangle(floatsBrush, _startPosX.Value + 107, _startPosY.Value + 40, 15, 5);
}
}

View File

@ -75,8 +75,10 @@
groupBoxConfing.Controls.Add(labelSimpleObject);
groupBoxConfing.Dock = DockStyle.Left;
groupBoxConfing.Location = new Point(0, 0);
groupBoxConfing.Margin = new Padding(3, 2, 3, 2);
groupBoxConfing.Name = "groupBoxConfing";
groupBoxConfing.Size = new Size(626, 262);
groupBoxConfing.Padding = new Padding(3, 2, 3, 2);
groupBoxConfing.Size = new Size(548, 196);
groupBoxConfing.TabIndex = 0;
groupBoxConfing.TabStop = false;
groupBoxConfing.Text = "Параметры";
@ -91,9 +93,11 @@
groupBoxColors.Controls.Add(panelBlue);
groupBoxColors.Controls.Add(panelGreen);
groupBoxColors.Controls.Add(panelRed);
groupBoxColors.Location = new Point(327, 26);
groupBoxColors.Location = new Point(286, 20);
groupBoxColors.Margin = new Padding(3, 2, 3, 2);
groupBoxColors.Name = "groupBoxColors";
groupBoxColors.Size = new Size(280, 154);
groupBoxColors.Padding = new Padding(3, 2, 3, 2);
groupBoxColors.Size = new Size(245, 116);
groupBoxColors.TabIndex = 9;
groupBoxColors.TabStop = false;
groupBoxColors.Text = "Цвета";
@ -101,83 +105,93 @@
// panelPurple
//
panelPurple.BackColor = Color.Purple;
panelPurple.Location = new Point(217, 96);
panelPurple.Location = new Point(190, 72);
panelPurple.Margin = new Padding(3, 2, 3, 2);
panelPurple.Name = "panelPurple";
panelPurple.Size = new Size(48, 47);
panelPurple.Size = new Size(42, 35);
panelPurple.TabIndex = 1;
//
// panelBlack
//
panelBlack.BackColor = Color.Black;
panelBlack.Location = new Point(149, 96);
panelBlack.Location = new Point(130, 72);
panelBlack.Margin = new Padding(3, 2, 3, 2);
panelBlack.Name = "panelBlack";
panelBlack.Size = new Size(48, 47);
panelBlack.Size = new Size(42, 35);
panelBlack.TabIndex = 1;
//
// panelGray
//
panelGray.BackColor = Color.Gray;
panelGray.Location = new Point(82, 96);
panelGray.Location = new Point(72, 72);
panelGray.Margin = new Padding(3, 2, 3, 2);
panelGray.Name = "panelGray";
panelGray.Size = new Size(48, 47);
panelGray.Size = new Size(42, 35);
panelGray.TabIndex = 1;
//
// panelWhite
//
panelWhite.BackColor = Color.White;
panelWhite.Location = new Point(17, 96);
panelWhite.Location = new Point(15, 72);
panelWhite.Margin = new Padding(3, 2, 3, 2);
panelWhite.Name = "panelWhite";
panelWhite.Size = new Size(48, 47);
panelWhite.Size = new Size(42, 35);
panelWhite.TabIndex = 1;
//
// panelYellow
//
panelYellow.BackColor = Color.Yellow;
panelYellow.Location = new Point(217, 31);
panelYellow.Location = new Point(190, 23);
panelYellow.Margin = new Padding(3, 2, 3, 2);
panelYellow.Name = "panelYellow";
panelYellow.Size = new Size(48, 47);
panelYellow.Size = new Size(42, 35);
panelYellow.TabIndex = 1;
//
// panelBlue
//
panelBlue.BackColor = Color.Blue;
panelBlue.Location = new Point(149, 31);
panelBlue.Location = new Point(130, 23);
panelBlue.Margin = new Padding(3, 2, 3, 2);
panelBlue.Name = "panelBlue";
panelBlue.Size = new Size(48, 47);
panelBlue.Size = new Size(42, 35);
panelBlue.TabIndex = 1;
//
// panelGreen
//
panelGreen.BackColor = Color.Green;
panelGreen.Location = new Point(82, 31);
panelGreen.Location = new Point(72, 23);
panelGreen.Margin = new Padding(3, 2, 3, 2);
panelGreen.Name = "panelGreen";
panelGreen.Size = new Size(48, 47);
panelGreen.Size = new Size(42, 35);
panelGreen.TabIndex = 1;
//
// panelRed
//
panelRed.BackColor = Color.Red;
panelRed.Location = new Point(17, 31);
panelRed.Location = new Point(15, 23);
panelRed.Margin = new Padding(3, 2, 3, 2);
panelRed.Name = "panelRed";
panelRed.Size = new Size(48, 47);
panelRed.Size = new Size(42, 35);
panelRed.TabIndex = 0;
//
// checkBoxFloats
//
checkBoxFloats.AutoSize = true;
checkBoxFloats.Location = new Point(6, 217);
checkBoxFloats.Location = new Point(5, 163);
checkBoxFloats.Margin = new Padding(3, 2, 3, 2);
checkBoxFloats.Name = "checkBoxFloats";
checkBoxFloats.Size = new Size(202, 24);
checkBoxFloats.Size = new Size(185, 19);
checkBoxFloats.TabIndex = 8;
checkBoxFloats.Text = "Признак наличие пушки";
checkBoxFloats.Text = "Признак наличие поплавков";
checkBoxFloats.UseVisualStyleBackColor = true;
//
// checkBoxBoat
//
checkBoxBoat.AutoSize = true;
checkBoxBoat.Location = new Point(6, 169);
checkBoxBoat.Location = new Point(5, 127);
checkBoxBoat.Margin = new Padding(3, 2, 3, 2);
checkBoxBoat.Name = "checkBoxBoat";
checkBoxBoat.Size = new Size(215, 24);
checkBoxBoat.Size = new Size(174, 19);
checkBoxBoat.TabIndex = 7;
checkBoxBoat.Text = "Признак наличие шлюпок";
checkBoxBoat.UseVisualStyleBackColor = true;
@ -185,57 +199,60 @@
// checkBoxLine
//
checkBoxLine.AutoSize = true;
checkBoxLine.Location = new Point(6, 123);
checkBoxLine.Location = new Point(5, 92);
checkBoxLine.Margin = new Padding(3, 2, 3, 2);
checkBoxLine.Name = "checkBoxLine";
checkBoxLine.Size = new Size(321, 24);
checkBoxLine.Size = new Size(161, 19);
checkBoxLine.TabIndex = 6;
checkBoxLine.Text = "Признак наличие вертолетной площадки";
checkBoxLine.Text = "Признак наличие линии";
checkBoxLine.UseVisualStyleBackColor = true;
//
// numericUpDownWeight
//
numericUpDownWeight.Location = new Point(94, 68);
numericUpDownWeight.Location = new Point(82, 51);
numericUpDownWeight.Margin = new Padding(3, 2, 3, 2);
numericUpDownWeight.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownWeight.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownWeight.Name = "numericUpDownWeight";
numericUpDownWeight.Size = new Size(114, 27);
numericUpDownWeight.Size = new Size(100, 23);
numericUpDownWeight.TabIndex = 5;
numericUpDownWeight.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelWeight
//
labelWeight.AutoSize = true;
labelWeight.Location = new Point(27, 70);
labelWeight.Location = new Point(24, 52);
labelWeight.Name = "labelWeight";
labelWeight.Size = new Size(36, 20);
labelWeight.Size = new Size(29, 15);
labelWeight.TabIndex = 4;
labelWeight.Text = "Вес:";
//
// numericUpDownSpeed
//
numericUpDownSpeed.Location = new Point(94, 32);
numericUpDownSpeed.Location = new Point(82, 24);
numericUpDownSpeed.Margin = new Padding(3, 2, 3, 2);
numericUpDownSpeed.Maximum = new decimal(new int[] { 1000, 0, 0, 0 });
numericUpDownSpeed.Minimum = new decimal(new int[] { 100, 0, 0, 0 });
numericUpDownSpeed.Name = "numericUpDownSpeed";
numericUpDownSpeed.Size = new Size(114, 27);
numericUpDownSpeed.Size = new Size(100, 23);
numericUpDownSpeed.TabIndex = 3;
numericUpDownSpeed.Value = new decimal(new int[] { 100, 0, 0, 0 });
//
// labelSpeed
//
labelSpeed.AutoSize = true;
labelSpeed.Location = new Point(12, 32);
labelSpeed.Location = new Point(10, 24);
labelSpeed.Name = "labelSpeed";
labelSpeed.Size = new Size(76, 20);
labelSpeed.Size = new Size(62, 15);
labelSpeed.TabIndex = 2;
labelSpeed.Text = "Скорость:";
//
// labelModifiedObject
//
labelModifiedObject.BorderStyle = BorderStyle.FixedSingle;
labelModifiedObject.Location = new Point(476, 203);
labelModifiedObject.Location = new Point(416, 152);
labelModifiedObject.Name = "labelModifiedObject";
labelModifiedObject.Size = new Size(131, 44);
labelModifiedObject.Size = new Size(115, 34);
labelModifiedObject.TabIndex = 1;
labelModifiedObject.Text = "Продвинутый";
labelModifiedObject.TextAlign = ContentAlignment.MiddleCenter;
@ -244,9 +261,9 @@
// labelSimpleObject
//
labelSimpleObject.BorderStyle = BorderStyle.FixedSingle;
labelSimpleObject.Location = new Point(327, 203);
labelSimpleObject.Location = new Point(286, 152);
labelSimpleObject.Name = "labelSimpleObject";
labelSimpleObject.Size = new Size(130, 44);
labelSimpleObject.Size = new Size(114, 34);
labelSimpleObject.TabIndex = 0;
labelSimpleObject.Text = "Простой";
labelSimpleObject.TextAlign = ContentAlignment.MiddleCenter;
@ -254,17 +271,19 @@
//
// pictureBoxObject
//
pictureBoxObject.Location = new Point(11, 56);
pictureBoxObject.Location = new Point(10, 42);
pictureBoxObject.Margin = new Padding(3, 2, 3, 2);
pictureBoxObject.Name = "pictureBoxObject";
pictureBoxObject.Size = new Size(183, 125);
pictureBoxObject.Size = new Size(160, 94);
pictureBoxObject.TabIndex = 1;
pictureBoxObject.TabStop = false;
//
// buttonAdd
//
buttonAdd.Location = new Point(632, 212);
buttonAdd.Location = new Point(553, 159);
buttonAdd.Margin = new Padding(3, 2, 3, 2);
buttonAdd.Name = "buttonAdd";
buttonAdd.Size = new Size(94, 29);
buttonAdd.Size = new Size(82, 22);
buttonAdd.TabIndex = 2;
buttonAdd.Text = "Добавить";
buttonAdd.UseVisualStyleBackColor = true;
@ -272,9 +291,10 @@
//
// buttonCancel
//
buttonCancel.Location = new Point(740, 212);
buttonCancel.Location = new Point(648, 159);
buttonCancel.Margin = new Padding(3, 2, 3, 2);
buttonCancel.Name = "buttonCancel";
buttonCancel.Size = new Size(94, 29);
buttonCancel.Size = new Size(82, 22);
buttonCancel.TabIndex = 3;
buttonCancel.Text = "Отмена";
buttonCancel.UseVisualStyleBackColor = true;
@ -285,9 +305,10 @@
panelObject.Controls.Add(labelAdditionalColor);
panelObject.Controls.Add(labelBodyColor);
panelObject.Controls.Add(pictureBoxObject);
panelObject.Location = new Point(632, 12);
panelObject.Location = new Point(553, 9);
panelObject.Margin = new Padding(3, 2, 3, 2);
panelObject.Name = "panelObject";
panelObject.Size = new Size(205, 194);
panelObject.Size = new Size(179, 146);
panelObject.TabIndex = 4;
panelObject.DragDrop += PanelObject_DragDrop;
panelObject.DragEnter += PanelObject_DragEnter;
@ -296,9 +317,9 @@
//
labelAdditionalColor.AllowDrop = true;
labelAdditionalColor.BorderStyle = BorderStyle.FixedSingle;
labelAdditionalColor.Location = new Point(108, 11);
labelAdditionalColor.Location = new Point(94, 8);
labelAdditionalColor.Name = "labelAdditionalColor";
labelAdditionalColor.Size = new Size(83, 36);
labelAdditionalColor.Size = new Size(73, 28);
labelAdditionalColor.TabIndex = 3;
labelAdditionalColor.Text = "Доп. цвет";
labelAdditionalColor.TextAlign = ContentAlignment.MiddleCenter;
@ -309,9 +330,9 @@
//
labelBodyColor.AllowDrop = true;
labelBodyColor.BorderStyle = BorderStyle.FixedSingle;
labelBodyColor.Location = new Point(11, 11);
labelBodyColor.Location = new Point(10, 8);
labelBodyColor.Name = "labelBodyColor";
labelBodyColor.Size = new Size(83, 36);
labelBodyColor.Size = new Size(73, 28);
labelBodyColor.TabIndex = 2;
labelBodyColor.Text = "Цвет";
labelBodyColor.TextAlign = ContentAlignment.MiddleCenter;
@ -320,13 +341,14 @@
//
// FormPlaneConfing
//
AutoScaleDimensions = new SizeF(8F, 20F);
AutoScaleDimensions = new SizeF(7F, 15F);
AutoScaleMode = AutoScaleMode.Font;
ClientSize = new Size(838, 262);
ClientSize = new Size(733, 196);
Controls.Add(panelObject);
Controls.Add(buttonCancel);
Controls.Add(buttonAdd);
Controls.Add(groupBoxConfing);
Margin = new Padding(3, 2, 3, 2);
Name = "FormPlaneConfing";
Text = "Создание объекта";
groupBoxConfing.ResumeLayout(false);