Add separate colors for polyobject previews, remove NiGHTS axis circle precision option

This commit is contained in:
spherallic 2023-05-02 04:38:50 +02:00
parent fa1483351f
commit 8747bb5be9
5 changed files with 47 additions and 68 deletions

View File

@ -54,7 +54,6 @@ namespace CodeImp.DoomBuilder.Config
private float inactivethingsalpha; //mxd
private float hiddenthingsalpha; //mxd
private byte doublesidedalphabyte;
private int nightscircleprecision;
private float backgroundalpha;
private bool qualitydisplay;
private bool testmonsters;
@ -177,7 +176,6 @@ namespace CodeImp.DoomBuilder.Config
public int ImageBrightness { get { return imagebrightness; } internal set { imagebrightness = value; } }
public float DoubleSidedAlpha { get { return doublesidedalpha; } internal set { doublesidedalpha = value; doublesidedalphabyte = (byte)(doublesidedalpha * 255f); } }
public byte DoubleSidedAlphaByte { get { return doublesidedalphabyte; } }
public int NiGHTSCirclePrecision { get { return nightscircleprecision; } internal set { nightscircleprecision = value; } }
public float ActiveThingsAlpha { get { return activethingsalpha; } internal set { activethingsalpha = value; } } //mxd
public float InactiveThingsAlpha { get { return inactivethingsalpha; } internal set { inactivethingsalpha = value; } } //mxd
public float HiddenThingsAlpha { get { return hiddenthingsalpha; } internal set { hiddenthingsalpha = value; } } //mxd
@ -342,7 +340,6 @@ namespace CodeImp.DoomBuilder.Config
imagebrightness = cfg.ReadSetting("imagebrightness", 3);
doublesidedalpha = cfg.ReadSetting("doublesidedalpha", 0.4f);
doublesidedalphabyte = (byte)(doublesidedalpha * 255f);
nightscircleprecision = cfg.ReadSetting("nightscircleprecision", 360);
activethingsalpha = cfg.ReadSetting("activethingsalpha", Presentation.THINGS_ALPHA); //mxd
inactivethingsalpha = cfg.ReadSetting("inactivethingsalpha", Presentation.THINGS_BACK_ALPHA); //mxd
hiddenthingsalpha = cfg.ReadSetting("hiddenthingsalpha", Presentation.THINGS_HIDDEN_ALPHA); //mxd
@ -474,7 +471,6 @@ namespace CodeImp.DoomBuilder.Config
cfg.WriteSetting("qualitydisplay", qualitydisplay);
cfg.WriteSetting("testmonsters", testmonsters);
cfg.WriteSetting("doublesidedalpha", doublesidedalpha);
cfg.WriteSetting("nightscircleprecision", nightscircleprecision);
cfg.WriteSetting("activethingsalpha", activethingsalpha); //mxd
cfg.WriteSetting("inactivethingsalpha", inactivethingsalpha); //mxd
cfg.WriteSetting("hiddenthingsalpha", hiddenthingsalpha); //mxd

View File

@ -37,7 +37,7 @@ namespace CodeImp.DoomBuilder.Rendering
private const float DARK_ADDITION = -0.2f;
// Palette size
private const int NUM_COLORS = 63;
private const int NUM_COLORS = 65;
public const int NUM_THING_COLORS = 20;
public const int THING_COLORS_OFFSET = 20;
@ -105,6 +105,8 @@ namespace CodeImp.DoomBuilder.Rendering
public const int WAYPOINTCOLOR = 60;
public const int WAYPOINTLOOPCOLOR = 61;
public const int GUIDELINECOLOR = 62; //mxd
public const int POLYSPAWNCOLOR = 63;
public const int POLYANCHORCOLOR = 64;
#endregion
#region ================== Variables
@ -162,8 +164,10 @@ namespace CodeImp.DoomBuilder.Rendering
public PixelColor Includes { get { return colors[INCLUDES]; } internal set { colors[INCLUDES] = value; } } //mxd
public PixelColor ScriptFoldForeColor { get { return colors[SCRIPTFOLDFORE]; } internal set { colors[SCRIPTFOLDFORE] = value; } } //mxd
public PixelColor ScriptFoldBackColor { get { return colors[SCRIPTFOLDBACK]; } internal set { colors[SCRIPTFOLDBACK] = value; } } //mxd
public PixelColor WaypointColor { get { return colors[WAYPOINTCOLOR]; } internal set { colors[WAYPOINTCOLOR] = value; } } //mxd
public PixelColor WaypointLoopColor { get { return colors[WAYPOINTLOOPCOLOR]; } internal set { colors[WAYPOINTLOOPCOLOR] = value; } } //mxd
public PixelColor WaypointColor { get { return colors[WAYPOINTCOLOR]; } internal set { colors[WAYPOINTCOLOR] = value; } }
public PixelColor WaypointLoopColor { get { return colors[WAYPOINTLOOPCOLOR]; } internal set { colors[WAYPOINTLOOPCOLOR] = value; } }
public PixelColor PolySpawnColor { get { return colors[POLYSPAWNCOLOR]; } internal set { colors[POLYSPAWNCOLOR] = value; } }
public PixelColor PolyAnchorColor { get { return colors[POLYANCHORCOLOR]; } internal set { colors[POLYANCHORCOLOR] = value; } }
#endregion
@ -210,6 +214,8 @@ namespace CodeImp.DoomBuilder.Rendering
if (colors[WAYPOINTCOLOR].ToInt() == 0) colors[WAYPOINTCOLOR] = PixelColor.FromColor(Color.Orange);
if (colors[WAYPOINTLOOPCOLOR].ToInt() == 0) colors[WAYPOINTLOOPCOLOR] = PixelColor.FromColor(Color.SaddleBrown);
if (colors[GUIDELINECOLOR].ToInt() == 0) colors[GUIDELINECOLOR] = PixelColor.FromInt(-256);
if (colors[POLYSPAWNCOLOR].ToInt() == 0) colors[POLYSPAWNCOLOR] = PixelColor.FromColor(Color.LawnGreen);
if (colors[POLYANCHORCOLOR].ToInt() == 0) colors[POLYANCHORCOLOR] = PixelColor.FromColor(Color.DarkOrange);
// Create assist colors
CreateAssistColors();

View File

@ -159,7 +159,7 @@ namespace CodeImp.DoomBuilder.Rendering
Text = "0",
AlignX = TextAlignmentX.Center,
AlignY = TextAlignmentY.Middle,
Color = General.Colors.GetNiGHTSColor(8),
Color = General.Colors.PolyAnchorColor,
TransformCoords = true
};
@ -168,7 +168,7 @@ namespace CodeImp.DoomBuilder.Rendering
Text = "0",
AlignX = TextAlignmentX.Center,
AlignY = TextAlignmentY.Middle,
Color = General.Colors.GetNiGHTSColor(7),
Color = General.Colors.PolySpawnColor,
TransformCoords = true
};
@ -1695,10 +1695,10 @@ namespace CodeImp.DoomBuilder.Rendering
start.y -= ydiff;
end.x -= xdiff;
end.y -= ydiff;
RenderLine(start, end, 1.0f, General.Colors.GetNiGHTSColor(7), true);
RenderLine(start, end, 1.0f, General.Colors.PolySpawnColor, true);
}
anchorlabel.Color = General.Colors.GetNiGHTSColor(8);
spawnlabel.Color = General.Colors.GetNiGHTSColor(7);
anchorlabel.Color = General.Colors.PolyAnchorColor;
spawnlabel.Color = General.Colors.PolySpawnColor;
spawnlabel.Text = polyspawns[j].AngleDoom.ToString();
spawnlabel.Location = polyspawns[j].Position;
@ -2246,7 +2246,7 @@ namespace CodeImp.DoomBuilder.Rendering
// This renders a circle with given color
public void RenderCircle(Vector2D center, float radius, float thickness, PixelColor c, bool transformcoords)
{
int CIRCLE_PRECISION = General.Settings.NiGHTSCirclePrecision;
int CIRCLE_PRECISION = 128;
Vector2D[] points = new Vector2D[CIRCLE_PRECISION];
for (int i = 0; i < CIRCLE_PRECISION; i++)
{

View File

@ -183,11 +183,10 @@ namespace CodeImp.DoomBuilder.Windows
this.nightscolormare3 = new CodeImp.DoomBuilder.Controls.ColorControl();
this.nightscolormare2 = new CodeImp.DoomBuilder.Controls.ColorControl();
this.nightscolormare1 = new CodeImp.DoomBuilder.Controls.ColorControl();
this.label23 = new System.Windows.Forms.Label();
this.nightscircleprecision = new System.Windows.Forms.TrackBar();
this.nightscircleprecisionlabel = new System.Windows.Forms.Label();
this.waypointcolor1 = new CodeImp.DoomBuilder.Controls.ColorControl();
this.waypointcolor2 = new CodeImp.DoomBuilder.Controls.ColorControl();
this.polyobjectcolor1 = new CodeImp.DoomBuilder.Controls.ColorControl();
this.polyobjectcolor2 = new CodeImp.DoomBuilder.Controls.ColorControl();
this.tabscripteditor = new System.Windows.Forms.TabPage();
this.groupBox9 = new System.Windows.Forms.GroupBox();
this.scriptshowfolding = new System.Windows.Forms.CheckBox();
@ -274,7 +273,6 @@ namespace CodeImp.DoomBuilder.Windows
((System.ComponentModel.ISupportInitialize)(this.imagebrightness)).BeginInit();
((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).BeginInit();
this.nightsgroup.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.nightscircleprecision)).BeginInit();
this.tabscripteditor.SuspendLayout();
this.scriptedit.SuspendLayout();
this.groupBox9.SuspendLayout();
@ -1949,11 +1947,10 @@ namespace CodeImp.DoomBuilder.Windows
this.nightsgroup.Controls.Add(this.nightscolormare3);
this.nightsgroup.Controls.Add(this.nightscolormare2);
this.nightsgroup.Controls.Add(this.nightscolormare1);
this.nightsgroup.Controls.Add(this.label23);
this.nightsgroup.Controls.Add(this.nightscircleprecision);
this.nightsgroup.Controls.Add(this.nightscircleprecisionlabel);
this.nightsgroup.Controls.Add(this.waypointcolor1);
this.nightsgroup.Controls.Add(this.waypointcolor2);
this.nightsgroup.Controls.Add(this.polyobjectcolor1);
this.nightsgroup.Controls.Add(this.polyobjectcolor2);
this.nightsgroup.Location = new System.Drawing.Point(8, 401);
this.nightsgroup.Name = "nightsgroup";
this.nightsgroup.Size = new System.Drawing.Size(666, 129);
@ -2049,44 +2046,9 @@ namespace CodeImp.DoomBuilder.Windows
this.nightscolormare1.Size = new System.Drawing.Size(168, 23);
this.nightscolormare1.TabIndex = 29;
//
// label23
//
this.label23.AutoSize = true;
this.label23.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.label23.Location = new System.Drawing.Point(399, 90);
this.label23.Name = "label23";
this.label23.Size = new System.Drawing.Size(102, 13);
this.label23.TabIndex = 31;
this.label23.Text = "Axis circle precision:";
this.label23.TextAlign = System.Drawing.ContentAlignment.TopRight;
//
// nightscircleprecision
//
this.nightscircleprecision.BackColor = System.Drawing.SystemColors.Window;
this.nightscircleprecision.LargeChange = 1;
this.nightscircleprecision.Location = new System.Drawing.Point(501, 78);
this.nightscircleprecision.Maximum = 36;
this.nightscircleprecision.Minimum = 1;
this.nightscircleprecision.Name = "nightscircleprecision";
this.nightscircleprecision.Size = new System.Drawing.Size(130, 45);
this.nightscircleprecision.TabIndex = 30;
this.nightscircleprecision.TickStyle = System.Windows.Forms.TickStyle.TopLeft;
this.nightscircleprecision.Value = 36;
//
// nightscircleprecisionlabel
//
this.nightscircleprecisionlabel.AutoSize = true;
this.nightscircleprecisionlabel.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.nightscircleprecisionlabel.Location = new System.Drawing.Point(634, 90);
this.nightscircleprecisionlabel.Name = "nightscircleprecisionlabel";
this.nightscircleprecisionlabel.Size = new System.Drawing.Size(25, 13);
this.nightscircleprecisionlabel.TabIndex = 32;
this.nightscircleprecisionlabel.Text = "360";
//
// waypointcolor1
//
this.waypointcolor1.BackColor = System.Drawing.Color.Transparent;
this.waypointcolor1.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.waypointcolor1.Label = "Waypoint path color:";
this.waypointcolor1.Location = new System.Drawing.Point(399, 17);
this.waypointcolor1.MaximumSize = new System.Drawing.Size(10000, 23);
@ -2098,7 +2060,6 @@ namespace CodeImp.DoomBuilder.Windows
// waypointcolor2
//
this.waypointcolor2.BackColor = System.Drawing.Color.Transparent;
this.waypointcolor2.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.waypointcolor2.Label = "Waypoint path color (loop):";
this.waypointcolor2.Location = new System.Drawing.Point(399, 44);
this.waypointcolor2.MaximumSize = new System.Drawing.Size(10000, 23);
@ -2107,6 +2068,28 @@ namespace CodeImp.DoomBuilder.Windows
this.waypointcolor2.Size = new System.Drawing.Size(198, 23);
this.waypointcolor2.TabIndex = 29;
//
// polyobjectcolor1
//
this.polyobjectcolor1.BackColor = System.Drawing.Color.Transparent;
this.polyobjectcolor1.Label = "Polyobject spawn color:";
this.polyobjectcolor1.Location = new System.Drawing.Point(399, 71);
this.polyobjectcolor1.MaximumSize = new System.Drawing.Size(10000, 23);
this.polyobjectcolor1.MinimumSize = new System.Drawing.Size(100, 23);
this.polyobjectcolor1.Name = "polyobjectcolor1";
this.polyobjectcolor1.Size = new System.Drawing.Size(198, 23);
this.polyobjectcolor1.TabIndex = 29;
//
// polyobjectcolor2
//
this.polyobjectcolor2.BackColor = System.Drawing.Color.Transparent;
this.polyobjectcolor2.Label = "Polyobject anchor color:";
this.polyobjectcolor2.Location = new System.Drawing.Point(399, 98);
this.polyobjectcolor2.MaximumSize = new System.Drawing.Size(10000, 23);
this.polyobjectcolor2.MinimumSize = new System.Drawing.Size(100, 23);
this.polyobjectcolor2.Name = "polyobjectcolor2";
this.polyobjectcolor2.Size = new System.Drawing.Size(198, 23);
this.polyobjectcolor2.TabIndex = 29;
//
// tabscripteditor
//
this.tabscripteditor.Controls.Add(this.groupBox9);
@ -2728,7 +2711,6 @@ namespace CodeImp.DoomBuilder.Windows
((System.ComponentModel.ISupportInitialize)(this.tbDynLightCount)).EndInit();
this.nightsgroup.ResumeLayout(false);
this.nightsgroup.PerformLayout();
((System.ComponentModel.ISupportInitialize)(this.nightscircleprecision)).EndInit();
this.tabscripteditor.ResumeLayout(false);
this.scriptedit.ResumeLayout(false);
this.groupBox9.ResumeLayout(false);
@ -2869,9 +2851,8 @@ namespace CodeImp.DoomBuilder.Windows
private Controls.ColorControl nightscolormare1;
private Controls.ColorControl waypointcolor1;
private Controls.ColorControl waypointcolor2;
private System.Windows.Forms.Label nightscircleprecisionlabel;
private System.Windows.Forms.Label label23;
private System.Windows.Forms.TrackBar nightscircleprecision;
private Controls.ColorControl polyobjectcolor1;
private Controls.ColorControl polyobjectcolor2;
private Controls.ColorControl nightscolormare2;
private Controls.ColorControl nightscolormare8;
private Controls.ColorControl nightscolormare7;

View File

@ -63,7 +63,6 @@ namespace CodeImp.DoomBuilder.Windows
// Interface
imagebrightness.Value = General.Settings.ImageBrightness;
doublesidedalpha.Value = General.Clamp((int)((1.0f - General.Settings.DoubleSidedAlpha) * 10.0f), doublesidedalpha.Minimum, doublesidedalpha.Maximum);
nightscircleprecision.Value = General.Clamp((int)(General.Settings.NiGHTSCirclePrecision)/10, nightscircleprecision.Minimum, nightscircleprecision.Maximum);
activethingsalpha.Value = General.Clamp((int)((1.0f - General.Settings.ActiveThingsAlpha) * 10.0f), activethingsalpha.Minimum, activethingsalpha.Maximum); //mxd
inactivethingsalpha.Value = General.Clamp((int)((1.0f - General.Settings.InactiveThingsAlpha) * 10.0f), inactivethingsalpha.Minimum, inactivethingsalpha.Maximum); //mxd
hiddenthingsalpha.Value = General.Clamp((int)((1.0f - General.Settings.HiddenThingsAlpha) * 10.0f), hiddenthingsalpha.Minimum, hiddenthingsalpha.Maximum); //mxd
@ -275,6 +274,8 @@ namespace CodeImp.DoomBuilder.Windows
waypointcolor1.Color = General.Colors.WaypointColor;
waypointcolor2.Color = General.Colors.WaypointLoopColor;
polyobjectcolor1.Color = General.Colors.PolySpawnColor;
polyobjectcolor2.Color = General.Colors.PolyAnchorColor;
// Paste options
pasteoptions.Setup(General.Settings.PasteOptions.Copy());
@ -314,7 +315,6 @@ namespace CodeImp.DoomBuilder.Windows
// Apply interface
General.Settings.ImageBrightness = imagebrightness.Value;
General.Settings.DoubleSidedAlpha = 1.0f - (doublesidedalpha.Value * 0.1f);
General.Settings.NiGHTSCirclePrecision = nightscircleprecision.Value * 10;
General.Settings.ActiveThingsAlpha = 1.0f - (activethingsalpha.Value * 0.1f); //mxd
General.Settings.InactiveThingsAlpha = 1.0f - (inactivethingsalpha.Value * 0.1f); //mxd
General.Settings.HiddenThingsAlpha = 1.0f - (hiddenthingsalpha.Value * 0.1f); //mxd
@ -434,6 +434,8 @@ namespace CodeImp.DoomBuilder.Windows
General.Colors.WaypointColor = waypointcolor1.Color;
General.Colors.WaypointLoopColor = waypointcolor2.Color;
General.Colors.PolySpawnColor = polyobjectcolor1.Color;
General.Colors.PolyAnchorColor = polyobjectcolor2.Color;
//mxd
General.Settings.GZSynchCameras = cbSynchCameras.Checked;
@ -1018,12 +1020,6 @@ namespace CodeImp.DoomBuilder.Windows
doublesidedalphalabel.Text = percent + "%";
}
private void nightscircleprecision_ValueChanged(object sender, EventArgs e)
{
int value = nightscircleprecision.Value * 10;
nightscircleprecisionlabel.Text = value.ToString();
}
//mxd
private void inactivethingsalpha_ValueChanged(object sender, EventArgs e)
{