Randomize Sectors form: floor/ceiling height controls now have "Offset mode" drop-downs. Available modes are "Raise and lower" (default), "Raise only" and "Lower only".

Consistency, Randomize Sectors form: persistent settings are now saved only when applying changes done in the form (e.g. in the same conditions as in Randomize Things / Vertices forms).
This commit is contained in:
MaxED 2014-10-29 14:51:30 +00:00
parent 5e59c38da6
commit 3e4fe14fbe
4 changed files with 238 additions and 94 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 59 KiB

View file

@ -44,15 +44,27 @@
this.ceilingHeightAmmount = new IntControl();
this.cbUseFloorVertexHeights = new System.Windows.Forms.CheckBox();
this.cbUseCeilingVertexHeights = new System.Windows.Forms.CheckBox();
this.label1 = new System.Windows.Forms.Label();
this.ceiloffsetmode = new System.Windows.Forms.ComboBox();
this.flooroffsetmode = new System.Windows.Forms.ComboBox();
this.label2 = new System.Windows.Forms.Label();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox2 = new System.Windows.Forms.GroupBox();
this.groupBox3 = new System.Windows.Forms.GroupBox();
this.groupBox4 = new System.Windows.Forms.GroupBox();
this.gbUpperTexture.SuspendLayout();
this.gbLowerTexture.SuspendLayout();
this.groupBox1.SuspendLayout();
this.groupBox2.SuspendLayout();
this.groupBox3.SuspendLayout();
this.groupBox4.SuspendLayout();
this.SuspendLayout();
//
// bCancel
//
this.bCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.bCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.bCancel.Location = new System.Drawing.Point(195, 368);
this.bCancel.Location = new System.Drawing.Point(195, 525);
this.bCancel.Name = "bCancel";
this.bCancel.Size = new System.Drawing.Size(75, 25);
this.bCancel.TabIndex = 10;
@ -63,7 +75,7 @@
// bApply
//
this.bApply.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.bApply.Location = new System.Drawing.Point(276, 368);
this.bApply.Location = new System.Drawing.Point(276, 525);
this.bApply.Name = "bApply";
this.bApply.Size = new System.Drawing.Size(95, 25);
this.bApply.TabIndex = 9;
@ -73,9 +85,8 @@
//
// bUpdateTranslation
//
this.bUpdateTranslation.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.bUpdateTranslation.Image = global::CodeImp.DoomBuilder.BuilderEffects.Properties.Resources.Update;
this.bUpdateTranslation.Location = new System.Drawing.Point(347, 14);
this.bUpdateTranslation.Location = new System.Drawing.Point(327, 19);
this.bUpdateTranslation.Name = "bUpdateTranslation";
this.bUpdateTranslation.Size = new System.Drawing.Size(23, 25);
this.bUpdateTranslation.TabIndex = 11;
@ -84,9 +95,8 @@
//
// bUpdateCeilingHeight
//
this.bUpdateCeilingHeight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.bUpdateCeilingHeight.Image = global::CodeImp.DoomBuilder.BuilderEffects.Properties.Resources.Update;
this.bUpdateCeilingHeight.Location = new System.Drawing.Point(347, 44);
this.bUpdateCeilingHeight.Location = new System.Drawing.Point(327, 19);
this.bUpdateCeilingHeight.Name = "bUpdateCeilingHeight";
this.bUpdateCeilingHeight.Size = new System.Drawing.Size(23, 25);
this.bUpdateCeilingHeight.TabIndex = 15;
@ -95,9 +105,8 @@
//
// bUpdateFloorHeight
//
this.bUpdateFloorHeight.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.bUpdateFloorHeight.Image = global::CodeImp.DoomBuilder.BuilderEffects.Properties.Resources.Update;
this.bUpdateFloorHeight.Location = new System.Drawing.Point(347, 93);
this.bUpdateFloorHeight.Location = new System.Drawing.Point(327, 19);
this.bUpdateFloorHeight.Name = "bUpdateFloorHeight";
this.bUpdateFloorHeight.Size = new System.Drawing.Size(23, 25);
this.bUpdateFloorHeight.TabIndex = 16;
@ -106,12 +115,11 @@
//
// gbUpperTexture
//
this.gbUpperTexture.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.gbUpperTexture.Controls.Add(this.textureUpper);
this.gbUpperTexture.Controls.Add(this.cbPegTop);
this.gbUpperTexture.Location = new System.Drawing.Point(12, 203);
this.gbUpperTexture.Location = new System.Drawing.Point(6, 71);
this.gbUpperTexture.Name = "gbUpperTexture";
this.gbUpperTexture.Size = new System.Drawing.Size(176, 159);
this.gbUpperTexture.Size = new System.Drawing.Size(171, 159);
this.gbUpperTexture.TabIndex = 24;
this.gbUpperTexture.TabStop = false;
this.gbUpperTexture.Text = "Upper Texture:";
@ -162,51 +170,47 @@
//
// cbUpperTexStyle
//
this.cbUpperTexStyle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbUpperTexStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbUpperTexStyle.FormattingEnabled = true;
this.cbUpperTexStyle.Items.AddRange(new object[] {
"Don\'t change upper texture",
"Use ceiling texture",
"Pick upper texture"});
this.cbUpperTexStyle.Location = new System.Drawing.Point(12, 175);
this.cbUpperTexStyle.Location = new System.Drawing.Point(6, 43);
this.cbUpperTexStyle.Name = "cbUpperTexStyle";
this.cbUpperTexStyle.Size = new System.Drawing.Size(176, 22);
this.cbUpperTexStyle.Size = new System.Drawing.Size(171, 22);
this.cbUpperTexStyle.TabIndex = 26;
this.cbUpperTexStyle.SelectedIndexChanged += new System.EventHandler(this.cbUpperTexStyle_SelectedIndexChanged);
//
// cbLowerTexStyle
//
this.cbLowerTexStyle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbLowerTexStyle.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.cbLowerTexStyle.FormattingEnabled = true;
this.cbLowerTexStyle.Items.AddRange(new object[] {
"Don\'t change lower texture",
"Use floor texture",
"Pick lower texture"});
this.cbLowerTexStyle.Location = new System.Drawing.Point(195, 175);
this.cbLowerTexStyle.Location = new System.Drawing.Point(181, 43);
this.cbLowerTexStyle.Name = "cbLowerTexStyle";
this.cbLowerTexStyle.Size = new System.Drawing.Size(175, 22);
this.cbLowerTexStyle.Size = new System.Drawing.Size(171, 22);
this.cbLowerTexStyle.TabIndex = 27;
this.cbLowerTexStyle.SelectedIndexChanged += new System.EventHandler(this.cbLowerTexStyle_SelectedIndexChanged);
//
// gbLowerTexture
//
this.gbLowerTexture.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.gbLowerTexture.Controls.Add(this.textureLower);
this.gbLowerTexture.Controls.Add(this.cbPegBottom);
this.gbLowerTexture.Location = new System.Drawing.Point(195, 203);
this.gbLowerTexture.Location = new System.Drawing.Point(181, 71);
this.gbLowerTexture.Name = "gbLowerTexture";
this.gbLowerTexture.Size = new System.Drawing.Size(176, 159);
this.gbLowerTexture.Size = new System.Drawing.Size(171, 159);
this.gbLowerTexture.TabIndex = 29;
this.gbLowerTexture.TabStop = false;
this.gbLowerTexture.Text = "Lower texture:";
//
// cbKeepExistingTextures
//
this.cbKeepExistingTextures.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.cbKeepExistingTextures.AutoSize = true;
this.cbKeepExistingTextures.Location = new System.Drawing.Point(12, 151);
this.cbKeepExistingTextures.Location = new System.Drawing.Point(8, 19);
this.cbKeepExistingTextures.Name = "cbKeepExistingTextures";
this.cbKeepExistingTextures.Size = new System.Drawing.Size(211, 18);
this.cbKeepExistingTextures.TabIndex = 30;
@ -214,29 +218,17 @@
this.cbKeepExistingTextures.UseVisualStyleBackColor = true;
this.cbKeepExistingTextures.CheckedChanged += new System.EventHandler(this.cbKeepExistingTextures_CheckedChanged);
//
// cbUseFloorVertexHeights
//
this.cbUseFloorVertexHeights.AutoSize = true;
this.cbUseFloorVertexHeights.Location = new System.Drawing.Point(108, 119);
this.cbUseFloorVertexHeights.Name = "cbUseFloorVertexHeights";
this.cbUseFloorVertexHeights.Size = new System.Drawing.Size(117, 18);
this.cbUseFloorVertexHeights.TabIndex = 31;
this.cbUseFloorVertexHeights.Text = "Use vertex heights";
this.cbUseFloorVertexHeights.UseVisualStyleBackColor = true;
this.cbUseFloorVertexHeights.CheckedChanged += new System.EventHandler(this.cbUseFloorVertexHeights_CheckedChanged);
//
// positionJitterAmmount
//
this.positionJitterAmmount.AllowNegative = false;
this.positionJitterAmmount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.positionJitterAmmount.ExtendedLimits = true;
this.positionJitterAmmount.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.positionJitterAmmount.Label = "Position:";
this.positionJitterAmmount.Location = new System.Drawing.Point(12, 15);
this.positionJitterAmmount.Location = new System.Drawing.Point(6, 19);
this.positionJitterAmmount.Maximum = 100;
this.positionJitterAmmount.Minimum = 0;
this.positionJitterAmmount.Name = "positionJitterAmmount";
this.positionJitterAmmount.Size = new System.Drawing.Size(329, 22);
this.positionJitterAmmount.Size = new System.Drawing.Size(315, 22);
this.positionJitterAmmount.TabIndex = 18;
this.positionJitterAmmount.Value = 0;
this.positionJitterAmmount.OnValueChanging += new System.EventHandler(this.positionJitterAmmount_OnValueChanging);
@ -244,15 +236,14 @@
// floorHeightAmmount
//
this.floorHeightAmmount.AllowNegative = false;
this.floorHeightAmmount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.floorHeightAmmount.ExtendedLimits = false;
this.floorHeightAmmount.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.floorHeightAmmount.Label = "Floor height:";
this.floorHeightAmmount.Location = new System.Drawing.Point(12, 94);
this.floorHeightAmmount.Location = new System.Drawing.Point(6, 19);
this.floorHeightAmmount.Maximum = 100;
this.floorHeightAmmount.Minimum = 0;
this.floorHeightAmmount.Name = "floorHeightAmmount";
this.floorHeightAmmount.Size = new System.Drawing.Size(329, 22);
this.floorHeightAmmount.Size = new System.Drawing.Size(315, 22);
this.floorHeightAmmount.TabIndex = 20;
this.floorHeightAmmount.Value = 0;
this.floorHeightAmmount.OnValueChanging += new System.EventHandler(this.floorHeightAmmount_OnValueChanging);
@ -260,23 +251,33 @@
// ceilingHeightAmmount
//
this.ceilingHeightAmmount.AllowNegative = false;
this.ceilingHeightAmmount.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right)));
this.ceilingHeightAmmount.ExtendedLimits = false;
this.ceilingHeightAmmount.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.ceilingHeightAmmount.Label = "Ceil. height:";
this.ceilingHeightAmmount.Location = new System.Drawing.Point(12, 45);
this.ceilingHeightAmmount.Label = "Height:";
this.ceilingHeightAmmount.Location = new System.Drawing.Point(6, 19);
this.ceilingHeightAmmount.Maximum = 100;
this.ceilingHeightAmmount.Minimum = 0;
this.ceilingHeightAmmount.Name = "ceilingHeightAmmount";
this.ceilingHeightAmmount.Size = new System.Drawing.Size(329, 22);
this.ceilingHeightAmmount.Size = new System.Drawing.Size(315, 22);
this.ceilingHeightAmmount.TabIndex = 19;
this.ceilingHeightAmmount.Value = 0;
this.ceilingHeightAmmount.OnValueChanging += new System.EventHandler(this.ceilingHeightAmmount_OnValueChanging);
//
// cbUseFloorVertexHeights
//
this.cbUseFloorVertexHeights.AutoSize = true;
this.cbUseFloorVertexHeights.Location = new System.Drawing.Point(102, 75);
this.cbUseFloorVertexHeights.Name = "cbUseFloorVertexHeights";
this.cbUseFloorVertexHeights.Size = new System.Drawing.Size(117, 18);
this.cbUseFloorVertexHeights.TabIndex = 31;
this.cbUseFloorVertexHeights.Text = "Use vertex heights";
this.cbUseFloorVertexHeights.UseVisualStyleBackColor = true;
this.cbUseFloorVertexHeights.CheckedChanged += new System.EventHandler(this.cbUseFloorVertexHeights_CheckedChanged);
//
// cbUseCeilingVertexHeights
//
this.cbUseCeilingVertexHeights.AutoSize = true;
this.cbUseCeilingVertexHeights.Location = new System.Drawing.Point(108, 70);
this.cbUseCeilingVertexHeights.Location = new System.Drawing.Point(102, 75);
this.cbUseCeilingVertexHeights.Name = "cbUseCeilingVertexHeights";
this.cbUseCeilingVertexHeights.Size = new System.Drawing.Size(117, 18);
this.cbUseCeilingVertexHeights.TabIndex = 32;
@ -284,26 +285,116 @@
this.cbUseCeilingVertexHeights.UseVisualStyleBackColor = true;
this.cbUseCeilingVertexHeights.CheckedChanged += new System.EventHandler(this.cbUseCeilingVertexHeights_CheckedChanged);
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(26, 51);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(70, 14);
this.label1.TabIndex = 33;
this.label1.Text = "Offset mode:";
//
// ceiloffsetmode
//
this.ceiloffsetmode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.ceiloffsetmode.FormattingEnabled = true;
this.ceiloffsetmode.Items.AddRange(new object[] {
"Raise and lower",
"Lower only",
"Raise only"});
this.ceiloffsetmode.Location = new System.Drawing.Point(102, 47);
this.ceiloffsetmode.Name = "ceiloffsetmode";
this.ceiloffsetmode.Size = new System.Drawing.Size(112, 22);
this.ceiloffsetmode.TabIndex = 34;
this.ceiloffsetmode.SelectedIndexChanged += new System.EventHandler(this.ceiloffsetmode_SelectedIndexChanged);
//
// flooroffsetmode
//
this.flooroffsetmode.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.flooroffsetmode.FormattingEnabled = true;
this.flooroffsetmode.Items.AddRange(new object[] {
"Raise and lower",
"Raise only",
"Lower only"});
this.flooroffsetmode.Location = new System.Drawing.Point(102, 47);
this.flooroffsetmode.Name = "flooroffsetmode";
this.flooroffsetmode.Size = new System.Drawing.Size(112, 22);
this.flooroffsetmode.TabIndex = 36;
this.flooroffsetmode.SelectedIndexChanged += new System.EventHandler(this.flooroffsetmode_SelectedIndexChanged);
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(26, 51);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(70, 14);
this.label2.TabIndex = 35;
this.label2.Text = "Offset mode:";
//
// groupBox1
//
this.groupBox1.Controls.Add(this.positionJitterAmmount);
this.groupBox1.Controls.Add(this.bUpdateTranslation);
this.groupBox1.Location = new System.Drawing.Point(12, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(358, 54);
this.groupBox1.TabIndex = 37;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Position:";
//
// groupBox2
//
this.groupBox2.Controls.Add(this.ceilingHeightAmmount);
this.groupBox2.Controls.Add(this.bUpdateCeilingHeight);
this.groupBox2.Controls.Add(this.ceiloffsetmode);
this.groupBox2.Controls.Add(this.label1);
this.groupBox2.Controls.Add(this.cbUseCeilingVertexHeights);
this.groupBox2.Location = new System.Drawing.Point(12, 72);
this.groupBox2.Name = "groupBox2";
this.groupBox2.Size = new System.Drawing.Size(358, 100);
this.groupBox2.TabIndex = 38;
this.groupBox2.TabStop = false;
this.groupBox2.Text = "Ceiling:";
//
// groupBox3
//
this.groupBox3.Controls.Add(this.floorHeightAmmount);
this.groupBox3.Controls.Add(this.bUpdateFloorHeight);
this.groupBox3.Controls.Add(this.flooroffsetmode);
this.groupBox3.Controls.Add(this.cbUseFloorVertexHeights);
this.groupBox3.Controls.Add(this.label2);
this.groupBox3.Location = new System.Drawing.Point(12, 178);
this.groupBox3.Name = "groupBox3";
this.groupBox3.Size = new System.Drawing.Size(358, 100);
this.groupBox3.TabIndex = 35;
this.groupBox3.TabStop = false;
this.groupBox3.Text = "Floor:";
//
// groupBox4
//
this.groupBox4.Controls.Add(this.cbKeepExistingTextures);
this.groupBox4.Controls.Add(this.cbUpperTexStyle);
this.groupBox4.Controls.Add(this.cbLowerTexStyle);
this.groupBox4.Controls.Add(this.gbUpperTexture);
this.groupBox4.Controls.Add(this.gbLowerTexture);
this.groupBox4.Location = new System.Drawing.Point(12, 284);
this.groupBox4.Name = "groupBox4";
this.groupBox4.Size = new System.Drawing.Size(358, 236);
this.groupBox4.TabIndex = 39;
this.groupBox4.TabStop = false;
this.groupBox4.Text = "Textures:";
//
// JitterSectorsForm
//
this.AcceptButton = this.bApply;
this.AutoScaleDimensions = new System.Drawing.SizeF(96F, 96F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Dpi;
this.CancelButton = this.bCancel;
this.ClientSize = new System.Drawing.Size(382, 396);
this.Controls.Add(this.cbUseCeilingVertexHeights);
this.Controls.Add(this.cbUseFloorVertexHeights);
this.Controls.Add(this.cbKeepExistingTextures);
this.Controls.Add(this.gbLowerTexture);
this.Controls.Add(this.cbLowerTexStyle);
this.Controls.Add(this.cbUpperTexStyle);
this.Controls.Add(this.gbUpperTexture);
this.Controls.Add(this.floorHeightAmmount);
this.Controls.Add(this.ceilingHeightAmmount);
this.Controls.Add(this.positionJitterAmmount);
this.Controls.Add(this.bUpdateFloorHeight);
this.Controls.Add(this.bUpdateCeilingHeight);
this.Controls.Add(this.bUpdateTranslation);
this.ClientSize = new System.Drawing.Size(382, 553);
this.Controls.Add(this.groupBox4);
this.Controls.Add(this.groupBox3);
this.Controls.Add(this.groupBox2);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.bCancel);
this.Controls.Add(this.bApply);
this.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
@ -322,8 +413,14 @@
this.gbUpperTexture.PerformLayout();
this.gbLowerTexture.ResumeLayout(false);
this.gbLowerTexture.PerformLayout();
this.groupBox1.ResumeLayout(false);
this.groupBox2.ResumeLayout(false);
this.groupBox2.PerformLayout();
this.groupBox3.ResumeLayout(false);
this.groupBox3.PerformLayout();
this.groupBox4.ResumeLayout(false);
this.groupBox4.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -348,5 +445,13 @@
private System.Windows.Forms.CheckBox cbKeepExistingTextures;
private System.Windows.Forms.CheckBox cbUseFloorVertexHeights;
private System.Windows.Forms.CheckBox cbUseCeilingVertexHeights;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.ComboBox ceiloffsetmode;
private System.Windows.Forms.ComboBox flooroffsetmode;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.GroupBox groupBox2;
private System.Windows.Forms.GroupBox groupBox3;
private System.Windows.Forms.GroupBox groupBox4;
}
}

View file

@ -23,6 +23,8 @@ namespace CodeImp.DoomBuilder.BuilderEffects
private static bool keepExistingSideTextures = true;
private static bool useFloorVertexHeights;
private static bool useCeilingVertexHeights;
private static int storedceiloffsetmode;
private static int storedflooroffsetmode;
private struct TranslationOffsetVertexData
{
@ -282,6 +284,10 @@ namespace CodeImp.DoomBuilder.BuilderEffects
//set editing settings
cbKeepExistingTextures.Checked = keepExistingSideTextures;
ceiloffsetmode.SelectedIndex = storedceiloffsetmode;
flooroffsetmode.SelectedIndex = storedflooroffsetmode;
//vertex heights can not be set in non-UDMF maps
if (General.Map.UDMF) {
cbUseFloorVertexHeights.Checked = useFloorVertexHeights;
cbUseCeilingVertexHeights.Checked = useCeilingVertexHeights;
@ -398,12 +404,14 @@ namespace CodeImp.DoomBuilder.BuilderEffects
for(int i = 0; i < sectorData.Count; i++) {
curAmmount = ammount > sectorData[i].SafeDistance ? sectorData[i].SafeDistance : ammount;
if (sectorData[i].Triangular && useCeilingVertexHeights) {
if (sectorData[i].Triangular && cbUseCeilingVertexHeights.Checked) {
foreach(HeightOffsetVertexData vd in sectorData[i].Verts) {
vd.Vertex.ZCeiling = vd.InitialCeilingHeight + (float)Math.Floor(curAmmount * vd.JitterCeilingHeight);
vd.Vertex.ZCeiling = vd.InitialCeilingHeight - (float)Math.Floor(curAmmount
* ModifyByOffsetMode(vd.JitterCeilingHeight, ceiloffsetmode.SelectedIndex));
}
} else {
sectorData[i].Sector.CeilHeight = sectorData[i].InitialCeilingHeight - (int) Math.Floor(curAmmount * sectorData[i].JitterCeilingHeight);
sectorData[i].Sector.CeilHeight = sectorData[i].InitialCeilingHeight - (int)Math.Floor(curAmmount
* ModifyByOffsetMode(sectorData[i].JitterCeilingHeight, ceiloffsetmode.SelectedIndex));
}
}
@ -423,12 +431,14 @@ namespace CodeImp.DoomBuilder.BuilderEffects
for(int i = 0; i < sectorData.Count; i++) {
curAmmount = ammount > sectorData[i].SafeDistance ? sectorData[i].SafeDistance : ammount;
if (sectorData[i].Triangular && useFloorVertexHeights) {
if (sectorData[i].Triangular && cbUseFloorVertexHeights.Checked) {
foreach(HeightOffsetVertexData vd in sectorData[i].Verts) {
vd.Vertex.ZFloor = vd.InitialFloorHeight + (float)Math.Floor(curAmmount * vd.JitterFloorHeight);
vd.Vertex.ZFloor = vd.InitialFloorHeight + (float)Math.Floor(curAmmount
* ModifyByOffsetMode(vd.JitterFloorHeight, flooroffsetmode.SelectedIndex));
}
} else {
sectorData[i].Sector.FloorHeight = sectorData[i].InitialFloorHeight + (int) Math.Floor(curAmmount * sectorData[i].JitterFloorHeight);
sectorData[i].Sector.FloorHeight = sectorData[i].InitialFloorHeight + (int)Math.Floor(curAmmount
* ModifyByOffsetMode(sectorData[i].JitterFloorHeight, flooroffsetmode.SelectedIndex));
}
}
@ -442,6 +452,24 @@ namespace CodeImp.DoomBuilder.BuilderEffects
updateLowerTextures(cbLowerTexStyle.SelectedIndex, false);
}
private float ModifyByOffsetMode(float value, int mode)
{
switch (mode)
{
case 0: //Raise and lower
return value;
case 1: //Raise only
return Math.Abs(value);
case 2: //Lower only
return -Math.Abs(value);
default:
throw new NotImplementedException("JitterSectorsForm.ModifyByOffsetMode: got unknown mode (" + mode + ")");
}
}
private void updateVisualGeometry() {
foreach(VisualSector vs in visualSectors) vs.UpdateSectorGeometry(true);
foreach(VisualSector vs in visualSectors) vs.UpdateSectorData();
@ -542,11 +570,11 @@ namespace CodeImp.DoomBuilder.BuilderEffects
setUpperTexture(sd, textureName, textureName);
}
private static void setUpperTexture(SidedefData sd, string textureName, string otherTextureName) {
if(!keepExistingSideTextures || string.IsNullOrEmpty(sd.HighTexture) || sd.HighTexture == "-")
private void setUpperTexture(SidedefData sd, string textureName, string otherTextureName) {
if(!cbKeepExistingTextures.Checked || string.IsNullOrEmpty(sd.HighTexture) || sd.HighTexture == "-")
sd.Side.SetTextureHigh(textureName);
if(sd.UpdateTextureOnOtherSide && sd.Side.Other != null && (!keepExistingSideTextures || string.IsNullOrEmpty(sd.OtherHighTexture) || sd.OtherHighTexture == "-"))
if(sd.UpdateTextureOnOtherSide && sd.Side.Other != null && (!cbKeepExistingTextures.Checked || string.IsNullOrEmpty(sd.OtherHighTexture) || sd.OtherHighTexture == "-"))
sd.Side.Other.SetTextureHigh(otherTextureName);
}
@ -554,11 +582,11 @@ namespace CodeImp.DoomBuilder.BuilderEffects
setLowerTexture(sd, textureName, textureName);
}
private static void setLowerTexture(SidedefData sd, string textureName, string otherTextureName) {
if(!keepExistingSideTextures || string.IsNullOrEmpty(sd.LowTexture) || sd.LowTexture == "-")
private void setLowerTexture(SidedefData sd, string textureName, string otherTextureName) {
if(!cbKeepExistingTextures.Checked || string.IsNullOrEmpty(sd.LowTexture) || sd.LowTexture == "-")
sd.Side.SetTextureLow(textureName);
if(sd.UpdateTextureOnOtherSide && sd.Side.Other != null && (!keepExistingSideTextures || string.IsNullOrEmpty(sd.OtherLowTexture) || sd.OtherLowTexture == "-"))
if(sd.UpdateTextureOnOtherSide && sd.Side.Other != null && (!cbKeepExistingTextures.Checked || string.IsNullOrEmpty(sd.OtherLowTexture) || sd.OtherLowTexture == "-"))
sd.Side.Other.SetTextureLow(otherTextureName);
}
@ -608,6 +636,13 @@ namespace CodeImp.DoomBuilder.BuilderEffects
//EVENTS
private void bApply_Click(object sender, EventArgs e) {
//store settings
keepExistingSideTextures = cbKeepExistingTextures.Checked;
useFloorVertexHeights = cbUseFloorVertexHeights.Checked;
useCeilingVertexHeights = cbUseCeilingVertexHeights.Checked;
storedceiloffsetmode = ceiloffsetmode.SelectedIndex;
storedflooroffsetmode = flooroffsetmode.SelectedIndex;
// Clean unused sidedef textures
foreach(SidedefData sd in sidedefData) {
sd.Side.RemoveUnneededTextures(false);
@ -652,10 +687,8 @@ namespace CodeImp.DoomBuilder.BuilderEffects
}
private void cbKeepExistingTextures_CheckedChanged(object sender, EventArgs e) {
keepExistingSideTextures = cbKeepExistingTextures.Checked;
//revert possible changes
if(keepExistingSideTextures) {
if(cbKeepExistingTextures.Checked) {
foreach(SidedefData sd in sidedefData) {
if(!string.IsNullOrEmpty(sd.HighTexture))
sd.Side.SetTextureHigh(sd.HighTexture);
@ -673,10 +706,8 @@ namespace CodeImp.DoomBuilder.BuilderEffects
private void cbUseFloorVertexHeights_CheckedChanged(object sender, EventArgs e)
{
useFloorVertexHeights = cbUseFloorVertexHeights.Checked;
//Reset values?
if (!useFloorVertexHeights || floorHeightAmmount.Value == 0)
if(!cbUseFloorVertexHeights.Checked || floorHeightAmmount.Value == 0)
{
foreach (SectorData data in sectorData)
{
@ -692,10 +723,8 @@ namespace CodeImp.DoomBuilder.BuilderEffects
private void cbUseCeilingVertexHeights_CheckedChanged(object sender, EventArgs e)
{
useCeilingVertexHeights = cbUseCeilingVertexHeights.Checked;
//Reset values?
if(!useCeilingVertexHeights || ceilingHeightAmmount.Value == 0)
if(!cbUseCeilingVertexHeights.Checked || ceilingHeightAmmount.Value == 0)
{
foreach(SectorData data in sectorData)
{
@ -725,6 +754,17 @@ namespace CodeImp.DoomBuilder.BuilderEffects
applyFloorHeightJitter(floorHeightAmmount.Value);
}
//height offset modes
private void ceiloffsetmode_SelectedIndexChanged(object sender, EventArgs e)
{
applyCeilingHeightJitter(ceilingHeightAmmount.Value);
}
private void flooroffsetmode_SelectedIndexChanged(object sender, EventArgs e)
{
applyFloorHeightJitter(floorHeightAmmount.Value);
}
//texture pegging
private void cbPegTop_CheckedChanged(object sender, EventArgs e) {
if(cbPegTop.Checked) { //apply flag

View file

@ -354,6 +354,17 @@ namespace CodeImp.DoomBuilder.BuilderEffects
#region Events
private void bApply_Click(object sender, EventArgs e) {
// Store settings
relativePitch = cbRelativePitch.Checked;
relativeRoll = cbRelativeRoll.Checked;
relativeScale = cbRelativeScale.Checked;
allowNegativeScaleX = cbNegativeScaleX.Checked;
allowNegativeScaleY = cbNegativeScaleY.Checked;
uniformScale = cbUniformScale.Checked;
allowNegativePitch = cbNegativePitch.Checked;
allowNegativeRoll = cbNegativeRoll.Checked;
// Update
foreach(Thing t in selection) t.DetermineSector();
// Clear selection
@ -369,20 +380,8 @@ namespace CodeImp.DoomBuilder.BuilderEffects
}
private void JitterThingsForm_FormClosing(object sender, FormClosingEventArgs e) {
if (this.DialogResult == DialogResult.Cancel) {
//undo changes
General.Map.UndoRedo.WithdrawUndo();
} else {
//store settings
relativePitch = cbRelativePitch.Checked;
relativeRoll = cbRelativeRoll.Checked;
relativeScale = cbRelativeScale.Checked;
allowNegativeScaleX = cbNegativeScaleX.Checked;
allowNegativeScaleY = cbNegativeScaleY.Checked;
uniformScale = cbUniformScale.Checked;
allowNegativePitch = cbNegativePitch.Checked;
allowNegativeRoll = cbNegativeRoll.Checked;
}
if (this.DialogResult == DialogResult.Cancel)
General.Map.UndoRedo.WithdrawUndo(); //undo changes
}
private void positionJitterAmmount_OnValueChanged(object sender, EventArgs e) {