diff --git a/Build/Configurations/Includes/SRB222_common.cfg b/Build/Configurations/Includes/SRB222_common.cfg index 9a574d6f..39cae78c 100644 --- a/Build/Configurations/Includes/SRB222_common.cfg +++ b/Build/Configurations/Includes/SRB222_common.cfg @@ -38,7 +38,7 @@ common mixtexturesflats = true; defaulttexturescale = 1.0f; defaultflatscale = 1.0f; - scaledtextureoffsets = true; + scaledtextureoffsets = false; maxcolormapalpha = 25; diff --git a/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs b/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs index fd77c4d9..0ab12344 100644 --- a/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs +++ b/Source/Core/Windows/LinedefEditFormSRB2.Designer.cs @@ -38,6 +38,7 @@ namespace CodeImp.DoomBuilder.Windows System.Windows.Forms.Label labelRepeatcntBack; System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LinedefEditFormSRB2)); this.labelrenderstyle = new System.Windows.Forms.Label(); + this.labelLightFront = new System.Windows.Forms.Label(); this.cancel = new System.Windows.Forms.Button(); this.apply = new System.Windows.Forms.Button(); this.actiongroup = new System.Windows.Forms.GroupBox(); @@ -79,8 +80,14 @@ namespace CodeImp.DoomBuilder.Windows this.pfcFrontOffsetBottom = new CodeImp.DoomBuilder.Controls.PairedFieldsControl(); this.groupBox5 = new System.Windows.Forms.GroupBox(); this.repeatcntFront = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.lightfrontlower = new CodeImp.DoomBuilder.Controls.SidedefPartLightControl(); + this.lightfrontmiddle = new CodeImp.DoomBuilder.Controls.SidedefPartLightControl(); + this.lightfrontupper = new CodeImp.DoomBuilder.Controls.SidedefPartLightControl(); + this.resetfrontlight = new System.Windows.Forms.Button(); this.frontsector = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.customfrontbutton = new System.Windows.Forms.Button(); + this.lightFront = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.cbLightAbsoluteFront = new System.Windows.Forms.CheckBox(); this.frontlow = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.frontmid = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); this.fronthigh = new CodeImp.DoomBuilder.Controls.TextureSelectorControl(); @@ -89,8 +96,15 @@ namespace CodeImp.DoomBuilder.Windows this.backgroup = new System.Windows.Forms.GroupBox(); this.groupBox4 = new System.Windows.Forms.GroupBox(); this.repeatcntBack = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.lightbacklower = new CodeImp.DoomBuilder.Controls.SidedefPartLightControl(); + this.lightbackmiddle = new CodeImp.DoomBuilder.Controls.SidedefPartLightControl(); + this.lightbackupper = new CodeImp.DoomBuilder.Controls.SidedefPartLightControl(); + this.resetbacklight = new System.Windows.Forms.Button(); this.backsector = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.custombackbutton = new System.Windows.Forms.Button(); + this.lightBack = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); + this.labelLightBack = new System.Windows.Forms.Label(); + this.cbLightAbsoluteBack = new System.Windows.Forms.CheckBox(); this.backflagsgroup = new System.Windows.Forms.GroupBox(); this.flagsBack = new CodeImp.DoomBuilder.Controls.CheckboxArrayControl(); this.backscalegroup = new System.Windows.Forms.GroupBox(); @@ -219,6 +233,16 @@ namespace CodeImp.DoomBuilder.Windows this.labelrenderstyle.TabIndex = 11; this.labelrenderstyle.Text = "Render style:"; // + // labelLightFront + // + this.labelLightFront.Location = new System.Drawing.Point(15, 78); + this.labelLightFront.Name = "labelLightFront"; + this.labelLightFront.Size = new System.Drawing.Size(80, 14); + this.labelLightFront.TabIndex = 25; + this.labelLightFront.Tag = ""; + this.labelLightFront.Text = "Brightness:"; + this.labelLightFront.TextAlign = System.Drawing.ContentAlignment.TopRight; + // // cancel // this.cancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -285,7 +309,6 @@ namespace CodeImp.DoomBuilder.Windows this.argscontrol.Name = "argscontrol"; this.argscontrol.Size = new System.Drawing.Size(521, 173); this.argscontrol.TabIndex = 11; - this.argscontrol.Load += new System.EventHandler(this.argscontrol_Load); // // actionhelp // @@ -504,9 +527,9 @@ namespace CodeImp.DoomBuilder.Windows // frontflagsgroup // this.frontflagsgroup.Controls.Add(this.flagsFront); - this.frontflagsgroup.Location = new System.Drawing.Point(12, 409); + this.frontflagsgroup.Location = new System.Drawing.Point(12, 520); this.frontflagsgroup.Name = "frontflagsgroup"; - this.frontflagsgroup.Size = new System.Drawing.Size(290, 190); + this.frontflagsgroup.Size = new System.Drawing.Size(290, 80); this.frontflagsgroup.TabIndex = 45; this.frontflagsgroup.TabStop = false; this.frontflagsgroup.Text = " Flags "; @@ -521,7 +544,7 @@ namespace CodeImp.DoomBuilder.Windows this.flagsFront.Columns = 2; this.flagsFront.Location = new System.Drawing.Point(16, 16); this.flagsFront.Name = "flagsFront"; - this.flagsFront.Size = new System.Drawing.Size(269, 168); + this.flagsFront.Size = new System.Drawing.Size(269, 58); this.flagsFront.TabIndex = 0; this.flagsFront.VerticalSpacing = 3; this.flagsFront.OnValueChanged += new System.EventHandler(this.flagsFront_OnValueChanged); @@ -534,7 +557,7 @@ namespace CodeImp.DoomBuilder.Windows this.frontscalegroup.Controls.Add(this.pfcFrontScaleTop); this.frontscalegroup.Controls.Add(this.pfcFrontScaleBottom); this.frontscalegroup.Controls.Add(this.pfcFrontScaleMid); - this.frontscalegroup.Location = new System.Drawing.Point(12, 291); + this.frontscalegroup.Location = new System.Drawing.Point(12, 402); this.frontscalegroup.Name = "frontscalegroup"; this.frontscalegroup.Size = new System.Drawing.Size(290, 112); this.frontscalegroup.TabIndex = 44; @@ -638,7 +661,7 @@ namespace CodeImp.DoomBuilder.Windows this.groupBox6.Controls.Add(this.labelFrontOffsetTop); this.groupBox6.Controls.Add(this.pfcFrontOffsetMid); this.groupBox6.Controls.Add(this.pfcFrontOffsetBottom); - this.groupBox6.Location = new System.Drawing.Point(12, 142); + this.groupBox6.Location = new System.Drawing.Point(12, 253); this.groupBox6.Name = "groupBox6"; this.groupBox6.Size = new System.Drawing.Size(290, 143); this.groupBox6.TabIndex = 43; @@ -759,12 +782,19 @@ namespace CodeImp.DoomBuilder.Windows // this.groupBox5.Controls.Add(this.repeatcntFront); this.groupBox5.Controls.Add(labelRepeatcntFront); + this.groupBox5.Controls.Add(this.lightfrontlower); + this.groupBox5.Controls.Add(this.lightfrontmiddle); + this.groupBox5.Controls.Add(this.lightfrontupper); + this.groupBox5.Controls.Add(this.resetfrontlight); this.groupBox5.Controls.Add(this.frontsector); this.groupBox5.Controls.Add(label11); this.groupBox5.Controls.Add(this.customfrontbutton); + this.groupBox5.Controls.Add(this.lightFront); + this.groupBox5.Controls.Add(this.labelLightFront); + this.groupBox5.Controls.Add(this.cbLightAbsoluteFront); this.groupBox5.Location = new System.Drawing.Point(12, 19); this.groupBox5.Name = "groupBox5"; - this.groupBox5.Size = new System.Drawing.Size(290, 117); + this.groupBox5.Size = new System.Drawing.Size(290, 228); this.groupBox5.TabIndex = 42; this.groupBox5.TabStop = false; // @@ -780,13 +810,45 @@ namespace CodeImp.DoomBuilder.Windows this.repeatcntFront.ButtonStepSmall = 1F; this.repeatcntFront.ButtonStepsUseModifierKeys = true; this.repeatcntFront.ButtonStepsWrapAround = false; - this.repeatcntFront.Location = new System.Drawing.Point(96, 47); + this.repeatcntFront.Location = new System.Drawing.Point(99, 47); this.repeatcntFront.Name = "repeatcntFront"; - this.repeatcntFront.Size = new System.Drawing.Size(65, 24); + this.repeatcntFront.Size = new System.Drawing.Size(62, 24); this.repeatcntFront.StepValues = null; this.repeatcntFront.TabIndex = 74; this.repeatcntFront.WhenTextChanged += new System.EventHandler(this.repeatcntFront_WhenTextChanged); // + // lightfrontlower + // + this.lightfrontlower.Location = new System.Drawing.Point(0, 162); + this.lightfrontlower.Name = "lightfrontlower"; + this.lightfrontlower.Size = new System.Drawing.Size(262, 29); + this.lightfrontlower.TabIndex = 29; + // + // lightfrontmiddle + // + this.lightfrontmiddle.Location = new System.Drawing.Point(0, 132); + this.lightfrontmiddle.Name = "lightfrontmiddle"; + this.lightfrontmiddle.Size = new System.Drawing.Size(262, 29); + this.lightfrontmiddle.TabIndex = 29; + // + // lightfrontupper + // + this.lightfrontupper.Location = new System.Drawing.Point(0, 102); + this.lightfrontupper.Name = "lightfrontupper"; + this.lightfrontupper.Size = new System.Drawing.Size(262, 29); + this.lightfrontupper.TabIndex = 29; + // + // resetfrontlight + // + this.resetfrontlight.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset; + this.resetfrontlight.Location = new System.Drawing.Point(236, 75); + this.resetfrontlight.Name = "resetfrontlight"; + this.resetfrontlight.Size = new System.Drawing.Size(23, 23); + this.resetfrontlight.TabIndex = 28; + this.tooltip.SetToolTip(this.resetfrontlight, "Reset Front Brightness"); + this.resetfrontlight.UseVisualStyleBackColor = true; + this.resetfrontlight.Click += new System.EventHandler(this.resetfrontlight_Click); + // // frontsector // this.frontsector.AllowDecimal = false; @@ -799,7 +861,7 @@ namespace CodeImp.DoomBuilder.Windows this.frontsector.ButtonStepSmall = 0.1F; this.frontsector.ButtonStepsUseModifierKeys = false; this.frontsector.ButtonStepsWrapAround = false; - this.frontsector.Location = new System.Drawing.Point(96, 19); + this.frontsector.Location = new System.Drawing.Point(99, 19); this.frontsector.Name = "frontsector"; this.frontsector.Size = new System.Drawing.Size(130, 24); this.frontsector.StepValues = null; @@ -807,7 +869,7 @@ namespace CodeImp.DoomBuilder.Windows // // customfrontbutton // - this.customfrontbutton.Location = new System.Drawing.Point(96, 79); + this.customfrontbutton.Location = new System.Drawing.Point(96, 195); this.customfrontbutton.Name = "customfrontbutton"; this.customfrontbutton.Size = new System.Drawing.Size(130, 25); this.customfrontbutton.TabIndex = 3; @@ -815,6 +877,38 @@ namespace CodeImp.DoomBuilder.Windows this.customfrontbutton.UseVisualStyleBackColor = true; this.customfrontbutton.Click += new System.EventHandler(this.customfrontbutton_Click); // + // lightFront + // + this.lightFront.AllowDecimal = false; + this.lightFront.AllowExpressions = false; + this.lightFront.AllowNegative = true; + this.lightFront.AllowRelative = true; + this.lightFront.ButtonStep = 16; + this.lightFront.ButtonStepBig = 32F; + this.lightFront.ButtonStepFloat = 1F; + this.lightFront.ButtonStepSmall = 1F; + this.lightFront.ButtonStepsUseModifierKeys = true; + this.lightFront.ButtonStepsWrapAround = false; + this.lightFront.Location = new System.Drawing.Point(99, 74); + this.lightFront.Name = "lightFront"; + this.lightFront.Size = new System.Drawing.Size(62, 24); + this.lightFront.StepValues = null; + this.lightFront.TabIndex = 26; + this.lightFront.Tag = ""; + this.lightFront.WhenTextChanged += new System.EventHandler(this.lightFront_WhenTextChanged); + // + // cbLightAbsoluteFront + // + this.cbLightAbsoluteFront.AutoSize = true; + this.cbLightAbsoluteFront.Location = new System.Drawing.Point(167, 79); + this.cbLightAbsoluteFront.Name = "cbLightAbsoluteFront"; + this.cbLightAbsoluteFront.Size = new System.Drawing.Size(67, 17); + this.cbLightAbsoluteFront.TabIndex = 27; + this.cbLightAbsoluteFront.Tag = "lightabsolute"; + this.cbLightAbsoluteFront.Text = "Absolute"; + this.cbLightAbsoluteFront.UseVisualStyleBackColor = true; + this.cbLightAbsoluteFront.CheckedChanged += new System.EventHandler(this.cbLightAbsoluteFront_CheckedChanged); + // // frontlow // this.frontlow.Location = new System.Drawing.Point(309, 409); @@ -897,12 +991,19 @@ namespace CodeImp.DoomBuilder.Windows // this.groupBox4.Controls.Add(this.repeatcntBack); this.groupBox4.Controls.Add(labelRepeatcntBack); + this.groupBox4.Controls.Add(this.lightbacklower); + this.groupBox4.Controls.Add(this.lightbackmiddle); + this.groupBox4.Controls.Add(this.lightbackupper); + this.groupBox4.Controls.Add(this.resetbacklight); this.groupBox4.Controls.Add(this.backsector); this.groupBox4.Controls.Add(label12); this.groupBox4.Controls.Add(this.custombackbutton); + this.groupBox4.Controls.Add(this.lightBack); + this.groupBox4.Controls.Add(this.labelLightBack); + this.groupBox4.Controls.Add(this.cbLightAbsoluteBack); this.groupBox4.Location = new System.Drawing.Point(12, 19); this.groupBox4.Name = "groupBox4"; - this.groupBox4.Size = new System.Drawing.Size(290, 117); + this.groupBox4.Size = new System.Drawing.Size(290, 228); this.groupBox4.TabIndex = 46; this.groupBox4.TabStop = false; // @@ -918,13 +1019,45 @@ namespace CodeImp.DoomBuilder.Windows this.repeatcntBack.ButtonStepSmall = 1F; this.repeatcntBack.ButtonStepsUseModifierKeys = true; this.repeatcntBack.ButtonStepsWrapAround = false; - this.repeatcntBack.Location = new System.Drawing.Point(96, 47); + this.repeatcntBack.Location = new System.Drawing.Point(99, 47); this.repeatcntBack.Name = "repeatcntBack"; - this.repeatcntBack.Size = new System.Drawing.Size(65, 24); + this.repeatcntBack.Size = new System.Drawing.Size(62, 24); this.repeatcntBack.StepValues = null; this.repeatcntBack.TabIndex = 76; this.repeatcntBack.WhenTextChanged += new System.EventHandler(this.repeatcntBack_WhenTextChanged); // + // lightbacklower + // + this.lightbacklower.Location = new System.Drawing.Point(0, 162); + this.lightbacklower.Name = "lightbacklower"; + this.lightbacklower.Size = new System.Drawing.Size(262, 29); + this.lightbacklower.TabIndex = 32; + // + // lightbackmiddle + // + this.lightbackmiddle.Location = new System.Drawing.Point(0, 132); + this.lightbackmiddle.Name = "lightbackmiddle"; + this.lightbackmiddle.Size = new System.Drawing.Size(262, 29); + this.lightbackmiddle.TabIndex = 33; + // + // lightbackupper + // + this.lightbackupper.Location = new System.Drawing.Point(0, 102); + this.lightbackupper.Name = "lightbackupper"; + this.lightbackupper.Size = new System.Drawing.Size(262, 29); + this.lightbackupper.TabIndex = 34; + // + // resetbacklight + // + this.resetbacklight.Image = global::CodeImp.DoomBuilder.Properties.Resources.Reset; + this.resetbacklight.Location = new System.Drawing.Point(236, 75); + this.resetbacklight.Name = "resetbacklight"; + this.resetbacklight.Size = new System.Drawing.Size(23, 23); + this.resetbacklight.TabIndex = 31; + this.tooltip.SetToolTip(this.resetbacklight, "Reset Back Brightness"); + this.resetbacklight.UseVisualStyleBackColor = true; + this.resetbacklight.Click += new System.EventHandler(this.resetbacklight_Click); + // // backsector // this.backsector.AllowDecimal = false; @@ -937,7 +1070,7 @@ namespace CodeImp.DoomBuilder.Windows this.backsector.ButtonStepSmall = 0.1F; this.backsector.ButtonStepsUseModifierKeys = false; this.backsector.ButtonStepsWrapAround = false; - this.backsector.Location = new System.Drawing.Point(96, 19); + this.backsector.Location = new System.Drawing.Point(99, 19); this.backsector.Name = "backsector"; this.backsector.Size = new System.Drawing.Size(130, 24); this.backsector.StepValues = null; @@ -945,7 +1078,8 @@ namespace CodeImp.DoomBuilder.Windows // // custombackbutton // - this.custombackbutton.Location = new System.Drawing.Point(96, 79); + this.custombackbutton.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.custombackbutton.Location = new System.Drawing.Point(96, 195); this.custombackbutton.Name = "custombackbutton"; this.custombackbutton.Size = new System.Drawing.Size(130, 25); this.custombackbutton.TabIndex = 3; @@ -953,12 +1087,54 @@ namespace CodeImp.DoomBuilder.Windows this.custombackbutton.UseVisualStyleBackColor = true; this.custombackbutton.Click += new System.EventHandler(this.custombackbutton_Click); // + // lightBack + // + this.lightBack.AllowDecimal = false; + this.lightBack.AllowExpressions = false; + this.lightBack.AllowNegative = true; + this.lightBack.AllowRelative = true; + this.lightBack.ButtonStep = 1; + this.lightBack.ButtonStepBig = 16F; + this.lightBack.ButtonStepFloat = 1F; + this.lightBack.ButtonStepSmall = 1F; + this.lightBack.ButtonStepsUseModifierKeys = true; + this.lightBack.ButtonStepsWrapAround = false; + this.lightBack.Location = new System.Drawing.Point(99, 74); + this.lightBack.Name = "lightBack"; + this.lightBack.Size = new System.Drawing.Size(62, 24); + this.lightBack.StepValues = null; + this.lightBack.TabIndex = 29; + this.lightBack.Tag = "light"; + this.lightBack.WhenTextChanged += new System.EventHandler(this.lightBack_WhenTextChanged); + // + // labelLightBack + // + this.labelLightBack.Location = new System.Drawing.Point(15, 78); + this.labelLightBack.Name = "labelLightBack"; + this.labelLightBack.Size = new System.Drawing.Size(80, 14); + this.labelLightBack.TabIndex = 28; + this.labelLightBack.Tag = ""; + this.labelLightBack.Text = "Brightness:"; + this.labelLightBack.TextAlign = System.Drawing.ContentAlignment.TopRight; + // + // cbLightAbsoluteBack + // + this.cbLightAbsoluteBack.AutoSize = true; + this.cbLightAbsoluteBack.Location = new System.Drawing.Point(167, 79); + this.cbLightAbsoluteBack.Name = "cbLightAbsoluteBack"; + this.cbLightAbsoluteBack.Size = new System.Drawing.Size(67, 17); + this.cbLightAbsoluteBack.TabIndex = 30; + this.cbLightAbsoluteBack.Tag = "lightabsolute"; + this.cbLightAbsoluteBack.Text = "Absolute"; + this.cbLightAbsoluteBack.UseVisualStyleBackColor = true; + this.cbLightAbsoluteBack.CheckedChanged += new System.EventHandler(this.cbLightAbsoluteBack_CheckedChanged); + // // backflagsgroup // this.backflagsgroup.Controls.Add(this.flagsBack); - this.backflagsgroup.Location = new System.Drawing.Point(12, 409); + this.backflagsgroup.Location = new System.Drawing.Point(12, 520); this.backflagsgroup.Name = "backflagsgroup"; - this.backflagsgroup.Size = new System.Drawing.Size(290, 190); + this.backflagsgroup.Size = new System.Drawing.Size(290, 80); this.backflagsgroup.TabIndex = 45; this.backflagsgroup.TabStop = false; this.backflagsgroup.Text = " Flags "; @@ -973,7 +1149,7 @@ namespace CodeImp.DoomBuilder.Windows this.flagsBack.Columns = 2; this.flagsBack.Location = new System.Drawing.Point(16, 16); this.flagsBack.Name = "flagsBack"; - this.flagsBack.Size = new System.Drawing.Size(269, 168); + this.flagsBack.Size = new System.Drawing.Size(269, 87); this.flagsBack.TabIndex = 1; this.flagsBack.VerticalSpacing = 3; this.flagsBack.OnValueChanged += new System.EventHandler(this.flagsBack_OnValueChanged); @@ -986,7 +1162,7 @@ namespace CodeImp.DoomBuilder.Windows this.backscalegroup.Controls.Add(this.pfcBackScaleTop); this.backscalegroup.Controls.Add(this.pfcBackScaleBottom); this.backscalegroup.Controls.Add(this.pfcBackScaleMid); - this.backscalegroup.Location = new System.Drawing.Point(12, 291); + this.backscalegroup.Location = new System.Drawing.Point(12, 402); this.backscalegroup.Name = "backscalegroup"; this.backscalegroup.Size = new System.Drawing.Size(290, 112); this.backscalegroup.TabIndex = 44; @@ -1090,7 +1266,7 @@ namespace CodeImp.DoomBuilder.Windows this.groupBox1.Controls.Add(this.pfcBackOffsetMid); this.groupBox1.Controls.Add(this.pfcBackOffsetBottom); this.groupBox1.Controls.Add(this.backTextureOffset); - this.groupBox1.Location = new System.Drawing.Point(12, 142); + this.groupBox1.Location = new System.Drawing.Point(12, 253); this.groupBox1.Name = "groupBox1"; this.groupBox1.Size = new System.Drawing.Size(290, 143); this.groupBox1.TabIndex = 43; @@ -1381,6 +1557,8 @@ namespace CodeImp.DoomBuilder.Windows private System.Windows.Forms.Button custombackbutton; private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox frontsector; private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox backsector; + private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox lightFront; + private System.Windows.Forms.CheckBox cbLightAbsoluteFront; private CodeImp.DoomBuilder.Controls.PairedFieldsControl pfcFrontOffsetTop; private CodeImp.DoomBuilder.Controls.PairedFieldsControl pfcFrontOffsetBottom; private CodeImp.DoomBuilder.Controls.PairedFieldsControl pfcFrontOffsetMid; @@ -1395,6 +1573,10 @@ namespace CodeImp.DoomBuilder.Windows private CodeImp.DoomBuilder.Controls.PairedFieldsControl pfcBackOffsetTop; private System.Windows.Forms.GroupBox groupsettings; private System.Windows.Forms.ComboBox renderStyle; + private System.Windows.Forms.Label labelLightFront; + private System.Windows.Forms.CheckBox cbLightAbsoluteBack; + private System.Windows.Forms.Label labelLightBack; + private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox lightBack; private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox alpha; private CodeImp.DoomBuilder.Controls.PairedIntControl frontTextureOffset; private CodeImp.DoomBuilder.Controls.PairedIntControl backTextureOffset; @@ -1431,7 +1613,15 @@ namespace CodeImp.DoomBuilder.Windows private CodeImp.DoomBuilder.Controls.CommentEditor commenteditor; private CodeImp.DoomBuilder.Controls.ArgumentsControlSRB2 argscontrol; private CodeImp.DoomBuilder.Controls.TagsSelector tagsselector; + private System.Windows.Forms.Button resetfrontlight; + private System.Windows.Forms.Button resetbacklight; private System.Windows.Forms.Button resetalpha; + private Controls.SidedefPartLightControl lightfrontupper; + private Controls.SidedefPartLightControl lightfrontlower; + private Controls.SidedefPartLightControl lightfrontmiddle; + private Controls.SidedefPartLightControl lightbacklower; + private Controls.SidedefPartLightControl lightbackmiddle; + private Controls.SidedefPartLightControl lightbackupper; private Controls.ButtonsNumericTextbox executordelay; private Controls.ButtonsNumericTextbox repeatcntFront; private Controls.ButtonsNumericTextbox repeatcntBack; diff --git a/Source/Core/Windows/LinedefEditFormSRB2.cs b/Source/Core/Windows/LinedefEditFormSRB2.cs index 8f546ca6..22b025e7 100644 --- a/Source/Core/Windows/LinedefEditFormSRB2.cs +++ b/Source/Core/Windows/LinedefEditFormSRB2.cs @@ -207,8 +207,18 @@ namespace CodeImp.DoomBuilder.Windows pfcBackScaleMid.LinkValues = General.Settings.ReadSetting("windows." + configname + ".linkbackmidscale", false); pfcBackScaleBottom.LinkValues = General.Settings.ReadSetting("windows." + configname + ".linkbackbottomscale", false); + // Upper/middle/lower brightness of front sidedef + lightfrontupper.Setup(VisualModes.VisualGeometryType.WALL_UPPER); + lightfrontmiddle.Setup(VisualModes.VisualGeometryType.WALL_MIDDLE); + lightfrontlower.Setup(VisualModes.VisualGeometryType.WALL_LOWER); + + // Upper/middle/lower brightness of back sidedef + lightbackupper.Setup(VisualModes.VisualGeometryType.WALL_UPPER); + lightbackmiddle.Setup(VisualModes.VisualGeometryType.WALL_MIDDLE); + lightbacklower.Setup(VisualModes.VisualGeometryType.WALL_LOWER); + // Disable top/mid/bottom texture offset controls? - if(!General.Map.Config.UseLocalSidedefTextureOffsets) + if (!General.Map.Config.UseLocalSidedefTextureOffsets) { pfcFrontOffsetTop.Enabled = false; pfcFrontOffsetMid.Enabled = false; @@ -227,21 +237,17 @@ namespace CodeImp.DoomBuilder.Windows labelBackOffsetBottom.Enabled = false; } - pfcFrontScaleTop.Enabled = false; - pfcFrontScaleMid.Enabled = false; - pfcFrontScaleBottom.Enabled = false; + // Diable brightness controls? + if (!General.Map.Config.DistinctWallBrightness) + { + lightFront.Enabled = false; + cbLightAbsoluteFront.Enabled = false; + resetfrontlight.Enabled = false; - pfcBackScaleTop.Enabled = false; - pfcBackScaleMid.Enabled = false; - pfcBackScaleBottom.Enabled = false; - - labelFrontScaleTop.Enabled = false; - labelFrontScaleMid.Enabled = false; - labelFrontScaleBottom.Enabled = false; - - labelBackScaleTop.Enabled = false; - labelBackScaleMid.Enabled = false; - labelBackScaleBottom.Enabled = false; + lightBack.Enabled = false; + cbLightAbsoluteBack.Enabled = false; + resetbacklight.Enabled = false; + } } #endregion @@ -331,9 +337,17 @@ namespace CodeImp.DoomBuilder.Windows pfc.SetValuesFrom(fl.Front.Fields, true); repeatcntFront.Text = UniFields.GetInteger(fl.Front.Fields, "repeatcnt", 0).ToString(); + + lightFront.Text = UniFields.GetInteger(fl.Front.Fields, "light", 0).ToString(); + cbLightAbsoluteFront.Checked = fl.Front.Fields.GetValue("lightabsolute", false); frontTextureOffset.SetValues(fl.Front.OffsetX, fl.Front.OffsetY, true); //mxd + // Upper/middle/lower brightness of front sidedef + lightfrontupper.SetValues(fl.Front, true); + lightfrontmiddle.SetValues(fl.Front, true); + lightfrontlower.SetValues(fl.Front, true); + } // Back settings @@ -357,7 +371,15 @@ namespace CodeImp.DoomBuilder.Windows repeatcntBack.Text = UniFields.GetInteger(fl.Back.Fields, "repeatcnt", 0).ToString(); + lightBack.Text = UniFields.GetInteger(fl.Back.Fields, "light", 0).ToString(); + cbLightAbsoluteBack.Checked = fl.Back.Fields.GetValue("lightabsolute", false); + backTextureOffset.SetValues(fl.Back.OffsetX, fl.Back.OffsetY, true); //mxd + + // Upper/middle/lower brightness of back sidedef + lightbackupper.SetValues(fl.Back, true); + lightbackmiddle.SetValues(fl.Back, true); + lightbacklower.SetValues(fl.Back, true); } //////////////////////////////////////////////////////////////////////// @@ -467,7 +489,18 @@ namespace CodeImp.DoomBuilder.Windows if (repeatcnt != repeatcntFront.GetResult(repeatcnt)) repeatcntFront.Text = string.Empty; } + if (l.Front.Fields.GetValue("lightabsolute", false) != cbLightAbsoluteFront.Checked) + { + cbLightAbsoluteFront.ThreeState = true; + cbLightAbsoluteFront.CheckState = CheckState.Indeterminate; + } + frontTextureOffset.SetValues(l.Front.OffsetX, l.Front.OffsetY, false); //mxd + + // Upper/middle/lower brightness of front sidedef + lightfrontupper.SetValues(l.Front, false); + lightfrontmiddle.SetValues(l.Front, false); + lightfrontlower.SetValues(l.Front, false); } // Back settings @@ -515,7 +548,25 @@ namespace CodeImp.DoomBuilder.Windows if (repeatcnt != repeatcntBack.GetResult(repeatcnt)) repeatcntBack.Text = string.Empty; } + if (!string.IsNullOrEmpty(lightBack.Text)) + { + int light = UniFields.GetInteger(l.Back.Fields, "light", 0); + if (light != lightBack.GetResult(light)) + lightBack.Text = string.Empty; + } + + if (l.Back.Fields.GetValue("lightabsolute", false) != cbLightAbsoluteBack.Checked) + { + cbLightAbsoluteBack.ThreeState = true; + cbLightAbsoluteBack.CheckState = CheckState.Indeterminate; + } + backTextureOffset.SetValues(l.Back.OffsetX, l.Back.OffsetY, false); //mxd + + // Upper/middle/lower brightness of back sidedef + lightbackupper.SetValues(l.Back, false); + lightbackmiddle.SetValues(l.Back, false); + lightbacklower.SetValues(l.Back, false); } //mxd @@ -540,11 +591,23 @@ namespace CodeImp.DoomBuilder.Windows commenteditor.FinishSetup(); //mxd //mxd. Update "Reset" buttons - if(alpha.Text == "1") resetalpha.Visible = false; + resetfrontlight.Visible = (cbLightAbsoluteFront.CheckState != CheckState.Unchecked || lightFront.GetResult(0) != 0); + resetbacklight.Visible = (cbLightAbsoluteBack.CheckState != CheckState.Unchecked || lightBack.GetResult(0) != 0); + if (alpha.Text == "1") resetalpha.Visible = false; + + // Upper/middle/lower brightness of front sidedef + lightfrontupper.FinalizeSetup(); + lightfrontmiddle.FinalizeSetup(); + lightfrontlower.FinalizeSetup(); + + // Upper/middle/lower brightness of back sidedef + lightbackupper.FinalizeSetup(); + lightbackmiddle.FinalizeSetup(); + lightbacklower.FinalizeSetup(); } //mxd - private void MakeUndo() + public void MakeUndo() { if(undocreated) return; undocreated = true; @@ -952,6 +1015,10 @@ namespace CodeImp.DoomBuilder.Windows repeatcntFront.Text = UniFields.GetInteger(fs.Fields, "repeatcnt", 0).ToString(); + lightFront.Text = UniFields.GetInteger(fs.Fields, "light", 0).ToString(); + cbLightAbsoluteFront.ThreeState = false; + cbLightAbsoluteFront.Checked = fs.Fields.GetValue("lightabsolute", false); + //flags foreach (CheckBox c in flagsFront.Checkboxes) if(fs.Flags.ContainsKey(c.Tag.ToString())) c.Checked = fs.Flags[c.Tag.ToString()]; @@ -968,6 +1035,18 @@ namespace CodeImp.DoomBuilder.Windows if (repeatcnt != repeatcntFront.GetResult(repeatcnt)) repeatcntFront.Text = string.Empty; } + if (!string.IsNullOrEmpty(lightFront.Text)) + { + int light = UniFields.GetInteger(s.Fields, "light", 0); + if (light != lightFront.GetResult(light)) lightFront.Text = string.Empty; + } + + if (s.Fields.GetValue("lightabsolute", false) != cbLightAbsoluteFront.Checked) + { + cbLightAbsoluteFront.ThreeState = true; + cbLightAbsoluteFront.CheckState = CheckState.Indeterminate; + } + //flags foreach (CheckBox c in flagsFront.Checkboxes) { @@ -1007,6 +1086,10 @@ namespace CodeImp.DoomBuilder.Windows repeatcntBack.Text = UniFields.GetInteger(fs.Fields, "repeatcnt", 0).ToString(); + lightBack.Text = UniFields.GetInteger(fs.Fields, "light", 0).ToString(); + cbLightAbsoluteBack.ThreeState = false; + cbLightAbsoluteBack.Checked = fs.Fields.GetValue("lightabsolute", false); + //flags foreach (CheckBox c in flagsBack.Checkboxes) if(fs.Flags.ContainsKey(c.Tag.ToString())) c.Checked = fs.Flags[c.Tag.ToString()]; @@ -1023,6 +1106,18 @@ namespace CodeImp.DoomBuilder.Windows if (repeatcnt != repeatcntBack.GetResult(repeatcnt)) repeatcntBack.Text = string.Empty; } + if (!string.IsNullOrEmpty(lightBack.Text)) + { + int light = UniFields.GetInteger(s.Fields, "light", 0); + if (light != lightBack.GetResult(light)) lightBack.Text = string.Empty; + } + + if (s.Fields.GetValue("lightabsolute", false) != cbLightAbsoluteBack.Checked) + { + cbLightAbsoluteBack.ThreeState = true; + cbLightAbsoluteBack.CheckState = CheckState.Indeterminate; + } + //flags foreach (CheckBox c in flagsBack.Checkboxes) { @@ -1230,9 +1325,248 @@ namespace CodeImp.DoomBuilder.Windows if(OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); } - #endregion + #endregion - #region Global texture offsets changed + #region Brightness changed + + private void lightFront_WhenTextChanged(object sender, EventArgs e) + { + if (preventchanges) return; + MakeUndo(); //mxd + int i = 0; + + // Reset increment steps, otherwise it's just keep counting and counting + lightFront.ResetIncrementStep(); + + //restore values + if (string.IsNullOrEmpty(lightFront.Text)) + { + foreach (Linedef l in lines) + { + if (l.Front != null) + UniFields.SetInteger(l.Front.Fields, "light", (linedefprops[i].Front != null ? linedefprops[i].Front.Brightness : 0), 0); + i++; + } + } + else //update values + { + foreach (Linedef l in lines) + { + if (l.Front != null) + { + bool absolute = false; + switch (cbLightAbsoluteFront.CheckState) + { + case CheckState.Indeterminate: + absolute = l.Front.Fields.GetValue("lightabsolute", false); + break; + case CheckState.Checked: + absolute = true; + break; + } + + int value = General.Clamp(lightFront.GetResult((linedefprops[i].Front != null ? linedefprops[i].Front.Brightness : 0)), (absolute ? 0 : -255), 255); + UniFields.SetInteger(l.Front.Fields, "light", value, 0); + } + i++; + } + } + + resetfrontlight.Visible = (cbLightAbsoluteFront.CheckState != CheckState.Unchecked || lightFront.Text != "0"); + General.Map.IsChanged = true; + if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); + } + + private void lightBack_WhenTextChanged(object sender, EventArgs e) + { + if (preventchanges) return; + MakeUndo(); //mxd + int i = 0; + + //restore values + if (string.IsNullOrEmpty(lightBack.Text)) + { + foreach (Linedef l in lines) + { + if (l.Back != null) + UniFields.SetInteger(l.Back.Fields, "light", (linedefprops[i].Back != null ? linedefprops[i].Back.Brightness : 0), 0); + i++; + } + } + else //update values + { + foreach (Linedef l in lines) + { + if (l.Back != null) + { + bool absolute = false; + switch (cbLightAbsoluteBack.CheckState) + { + case CheckState.Indeterminate: + absolute = l.Back.Fields.GetValue("lightabsolute", false); + break; + case CheckState.Checked: + absolute = true; + break; + } + + int value = General.Clamp(lightBack.GetResult((linedefprops[i].Back != null ? linedefprops[i].Back.Brightness : 0)), (absolute ? 0 : -255), 255); + UniFields.SetInteger(l.Back.Fields, "light", value, 0); + } + i++; + } + } + + resetbacklight.Visible = (cbLightAbsoluteBack.CheckState != CheckState.Unchecked || lightBack.Text != "0"); + General.Map.IsChanged = true; + if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); + } + + private void cbLightAbsoluteFront_CheckedChanged(object sender, EventArgs e) + { + if (preventchanges) return; + MakeUndo(); //mxd + + if (cbLightAbsoluteFront.Checked) + { + foreach (Linedef l in lines) + { + if (l.Front == null) continue; + l.Front.Fields["lightabsolute"] = new UniValue(UniversalType.Boolean, true); + } + } + else if (cbLightAbsoluteFront.CheckState == CheckState.Indeterminate) + { + int i = 0; + + foreach (Linedef l in lines) + { + if (l.Front != null) + { + if (linedefprops[i].Front != null && linedefprops[i].Front.AbsoluteBrightness) + { + l.Front.Fields["lightabsolute"] = new UniValue(UniversalType.Boolean, true); + } + else if (l.Front.Fields.ContainsKey("lightabsolute")) + { + l.Front.Fields.Remove("lightabsolute"); + } + } + i++; + } + } + else + { + foreach (Linedef l in lines) + { + if (l.Front == null) continue; + if (l.Front.Fields.ContainsKey("lightabsolute")) l.Front.Fields.Remove("lightabsolute"); + } + } + + resetfrontlight.Visible = (cbLightAbsoluteFront.CheckState != CheckState.Unchecked || lightFront.Text != "0"); + General.Map.IsChanged = true; + if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); + } + + private void cbLightAbsoluteBack_CheckedChanged(object sender, EventArgs e) + { + if (preventchanges) return; + MakeUndo(); //mxd + + if (cbLightAbsoluteBack.Checked) + { + foreach (Linedef l in lines) + { + if (l.Back == null) continue; + l.Back.Fields["lightabsolute"] = new UniValue(UniversalType.Boolean, true); + } + } + else if (cbLightAbsoluteBack.CheckState == CheckState.Indeterminate) + { + int i = 0; + + foreach (Linedef l in lines) + { + if (l.Back != null) + { + if (linedefprops[i].Back != null && linedefprops[i].Back.AbsoluteBrightness) + { + l.Back.Fields["lightabsolute"] = new UniValue(UniversalType.Boolean, true); + } + else if (l.Back.Fields.ContainsKey("lightabsolute")) + { + l.Back.Fields.Remove("lightabsolute"); + } + } + i++; + } + } + else + { + foreach (Linedef l in lines) + { + if (l.Back == null) continue; + if (l.Back.Fields.ContainsKey("lightabsolute")) l.Back.Fields.Remove("lightabsolute"); + } + } + + resetbacklight.Visible = (cbLightAbsoluteBack.CheckState != CheckState.Unchecked || lightBack.Text != "0"); + General.Map.IsChanged = true; + if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); + } + + private void resetfrontlight_Click(object sender, EventArgs e) + { + MakeUndo(); //mxd + + preventchanges = true; + + cbLightAbsoluteFront.Checked = false; + lightFront.Text = "0"; + + foreach (Linedef l in lines) + { + if (l.Front == null) continue; + if (l.Front.Fields.ContainsKey("lightabsolute")) l.Front.Fields.Remove("lightabsolute"); + if (l.Front.Fields.ContainsKey("light")) l.Front.Fields.Remove("light"); + } + + preventchanges = false; + + resetfrontlight.Visible = false; + lightFront.Focus(); + General.Map.IsChanged = true; + if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); + } + + private void resetbacklight_Click(object sender, EventArgs e) + { + MakeUndo(); //mxd + + preventchanges = true; + + cbLightAbsoluteBack.Checked = false; + lightBack.Text = "0"; + + foreach (Linedef l in lines) + { + if (l.Back == null) continue; + if (l.Back.Fields.ContainsKey("lightabsolute")) l.Back.Fields.Remove("lightabsolute"); + if (l.Back.Fields.ContainsKey("light")) l.Back.Fields.Remove("light"); + } + + preventchanges = false; + + resetbacklight.Visible = false; + lightBack.Focus(); + General.Map.IsChanged = true; + if (OnValuesChanged != null) OnValuesChanged(this, EventArgs.Empty); + } + + #endregion + + #region Global texture offsets changed private void frontTextureOffset_OnValuesChanged(object sender, EventArgs e) { @@ -1453,6 +1787,7 @@ namespace CodeImp.DoomBuilder.Windows #endregion + #region Scale changed private void pfcFrontScaleTop_OnValuesChanged(object sender, EventArgs e) @@ -1672,10 +2007,5 @@ namespace CodeImp.DoomBuilder.Windows #endregion #endregion - - private void argscontrol_Load(object sender, EventArgs e) - { - - } } } diff --git a/Source/Core/Windows/LinedefEditFormSRB2.resx b/Source/Core/Windows/LinedefEditFormSRB2.resx index 6515b5f9..5099e449 100644 --- a/Source/Core/Windows/LinedefEditFormSRB2.resx +++ b/Source/Core/Windows/LinedefEditFormSRB2.resx @@ -155,7 +155,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADM - CAAAAk1TRnQBSQFMAgEBAgEAAQgBAQEIAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CAAAAk1TRnQBSQFMAgEBAgEAARgBAQEYAQEBEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -195,4 +195,7 @@ BAAB/wKAAQEEAAH/AcECgQQAAf8B4wLDBAAC/wLnBAAE/wQACw== + + 67 + \ No newline at end of file