UDMF Controls plugin:

Relative mode is set to false by default.
Limits of Brightness slider were set after setting it's value, so values greater than 100 were set to 100.
Fixed a bug when a plugin tried to access 3d-floor-specific stuff of walls, which weren't part of 3d-floor.

Color Picker plugin: added float representation of current color (like 1.0 0.54 0.29). Should make editing of GLDEFS light definitions easier.
This commit is contained in:
MaxED 2012-08-20 01:08:18 +00:00
parent e308d2ff15
commit b477309168
4 changed files with 211 additions and 167 deletions

View file

@ -7,6 +7,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BuilderModes", "..\Plugins\
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GZDoomEditing", "..\Plugins\GZDoomEditing\GZDoomEditing.csproj", "{760A9BC7-CB73-4C36-858B-994C14996FCD}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDMFControls", "..\Plugins\UMDFControls\UDMFControls.csproj", "{2D11C828-295C-463A-8545-CA1AD6D51518}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ColorPicker", "..\Plugins\ColorPicker\ColorPicker.csproj", "{A4761900-0EA3-4FE4-A919-847FD5080EFC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -47,6 +51,26 @@ Global
{760A9BC7-CB73-4C36-858B-994C14996FCD}.Release|Mixed Platforms.Build.0 = Release|x86
{760A9BC7-CB73-4C36-858B-994C14996FCD}.Release|x86.ActiveCfg = Release|x86
{760A9BC7-CB73-4C36-858B-994C14996FCD}.Release|x86.Build.0 = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Any CPU.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|Mixed Platforms.Build.0 = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|x86.ActiveCfg = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Debug|x86.Build.0 = Debug|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Any CPU.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Mixed Platforms.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|Mixed Platforms.Build.0 = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|x86.ActiveCfg = Release|x86
{2D11C828-295C-463A-8545-CA1AD6D51518}.Release|x86.Build.0 = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Any CPU.ActiveCfg = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|Mixed Platforms.Build.0 = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x86.ActiveCfg = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Debug|x86.Build.0 = Debug|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Any CPU.ActiveCfg = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Mixed Platforms.ActiveCfg = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|Mixed Platforms.Build.0 = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.ActiveCfg = Release|x86
{A4761900-0EA3-4FE4-A919-847FD5080EFC}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

View file

@ -70,6 +70,9 @@ namespace CodeImp.DoomBuilder.ColorPicker.Controls {
btnOK.BackColor = ColorHandler.RGBtoColor(RGB);
btnOK.ForeColor = (RGB.Red < 180 && RGB.Green < 180) ? Color.White : Color.Black;
//update float vals
tbFloatVals.Text = (float)Math.Round((float)RGB.Red / 255f, 2) + " " + (float)Math.Round((float)RGB.Green / 255f, 2) + " " + (float)Math.Round((float)RGB.Blue / 255f, 2);
//dispatch event further
EventHandler<ColorChangedEventArgs> handler = ColorChanged;
if (handler != null)
@ -183,5 +186,9 @@ namespace CodeImp.DoomBuilder.ColorPicker.Controls {
if (handler != null)
handler(this, e);
}
private void tbFloatVals_Click(object sender, EventArgs e) {
tbFloatVals.Select(0, tbFloatVals.Text.Length);
}
}
}

View file

@ -23,162 +23,175 @@
/// содержимое данного метода при помощи редактора кода.
/// </summary>
private void InitializeComponent() {
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.Label3 = new System.Windows.Forms.Label();
this.nudRed = new System.Windows.Forms.NumericUpDown();
this.pnlColor = new System.Windows.Forms.Panel();
this.Label1 = new System.Windows.Forms.Label();
this.pnlBrightness = new System.Windows.Forms.Panel();
this.nudBlue = new System.Windows.Forms.NumericUpDown();
this.nudGreen = new System.Windows.Forms.NumericUpDown();
this.Label2 = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.nudRed)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudBlue)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudGreen)).BeginInit();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnCancel.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(214, 44);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(94, 42);
this.btnCancel.TabIndex = 54;
this.btnCancel.Text = "Cancel";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.BackColor = System.Drawing.SystemColors.Control;
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnOK.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnOK.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnOK.Location = new System.Drawing.Point(214, 3);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(94, 42);
this.btnOK.TabIndex = 53;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// Label3
//
this.Label3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label3.Location = new System.Drawing.Point(214, 147);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(40, 23);
this.Label3.TabIndex = 60;
this.Label3.Text = "Blue:";
this.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// nudRed
//
this.nudRed.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nudRed.Location = new System.Drawing.Point(260, 101);
this.nudRed.Maximum = new decimal(new int[] {
this.btnCancel = new System.Windows.Forms.Button();
this.btnOK = new System.Windows.Forms.Button();
this.Label3 = new System.Windows.Forms.Label();
this.nudRed = new System.Windows.Forms.NumericUpDown();
this.pnlColor = new System.Windows.Forms.Panel();
this.Label1 = new System.Windows.Forms.Label();
this.pnlBrightness = new System.Windows.Forms.Panel();
this.nudBlue = new System.Windows.Forms.NumericUpDown();
this.nudGreen = new System.Windows.Forms.NumericUpDown();
this.Label2 = new System.Windows.Forms.Label();
this.tbFloatVals = new System.Windows.Forms.TextBox();
((System.ComponentModel.ISupportInitialize)(this.nudRed)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudBlue)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.nudGreen)).BeginInit();
this.SuspendLayout();
//
// btnCancel
//
this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.btnCancel.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnCancel.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnCancel.Location = new System.Drawing.Point(214, 44);
this.btnCancel.Name = "btnCancel";
this.btnCancel.Size = new System.Drawing.Size(94, 42);
this.btnCancel.TabIndex = 54;
this.btnCancel.Text = "Cancel";
this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
//
// btnOK
//
this.btnOK.BackColor = System.Drawing.SystemColors.Control;
this.btnOK.DialogResult = System.Windows.Forms.DialogResult.OK;
this.btnOK.FlatStyle = System.Windows.Forms.FlatStyle.Popup;
this.btnOK.Font = new System.Drawing.Font("Arial", 10F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.btnOK.ForeColor = System.Drawing.SystemColors.ControlText;
this.btnOK.Location = new System.Drawing.Point(214, 3);
this.btnOK.Name = "btnOK";
this.btnOK.Size = new System.Drawing.Size(94, 42);
this.btnOK.TabIndex = 53;
this.btnOK.Text = "OK";
this.btnOK.UseVisualStyleBackColor = true;
this.btnOK.Click += new System.EventHandler(this.btnOK_Click);
//
// Label3
//
this.Label3.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label3.Location = new System.Drawing.Point(214, 133);
this.Label3.Name = "Label3";
this.Label3.Size = new System.Drawing.Size(40, 23);
this.Label3.TabIndex = 60;
this.Label3.Text = "Blue:";
this.Label3.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// nudRed
//
this.nudRed.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nudRed.Location = new System.Drawing.Point(260, 89);
this.nudRed.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.nudRed.Name = "nudRed";
this.nudRed.Size = new System.Drawing.Size(48, 20);
this.nudRed.TabIndex = 55;
this.nudRed.ValueChanged += new System.EventHandler(this.nudValueChanged);
//
// pnlColor
//
this.pnlColor.Location = new System.Drawing.Point(3, 3);
this.pnlColor.Name = "pnlColor";
this.pnlColor.Size = new System.Drawing.Size(176, 176);
this.pnlColor.TabIndex = 61;
this.pnlColor.Visible = false;
//
// Label1
//
this.Label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label1.Location = new System.Drawing.Point(214, 99);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(40, 23);
this.Label1.TabIndex = 58;
this.Label1.Text = "Red:";
this.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// pnlBrightness
//
this.pnlBrightness.Location = new System.Drawing.Point(185, 3);
this.pnlBrightness.Name = "pnlBrightness";
this.pnlBrightness.Size = new System.Drawing.Size(16, 176);
this.pnlBrightness.TabIndex = 62;
this.pnlBrightness.Visible = false;
//
// nudBlue
//
this.nudBlue.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nudBlue.Location = new System.Drawing.Point(260, 149);
this.nudBlue.Maximum = new decimal(new int[] {
this.nudRed.Name = "nudRed";
this.nudRed.Size = new System.Drawing.Size(48, 20);
this.nudRed.TabIndex = 55;
this.nudRed.ValueChanged += new System.EventHandler(this.nudValueChanged);
//
// pnlColor
//
this.pnlColor.Location = new System.Drawing.Point(3, 3);
this.pnlColor.Name = "pnlColor";
this.pnlColor.Size = new System.Drawing.Size(176, 176);
this.pnlColor.TabIndex = 61;
this.pnlColor.Visible = false;
//
// Label1
//
this.Label1.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label1.Location = new System.Drawing.Point(214, 87);
this.Label1.Name = "Label1";
this.Label1.Size = new System.Drawing.Size(40, 23);
this.Label1.TabIndex = 58;
this.Label1.Text = "Red:";
this.Label1.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// pnlBrightness
//
this.pnlBrightness.Location = new System.Drawing.Point(185, 3);
this.pnlBrightness.Name = "pnlBrightness";
this.pnlBrightness.Size = new System.Drawing.Size(16, 176);
this.pnlBrightness.TabIndex = 62;
this.pnlBrightness.Visible = false;
//
// nudBlue
//
this.nudBlue.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nudBlue.Location = new System.Drawing.Point(260, 135);
this.nudBlue.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.nudBlue.Name = "nudBlue";
this.nudBlue.Size = new System.Drawing.Size(48, 20);
this.nudBlue.TabIndex = 57;
this.nudBlue.ValueChanged += new System.EventHandler(this.nudValueChanged);
//
// nudGreen
//
this.nudGreen.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nudGreen.Location = new System.Drawing.Point(260, 125);
this.nudGreen.Maximum = new decimal(new int[] {
this.nudBlue.Name = "nudBlue";
this.nudBlue.Size = new System.Drawing.Size(48, 20);
this.nudBlue.TabIndex = 57;
this.nudBlue.ValueChanged += new System.EventHandler(this.nudValueChanged);
//
// nudGreen
//
this.nudGreen.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nudGreen.Location = new System.Drawing.Point(260, 112);
this.nudGreen.Maximum = new decimal(new int[] {
255,
0,
0,
0});
this.nudGreen.Name = "nudGreen";
this.nudGreen.Size = new System.Drawing.Size(48, 20);
this.nudGreen.TabIndex = 56;
this.nudGreen.ValueChanged += new System.EventHandler(this.nudValueChanged);
//
// Label2
//
this.Label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label2.Location = new System.Drawing.Point(214, 123);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(40, 23);
this.Label2.TabIndex = 59;
this.Label2.Text = "Green:";
this.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// ColorPickerControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.Label3);
this.Controls.Add(this.nudRed);
this.Controls.Add(this.pnlColor);
this.Controls.Add(this.Label1);
this.Controls.Add(this.pnlBrightness);
this.Controls.Add(this.nudBlue);
this.Controls.Add(this.nudGreen);
this.Controls.Add(this.Label2);
this.Name = "ColorPickerControl";
this.Size = new System.Drawing.Size(311, 183);
this.Load += new System.EventHandler(this.ColorPickerControl_Load);
this.MouseLeave += new System.EventHandler(this.onMouseUp);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.onPaint);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.handleMouse);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ColorPickerControl_MouseDown);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.onMouseUp);
((System.ComponentModel.ISupportInitialize)(this.nudRed)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudBlue)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudGreen)).EndInit();
this.ResumeLayout(false);
this.nudGreen.Name = "nudGreen";
this.nudGreen.Size = new System.Drawing.Size(48, 20);
this.nudGreen.TabIndex = 56;
this.nudGreen.ValueChanged += new System.EventHandler(this.nudValueChanged);
//
// Label2
//
this.Label2.Font = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.Label2.Location = new System.Drawing.Point(214, 110);
this.Label2.Name = "Label2";
this.Label2.Size = new System.Drawing.Size(40, 23);
this.Label2.TabIndex = 59;
this.Label2.Text = "Green:";
this.Label2.TextAlign = System.Drawing.ContentAlignment.MiddleRight;
//
// tbFloatVals
//
this.tbFloatVals.Location = new System.Drawing.Point(217, 158);
this.tbFloatVals.Name = "tbFloatVals";
this.tbFloatVals.ReadOnly = true;
this.tbFloatVals.Size = new System.Drawing.Size(90, 20);
this.tbFloatVals.TabIndex = 63;
this.tbFloatVals.Text = "1.01 0.55 0.33";
this.tbFloatVals.Click += new System.EventHandler(this.tbFloatVals_Click);
//
// ColorPickerControl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.tbFloatVals);
this.Controls.Add(this.btnCancel);
this.Controls.Add(this.btnOK);
this.Controls.Add(this.Label3);
this.Controls.Add(this.nudRed);
this.Controls.Add(this.pnlColor);
this.Controls.Add(this.Label1);
this.Controls.Add(this.pnlBrightness);
this.Controls.Add(this.nudBlue);
this.Controls.Add(this.nudGreen);
this.Controls.Add(this.Label2);
this.Name = "ColorPickerControl";
this.Size = new System.Drawing.Size(311, 183);
this.Load += new System.EventHandler(this.ColorPickerControl_Load);
this.MouseLeave += new System.EventHandler(this.onMouseUp);
this.Paint += new System.Windows.Forms.PaintEventHandler(this.onPaint);
this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.handleMouse);
this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.ColorPickerControl_MouseDown);
this.MouseUp += new System.Windows.Forms.MouseEventHandler(this.onMouseUp);
((System.ComponentModel.ISupportInitialize)(this.nudRed)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudBlue)).EndInit();
((System.ComponentModel.ISupportInitialize)(this.nudGreen)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
@ -194,5 +207,6 @@
internal System.Windows.Forms.NumericUpDown nudBlue;
internal System.Windows.Forms.NumericUpDown nudGreen;
internal System.Windows.Forms.Label Label2;
private System.Windows.Forms.TextBox tbFloatVals;
}
}

View file

@ -34,7 +34,7 @@ namespace CodeImp.DoomBuilder.UDMFControls
private List<string> renderStyles;
private static bool relativeMode = true;
private static bool relativeMode = false;
public UDMFControlsForm() {
//capture keys
@ -111,8 +111,6 @@ namespace CodeImp.DoomBuilder.UDMFControls
case VisualGeometryType.WALL_MIDDLE_3D:
walls3dCount++;
//if (wall3DIndeces.IndexOf(vg.Sector.Sector.FixedIndex) != -1)
//break;
wall3DIndeces.Add(vg.Sector.Sector.FixedIndex);
goto case VisualGeometryType.WALL_MIDDLE;
@ -166,7 +164,8 @@ namespace CodeImp.DoomBuilder.UDMFControls
scaleControl.Value = new Vector2D(scaleX, scaleY);
positionControl1.Value = new Vector2D(translateX, translateY);
angleControl1.Value = (int)((float)firstFloor.Sector.Fields[KeyNames.GetRotation(firstFloor.GeometryType)].Value);
sliderBrightness.Value = (int)firstFloor.Sector.Fields[KeyNames.GetLight(firstFloor.GeometryType)].Value;
sliderBrightness.SetLimits(cblightabsolute.Checked ? 0 : -255, 255);
sliderBrightness.Value = (int)firstFloor.Sector.Fields[KeyNames.GetLight(firstFloor.GeometryType)].Value;
nudGravity.Value = (decimal)((float)firstFloor.Sector.Fields[(string)nudGravity.Tag].Value);
sliderDesaturation.Value = (float)firstFloor.Sector.Fields[(string)sliderDesaturation.Tag].Value;
@ -189,8 +188,9 @@ namespace CodeImp.DoomBuilder.UDMFControls
//set values to controls
scaleControl.Value = new Vector2D(scaleX, scaleY);
positionControl1.Value = new Vector2D(translateX, translateY);
sliderBrightness.Value = (int)firstWall.Sidedef.Fields[KeyNames.GetLight(firstWall.GeometryType)].Value;
cblightabsolute.Checked = (bool)firstWall.Sidedef.Fields[KeyNames.GetLightAbsolute(firstWall.GeometryType)].Value;
sliderBrightness.SetLimits(cblightabsolute.Checked ? 0 : -255, 255);
sliderBrightness.Value = (int)firstWall.Sidedef.Fields[KeyNames.GetLight(firstWall.GeometryType)].Value;
//set linedef values
sliderAlpha.Value = (float)firstWall.Linedef.Fields[(string)sliderAlpha.Tag].Value;
@ -201,8 +201,6 @@ namespace CodeImp.DoomBuilder.UDMFControls
if (walls3dCount == wallsMid.Count && wallsTop.Count == 0 && wallsBottom.Count == 0) {
gbAlpha.Enabled = false;
bgBrightness.Enabled = false;
//cblightabsolute.Checked = true;
//cblightabsolute.Enabled = false;
}
}
@ -215,12 +213,6 @@ namespace CodeImp.DoomBuilder.UDMFControls
gbAlpha.Enabled = false;
}
//brightness slider
if(cblightabsolute.Checked)
sliderBrightness.SetLimits(0, 255);
else
sliderBrightness.SetLimits(-255, 255);
Text = "Editing " + rest;
}
@ -650,18 +642,25 @@ namespace CodeImp.DoomBuilder.UDMFControls
if (vg.GeometryType == VisualGeometryType.CEILING || vg.GeometryType == VisualGeometryType.FLOOR) {
sector = vg.GetControlSector();
sector.Fields.BeforeFieldsChange();
} else {
linedef = vg.GetControlLinedef();
controlSidedef = linedef.Front;
sidedef = vg.Sidedef;
} else if(vg.GeometryType == VisualGeometryType.WALL_MIDDLE_3D) {
linedef = vg.GetControlLinedef();
hasControlLinedef = (controlSidedef.Sector.FixedIndex != sidedef.Sector.FixedIndex);
controlSidedef = linedef.Front;
sidedef = vg.Sidedef;
linedef.Fields.BeforeFieldsChange();
controlSidedef.Fields.BeforeFieldsChange();
sidedef.Fields.BeforeFieldsChange();
}
hasControlLinedef = (controlSidedef.Sector.FixedIndex != sidedef.Sector.FixedIndex);
linedef.Fields.BeforeFieldsChange();
controlSidedef.Fields.BeforeFieldsChange();
sidedef.Fields.BeforeFieldsChange();
} else {
hasControlLinedef = false;
sidedef = vg.Sidedef;
controlSidedef = sidedef;
linedef = sidedef.Line;
linedef.Fields.BeforeFieldsChange();
sidedef.Fields.BeforeFieldsChange();
}
}
public void Update() {