More fixes of 118:Plane_Copy effect implementation...

One of Thing Statistics form's columns was editable for no good reason.
This commit is contained in:
MaxED 2014-05-06 08:21:10 +00:00
parent 0e4419d8ed
commit 0ce2f1c2fa
4 changed files with 148 additions and 137 deletions

View file

@ -28,138 +28,139 @@
/// </summary>
private void InitializeComponent()
{
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
this.apply = new System.Windows.Forms.Button();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.ThingType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ThingTitle = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ThingClassName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ThingCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.hideUnused = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
//
// apply
//
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.apply.Location = new System.Drawing.Point(369, 319);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(120, 23);
this.apply.TabIndex = 7;
this.apply.Text = "Close";
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// dataGridView
//
this.dataGridView.AllowUserToAddRows = false;
this.dataGridView.AllowUserToResizeColumns = false;
this.dataGridView.AllowUserToResizeRows = false;
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dataGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle1 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle2 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle3 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle4 = new System.Windows.Forms.DataGridViewCellStyle();
System.Windows.Forms.DataGridViewCellStyle dataGridViewCellStyle5 = new System.Windows.Forms.DataGridViewCellStyle();
this.apply = new System.Windows.Forms.Button();
this.dataGridView = new System.Windows.Forms.DataGridView();
this.ThingType = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ThingTitle = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ThingClassName = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.ThingCount = new System.Windows.Forms.DataGridViewTextBoxColumn();
this.hideUnused = new System.Windows.Forms.CheckBox();
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).BeginInit();
this.SuspendLayout();
//
// apply
//
this.apply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.apply.Location = new System.Drawing.Point(369, 319);
this.apply.Name = "apply";
this.apply.Size = new System.Drawing.Size(120, 23);
this.apply.TabIndex = 7;
this.apply.Text = "Close";
this.apply.UseVisualStyleBackColor = true;
this.apply.Click += new System.EventHandler(this.apply_Click);
//
// dataGridView
//
this.dataGridView.AllowUserToAddRows = false;
this.dataGridView.AllowUserToResizeColumns = false;
this.dataGridView.AllowUserToResizeRows = false;
this.dataGridView.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.dataGridView.BackgroundColor = System.Drawing.SystemColors.Window;
this.dataGridView.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
this.dataGridView.CellBorderStyle = System.Windows.Forms.DataGridViewCellBorderStyle.None;
this.dataGridView.ColumnHeadersBorderStyle = System.Windows.Forms.DataGridViewHeaderBorderStyle.Single;
dataGridViewCellStyle1.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
dataGridViewCellStyle1.BackColor = System.Drawing.SystemColors.Control;
dataGridViewCellStyle1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
dataGridViewCellStyle1.ForeColor = System.Drawing.SystemColors.WindowText;
dataGridViewCellStyle1.SelectionBackColor = System.Drawing.SystemColors.Highlight;
dataGridViewCellStyle1.SelectionForeColor = System.Drawing.SystemColors.HighlightText;
dataGridViewCellStyle1.WrapMode = System.Windows.Forms.DataGridViewTriState.False;
this.dataGridView.ColumnHeadersDefaultCellStyle = dataGridViewCellStyle1;
this.dataGridView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize;
this.dataGridView.Columns.AddRange(new System.Windows.Forms.DataGridViewColumn[] {
this.ThingType,
this.ThingTitle,
this.ThingClassName,
this.ThingCount});
this.dataGridView.Location = new System.Drawing.Point(12, 12);
this.dataGridView.MultiSelect = false;
this.dataGridView.Name = "dataGridView";
this.dataGridView.RowHeadersVisible = false;
this.dataGridView.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView.Size = new System.Drawing.Size(477, 301);
this.dataGridView.TabIndex = 6;
this.dataGridView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_CellMouseClick);
//
// ThingType
//
this.ThingType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.ThingType.DefaultCellStyle = dataGridViewCellStyle2;
this.ThingType.HeaderText = "№";
this.ThingType.Name = "ThingType";
this.ThingType.ReadOnly = true;
this.ThingType.Width = 45;
//
// ThingTitle
//
this.ThingTitle.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.ThingTitle.DefaultCellStyle = dataGridViewCellStyle3;
this.ThingTitle.HeaderText = "Thing Name";
this.ThingTitle.Name = "ThingTitle";
//
// ThingClassName
//
this.ThingClassName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.ThingClassName.DefaultCellStyle = dataGridViewCellStyle4;
this.ThingClassName.HeaderText = "Class Name";
this.ThingClassName.Name = "ThingClassName";
this.ThingClassName.ReadOnly = true;
this.ThingClassName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ThingClassName.Width = 89;
//
// ThingCount
//
this.ThingCount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.ThingCount.DefaultCellStyle = dataGridViewCellStyle5;
this.ThingCount.HeaderText = "Count";
this.ThingCount.Name = "ThingCount";
this.ThingCount.ReadOnly = true;
this.ThingCount.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ThingCount.Width = 60;
//
// hideUnused
//
this.hideUnused.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.hideUnused.AutoSize = true;
this.hideUnused.Location = new System.Drawing.Point(13, 322);
this.hideUnused.Name = "hideUnused";
this.hideUnused.Size = new System.Drawing.Size(122, 18);
this.hideUnused.TabIndex = 8;
this.hideUnused.Text = "Hide Unused Things";
this.hideUnused.UseVisualStyleBackColor = true;
this.hideUnused.CheckedChanged += new System.EventHandler(this.hideUnused_CheckedChanged);
//
// ThingStatisticsForm
//
this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(501, 348);
this.Controls.Add(this.hideUnused);
this.Controls.Add(this.apply);
this.Controls.Add(this.dataGridView);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "ThingStatisticsForm";
this.ShowInTaskbar = false;
this.Text = "Thing statistics";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ThingStatisticsForm_FormClosing);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
this.dataGridView.Location = new System.Drawing.Point(12, 12);
this.dataGridView.MultiSelect = false;
this.dataGridView.Name = "dataGridView";
this.dataGridView.RowHeadersVisible = false;
this.dataGridView.ScrollBars = System.Windows.Forms.ScrollBars.Vertical;
this.dataGridView.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect;
this.dataGridView.Size = new System.Drawing.Size(477, 301);
this.dataGridView.TabIndex = 6;
this.dataGridView.CellMouseClick += new System.Windows.Forms.DataGridViewCellMouseEventHandler(this.dataGridView_CellMouseClick);
//
// ThingType
//
this.ThingType.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
dataGridViewCellStyle2.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.ThingType.DefaultCellStyle = dataGridViewCellStyle2;
this.ThingType.HeaderText = "№";
this.ThingType.Name = "ThingType";
this.ThingType.ReadOnly = true;
this.ThingType.Width = 45;
//
// ThingTitle
//
this.ThingTitle.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.Fill;
dataGridViewCellStyle3.WrapMode = System.Windows.Forms.DataGridViewTriState.True;
this.ThingTitle.DefaultCellStyle = dataGridViewCellStyle3;
this.ThingTitle.HeaderText = "Thing Name";
this.ThingTitle.Name = "ThingTitle";
this.ThingTitle.ReadOnly = true;
//
// ThingClassName
//
this.ThingClassName.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.AllCells;
dataGridViewCellStyle4.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleLeft;
this.ThingClassName.DefaultCellStyle = dataGridViewCellStyle4;
this.ThingClassName.HeaderText = "Class Name";
this.ThingClassName.Name = "ThingClassName";
this.ThingClassName.ReadOnly = true;
this.ThingClassName.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ThingClassName.Width = 89;
//
// ThingCount
//
this.ThingCount.AutoSizeMode = System.Windows.Forms.DataGridViewAutoSizeColumnMode.ColumnHeader;
dataGridViewCellStyle5.Alignment = System.Windows.Forms.DataGridViewContentAlignment.MiddleCenter;
this.ThingCount.DefaultCellStyle = dataGridViewCellStyle5;
this.ThingCount.HeaderText = "Count";
this.ThingCount.Name = "ThingCount";
this.ThingCount.ReadOnly = true;
this.ThingCount.Resizable = System.Windows.Forms.DataGridViewTriState.True;
this.ThingCount.Width = 60;
//
// hideUnused
//
this.hideUnused.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.hideUnused.AutoSize = true;
this.hideUnused.Location = new System.Drawing.Point(13, 322);
this.hideUnused.Name = "hideUnused";
this.hideUnused.Size = new System.Drawing.Size(122, 18);
this.hideUnused.TabIndex = 8;
this.hideUnused.Text = "Hide Unused Things";
this.hideUnused.UseVisualStyleBackColor = true;
this.hideUnused.CheckedChanged += new System.EventHandler(this.hideUnused_CheckedChanged);
//
// ThingStatisticsForm
//
this.AcceptButton = this.apply;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.ClientSize = new System.Drawing.Size(501, 348);
this.Controls.Add(this.hideUnused);
this.Controls.Add(this.apply);
this.Controls.Add(this.dataGridView);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(204)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
this.Name = "ThingStatisticsForm";
this.ShowInTaskbar = false;
this.Text = "Thing statistics";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.ThingStatisticsForm_FormClosing);
((System.ComponentModel.ISupportInitialize)(this.dataGridView)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}

View file

@ -834,7 +834,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(l.Front != null) {
if( (l.Args[0] > 0 || l.Args[1] > 0) || (l.Back != null && (floorCopyToFront || ceilingCopyToFront)) ) {
SectorData sd = GetSectorData(l.Front.Sector);
sd.AddEffectPlaneClopySlope(l, true, floorCopyToFront, ceilingCopyToFront);
sd.AddEffectPlaneClopySlope(l, true);
}
}
@ -842,7 +842,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
if(l.Back != null) {
if( (l.Args[2] > 0 || l.Args[3] > 0) || (l.Front != null && (floorCopyToBack || ceilingCopyToBack)) ) {
SectorData sd = GetSectorData(l.Back.Sector);
sd.AddEffectPlaneClopySlope(l, false, floorCopyToBack, ceilingCopyToBack);
sd.AddEffectPlaneClopySlope(l, false);
}
}
}

View file

@ -7,14 +7,10 @@ namespace CodeImp.DoomBuilder.BuilderModes
// Linedef that is used to create this effect
private readonly Linedef linedef;
private readonly bool front;
private readonly bool copyFloor;
private readonly bool copyCeiling;
public EffectPlaneCopySlope(SectorData data, Linedef sourcelinedef, bool front, bool copyFloor, bool copyCeiling) : base(data) {
public EffectPlaneCopySlope(SectorData data, Linedef sourcelinedef, bool front) : base(data) {
this.linedef = sourcelinedef;
this.front = front;
this.copyFloor = copyFloor;
this.copyCeiling = copyCeiling;
// New effect added: This sector needs an update!
if(data.Mode.VisualSectorExists(data.Sector)) {
@ -76,6 +72,20 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
}
//check the flags...
bool copyFloor = false;
bool copyCeiling = false;
if(linedef.Args[4] > 0 && linedef.Args[4] != 3 && linedef.Args[4] != 12) {
if (front) {
copyFloor = (linedef.Args[4] & 2) == 2;
copyCeiling = (linedef.Args[4] & 8) == 8;
} else {
copyFloor = (linedef.Args[4] & 1) == 1;
copyCeiling = (linedef.Args[4] & 4) == 4;
}
}
// Copy slope across the line
if(!copyFloor && !copyCeiling) return;

View file

@ -115,8 +115,8 @@ namespace CodeImp.DoomBuilder.BuilderModes
}
//mxd. Plane copy slope effect
public void AddEffectPlaneClopySlope(Linedef sourcelinedef, bool front, bool copyFloor, bool copyCeiling) {
EffectPlaneCopySlope e = new EffectPlaneCopySlope(this, sourcelinedef, front, copyFloor, copyCeiling);
public void AddEffectPlaneClopySlope(Linedef sourcelinedef, bool front) {
EffectPlaneCopySlope e = new EffectPlaneCopySlope(this, sourcelinedef, front);
alleffects.Add(e);
}