mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2025-01-18 22:41:46 +00:00
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:
parent
e308d2ff15
commit
b477309168
4 changed files with 211 additions and 167 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -33,6 +33,7 @@
|
|||
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();
|
||||
|
@ -68,7 +69,7 @@
|
|||
// 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.Location = new System.Drawing.Point(214, 133);
|
||||
this.Label3.Name = "Label3";
|
||||
this.Label3.Size = new System.Drawing.Size(40, 23);
|
||||
this.Label3.TabIndex = 60;
|
||||
|
@ -78,7 +79,7 @@
|
|||
// 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.Location = new System.Drawing.Point(260, 89);
|
||||
this.nudRed.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
|
@ -100,7 +101,7 @@
|
|||
// 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.Location = new System.Drawing.Point(214, 87);
|
||||
this.Label1.Name = "Label1";
|
||||
this.Label1.Size = new System.Drawing.Size(40, 23);
|
||||
this.Label1.TabIndex = 58;
|
||||
|
@ -118,7 +119,7 @@
|
|||
// 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.Location = new System.Drawing.Point(260, 135);
|
||||
this.nudBlue.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
|
@ -132,7 +133,7 @@
|
|||
// 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.Location = new System.Drawing.Point(260, 112);
|
||||
this.nudGreen.Maximum = new decimal(new int[] {
|
||||
255,
|
||||
0,
|
||||
|
@ -146,17 +147,28 @@
|
|||
// 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.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);
|
||||
|
@ -179,6 +191,7 @@
|
|||
((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;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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,6 +164,7 @@ 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.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,7 +642,7 @@ namespace CodeImp.DoomBuilder.UDMFControls
|
|||
if (vg.GeometryType == VisualGeometryType.CEILING || vg.GeometryType == VisualGeometryType.FLOOR) {
|
||||
sector = vg.GetControlSector();
|
||||
sector.Fields.BeforeFieldsChange();
|
||||
} else {
|
||||
} else if(vg.GeometryType == VisualGeometryType.WALL_MIDDLE_3D) {
|
||||
linedef = vg.GetControlLinedef();
|
||||
|
||||
controlSidedef = linedef.Front;
|
||||
|
@ -661,6 +653,13 @@ namespace CodeImp.DoomBuilder.UDMFControls
|
|||
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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue