Merged in GZDB r2491

This commit is contained in:
MascaraSnake 2016-01-30 00:57:06 +01:00
parent 7f08137025
commit 4952d9120a
5 changed files with 172 additions and 46 deletions

View file

@ -270,12 +270,12 @@ colors
color11 = -24576;
color12 = -49152;
color13 = -1;
color14 = -4144960;
color14 = -13921873;
color15 = -16777216;
color16 = -6908266;
color17 = -16753716;
color18 = -11366857;
color19 = -6671822;
color16 = -16744448;
color17 = -16741493;
color18 = -16776961;
color19 = -16744256;
color20 = -9868951;
color21 = -12490271;
color22 = -14513374;

View file

@ -75,8 +75,15 @@ namespace CodeImp.DoomBuilder.Controls
public Color SelectionForeColor { set { scriptedit.SetSelectionForeColor(true, value); } }
public Color SelectionBackColor { set { scriptedit.SetSelectionBackColor(true, value); } }
public Color WhitespaceColor { set { scriptedit.SetWhitespaceForeColor(true, value); } }
public Color BraceHighlight { set { scriptedit.Styles[Style.BraceLight].BackColor = value; } }
public Color WhitespaceColor
{
set
{
scriptedit.SetWhitespaceForeColor(true, value);
scriptedit.SetWhitespaceBackColor(false, value); // Otherwise selection back color won't be applied correctly...
}
}
public Color BraceHighlight { set { scriptedit.Styles[Style.BraceLight].BackColor = value; } }
public Color BadBraceHighlight { set { scriptedit.Styles[Style.BraceBad].BackColor = value; } }
public Color ScriptIndicator { set { indicatorcolor = value; UpdateWordHighlight(); } }

View file

@ -197,8 +197,8 @@ namespace CodeImp.DoomBuilder.Rendering
if(colors[THINGCOLOR17].ToInt() == 0) colors[THINGCOLOR17] = PixelColor.FromColor(Color.DarkOrange);
if(colors[THINGCOLOR18].ToInt() == 0) colors[THINGCOLOR18] = PixelColor.FromColor(Color.DarkKhaki);
if(colors[THINGCOLOR19].ToInt() == 0) colors[THINGCOLOR19] = PixelColor.FromColor(Color.Goldenrod);
if (colors[SCRIPTFOLDFORE].ToInt() == 0) colors[SCRIPTFOLDFORE] = PixelColor.FromColor(SystemColors.ControlLightLight);
if (colors[SCRIPTFOLDBACK].ToInt() == 0) colors[SCRIPTFOLDBACK] = PixelColor.FromColor(SystemColors.ControlDark);
if (colors[SCRIPTFOLDFORE].ToInt() == 0) colors[SCRIPTFOLDFORE] = PixelColor.FromColor(SystemColors.ControlDark);
if (colors[SCRIPTFOLDBACK].ToInt() == 0) colors[SCRIPTFOLDBACK] = PixelColor.FromColor(SystemColors.ControlLightLight);
// Create assist colors
CreateAssistColors();

View file

@ -175,6 +175,8 @@ namespace CodeImp.DoomBuilder.Windows
this.label8 = new System.Windows.Forms.Label();
this.scriptfontsize = new System.Windows.Forms.ComboBox();
this.groupBox6 = new System.Windows.Forms.GroupBox();
this.colorfoldback = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorfoldfore = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorindicator = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorwhitespace = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorbracebad = new CodeImp.DoomBuilder.Controls.ColorControl();
@ -209,8 +211,8 @@ namespace CodeImp.DoomBuilder.Windows
this.pasteoptions = new CodeImp.DoomBuilder.Controls.PasteOptionsControl();
this.toolTip1 = new System.Windows.Forms.ToolTip(this.components);
this.browseScreenshotsFolderDialog = new System.Windows.Forms.FolderBrowserDialog();
this.colorfoldfore = new CodeImp.DoomBuilder.Controls.ColorControl();
this.colorfoldback = new CodeImp.DoomBuilder.Controls.ColorControl();
this.scriptcolorpresets = new System.Windows.Forms.ComboBox();
this.label28 = new System.Windows.Forms.Label();
label7 = new System.Windows.Forms.Label();
label6 = new System.Windows.Forms.Label();
label5 = new System.Windows.Forms.Label();
@ -1944,6 +1946,8 @@ namespace CodeImp.DoomBuilder.Windows
//
this.groupBox6.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)));
this.groupBox6.Controls.Add(this.label28);
this.groupBox6.Controls.Add(this.scriptcolorpresets);
this.groupBox6.Controls.Add(this.colorfoldback);
this.groupBox6.Controls.Add(this.colorfoldfore);
this.groupBox6.Controls.Add(this.colorindicator);
@ -1968,11 +1972,35 @@ namespace CodeImp.DoomBuilder.Windows
this.groupBox6.TabStop = false;
this.groupBox6.Text = " Colors ";
//
// colorfoldback
//
this.colorfoldback.BackColor = System.Drawing.Color.Transparent;
this.colorfoldback.Label = "Fold BG:";
this.colorfoldback.Location = new System.Drawing.Point(15, 461);
this.colorfoldback.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorfoldback.MinimumSize = new System.Drawing.Size(100, 23);
this.colorfoldback.Name = "colorfoldback";
this.colorfoldback.Size = new System.Drawing.Size(168, 23);
this.colorfoldback.TabIndex = 16;
this.colorfoldback.ColorChanged += new System.EventHandler(this.colorfoldback_ColorChanged);
//
// colorfoldfore
//
this.colorfoldfore.BackColor = System.Drawing.Color.Transparent;
this.colorfoldfore.Label = "Fold:";
this.colorfoldfore.Location = new System.Drawing.Point(15, 435);
this.colorfoldfore.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorfoldfore.MinimumSize = new System.Drawing.Size(100, 23);
this.colorfoldfore.Name = "colorfoldfore";
this.colorfoldfore.Size = new System.Drawing.Size(168, 23);
this.colorfoldfore.TabIndex = 15;
this.colorfoldfore.ColorChanged += new System.EventHandler(this.colorfoldfore_ColorChanged);
//
// colorindicator
//
this.colorindicator.BackColor = System.Drawing.Color.Transparent;
this.colorindicator.Label = "Matching word:";
this.colorindicator.Location = new System.Drawing.Point(15, 325);
this.colorindicator.Location = new System.Drawing.Point(15, 331);
this.colorindicator.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorindicator.MinimumSize = new System.Drawing.Size(100, 23);
this.colorindicator.Name = "colorindicator";
@ -1996,7 +2024,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorbracebad.BackColor = System.Drawing.Color.Transparent;
this.colorbracebad.Label = "Mismatching brace:";
this.colorbracebad.Location = new System.Drawing.Point(15, 381);
this.colorbracebad.Location = new System.Drawing.Point(15, 383);
this.colorbracebad.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorbracebad.MinimumSize = new System.Drawing.Size(100, 23);
this.colorbracebad.Name = "colorbracebad";
@ -2008,7 +2036,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorbrace.BackColor = System.Drawing.Color.Transparent;
this.colorbrace.Label = "Matching brace:";
this.colorbrace.Location = new System.Drawing.Point(15, 353);
this.colorbrace.Location = new System.Drawing.Point(15, 357);
this.colorbrace.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorbrace.MinimumSize = new System.Drawing.Size(100, 23);
this.colorbrace.Name = "colorbrace";
@ -2020,7 +2048,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorselectionback.BackColor = System.Drawing.Color.Transparent;
this.colorselectionback.Label = "Selection BG:";
this.colorselectionback.Location = new System.Drawing.Point(15, 297);
this.colorselectionback.Location = new System.Drawing.Point(15, 305);
this.colorselectionback.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorselectionback.MinimumSize = new System.Drawing.Size(100, 23);
this.colorselectionback.Name = "colorselectionback";
@ -2032,7 +2060,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorselectionfore.BackColor = System.Drawing.Color.Transparent;
this.colorselectionfore.Label = "Selection:";
this.colorselectionfore.Location = new System.Drawing.Point(15, 269);
this.colorselectionfore.Location = new System.Drawing.Point(15, 279);
this.colorselectionfore.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorselectionfore.MinimumSize = new System.Drawing.Size(100, 23);
this.colorselectionfore.Name = "colorselectionfore";
@ -2044,7 +2072,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorincludes.BackColor = System.Drawing.Color.Transparent;
this.colorincludes.Label = "Includes:";
this.colorincludes.Location = new System.Drawing.Point(15, 241);
this.colorincludes.Location = new System.Drawing.Point(15, 253);
this.colorincludes.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorincludes.MinimumSize = new System.Drawing.Size(100, 23);
this.colorincludes.Name = "colorincludes";
@ -2056,7 +2084,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorstrings.BackColor = System.Drawing.Color.Transparent;
this.colorstrings.Label = "Strings:";
this.colorstrings.Location = new System.Drawing.Point(15, 157);
this.colorstrings.Location = new System.Drawing.Point(15, 175);
this.colorstrings.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorstrings.MinimumSize = new System.Drawing.Size(100, 23);
this.colorstrings.Name = "colorstrings";
@ -2068,7 +2096,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorscriptbackground.BackColor = System.Drawing.Color.Transparent;
this.colorscriptbackground.Label = "Background:";
this.colorscriptbackground.Location = new System.Drawing.Point(15, 17);
this.colorscriptbackground.Location = new System.Drawing.Point(15, 45);
this.colorscriptbackground.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorscriptbackground.MinimumSize = new System.Drawing.Size(100, 23);
this.colorscriptbackground.Name = "colorscriptbackground";
@ -2080,7 +2108,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorplaintext.BackColor = System.Drawing.Color.Transparent;
this.colorplaintext.Label = "Plain text:";
this.colorplaintext.Location = new System.Drawing.Point(15, 73);
this.colorplaintext.Location = new System.Drawing.Point(15, 97);
this.colorplaintext.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorplaintext.MinimumSize = new System.Drawing.Size(100, 23);
this.colorplaintext.Name = "colorplaintext";
@ -2092,7 +2120,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorcomments.BackColor = System.Drawing.Color.Transparent;
this.colorcomments.Label = "Comments:";
this.colorcomments.Location = new System.Drawing.Point(15, 101);
this.colorcomments.Location = new System.Drawing.Point(15, 123);
this.colorcomments.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorcomments.MinimumSize = new System.Drawing.Size(100, 23);
this.colorcomments.Name = "colorcomments";
@ -2104,7 +2132,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorlinenumbers.BackColor = System.Drawing.Color.Transparent;
this.colorlinenumbers.Label = "Line numbers:";
this.colorlinenumbers.Location = new System.Drawing.Point(15, 45);
this.colorlinenumbers.Location = new System.Drawing.Point(15, 71);
this.colorlinenumbers.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorlinenumbers.MinimumSize = new System.Drawing.Size(100, 23);
this.colorlinenumbers.Name = "colorlinenumbers";
@ -2116,7 +2144,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorkeywords.BackColor = System.Drawing.Color.Transparent;
this.colorkeywords.Label = "Keywords:";
this.colorkeywords.Location = new System.Drawing.Point(15, 129);
this.colorkeywords.Location = new System.Drawing.Point(15, 149);
this.colorkeywords.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorkeywords.MinimumSize = new System.Drawing.Size(100, 23);
this.colorkeywords.Name = "colorkeywords";
@ -2128,7 +2156,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorliterals.BackColor = System.Drawing.Color.Transparent;
this.colorliterals.Label = "Numbers:";
this.colorliterals.Location = new System.Drawing.Point(15, 185);
this.colorliterals.Location = new System.Drawing.Point(15, 201);
this.colorliterals.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorliterals.MinimumSize = new System.Drawing.Size(100, 23);
this.colorliterals.Name = "colorliterals";
@ -2140,7 +2168,7 @@ namespace CodeImp.DoomBuilder.Windows
//
this.colorconstants.BackColor = System.Drawing.Color.Transparent;
this.colorconstants.Label = "Constants:";
this.colorconstants.Location = new System.Drawing.Point(15, 213);
this.colorconstants.Location = new System.Drawing.Point(15, 227);
this.colorconstants.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorconstants.MinimumSize = new System.Drawing.Size(100, 23);
this.colorconstants.Name = "colorconstants";
@ -2356,30 +2384,28 @@ namespace CodeImp.DoomBuilder.Windows
// browseScreenshotsFolderDialog
//
this.browseScreenshotsFolderDialog.Description = "Select a Folder to Save Screenshots Into";
//
// colorfoldfore
// scriptcolorpresets
//
this.colorfoldfore.BackColor = System.Drawing.Color.Transparent;
this.colorfoldfore.Label = "Fold:";
this.colorfoldfore.Location = new System.Drawing.Point(15, 437);
this.colorfoldfore.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorfoldfore.MinimumSize = new System.Drawing.Size(100, 23);
this.colorfoldfore.Name = "colorfoldfore";
this.colorfoldfore.Size = new System.Drawing.Size(168, 23);
this.colorfoldfore.TabIndex = 15;
this.colorfoldfore.ColorChanged += new System.EventHandler(this.colorfoldfore_ColorChanged);
this.scriptcolorpresets.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.scriptcolorpresets.FormattingEnabled = true;
this.scriptcolorpresets.Items.AddRange(new object[] {
"Use current settings",
"Light theme",
"Dark theme"});
this.scriptcolorpresets.Location = new System.Drawing.Point(61, 18);
this.scriptcolorpresets.Name = "scriptcolorpresets";
this.scriptcolorpresets.Size = new System.Drawing.Size(122, 21);
this.scriptcolorpresets.TabIndex = 39;
this.scriptcolorpresets.SelectedIndexChanged += new System.EventHandler(this.scriptcolorpresets_SelectedIndexChanged);
//
// colorfoldback
// label28
//
this.colorfoldback.BackColor = System.Drawing.Color.Transparent;
this.colorfoldback.Label = "Fold BG:";
this.colorfoldback.Location = new System.Drawing.Point(15, 465);
this.colorfoldback.MaximumSize = new System.Drawing.Size(10000, 23);
this.colorfoldback.MinimumSize = new System.Drawing.Size(100, 23);
this.colorfoldback.Name = "colorfoldback";
this.colorfoldback.Size = new System.Drawing.Size(168, 23);
this.colorfoldback.TabIndex = 16;
this.colorfoldback.ColorChanged += new System.EventHandler(this.colorfoldback_ColorChanged);
this.label28.AutoSize = true;
this.label28.Location = new System.Drawing.Point(15, 22);
this.label28.Name = "label28";
this.label28.Size = new System.Drawing.Size(40, 13);
this.label28.TabIndex = 40;
this.label28.Text = "Preset:";
//
// PreferencesForm
//
@ -2447,6 +2473,7 @@ namespace CodeImp.DoomBuilder.Windows
this.groupBox7.ResumeLayout(false);
this.groupBox7.PerformLayout();
this.groupBox6.ResumeLayout(false);
this.groupBox6.PerformLayout();
this.previewgroup.ResumeLayout(false);
this.tabnights.ResumeLayout(false);
this.tabnights.PerformLayout();
@ -2630,5 +2657,7 @@ namespace CodeImp.DoomBuilder.Windows
private CodeImp.DoomBuilder.Controls.ScriptEditorPreviewControl scriptedit;
private CodeImp.DoomBuilder.Controls.ColorControl colorfoldback;
private CodeImp.DoomBuilder.Controls.ColorControl colorfoldfore;
private System.Windows.Forms.ComboBox scriptcolorpresets;
private System.Windows.Forms.Label label28;
}
}

View file

@ -24,6 +24,7 @@ using CodeImp.DoomBuilder.Actions;
using System.Globalization;
using CodeImp.DoomBuilder.Data;
using System.IO;
using CodeImp.DoomBuilder.Rendering;
using Action = CodeImp.DoomBuilder.Actions.Action;
#endregion
@ -207,6 +208,9 @@ namespace CodeImp.DoomBuilder.Windows
colorfoldfore.Color = General.Colors.ScriptFoldForeColor; //mxd
colorfoldback.Color = General.Colors.ScriptFoldBackColor; //mxd
//mxd. Select "Current colors" preset
scriptcolorpresets.SelectedIndex = 0;
blackbrowsers.Checked = General.Settings.BlackBrowsers;
capitalizetexturenames.Checked = General.Settings.CapitalizeTextureNames; //mxd
classicbilinear.Checked = General.Settings.ClassicBilinear;
@ -1086,6 +1090,92 @@ namespace CodeImp.DoomBuilder.Windows
if (allowapplycontrol) scriptedit.FoldBackColor = colorfoldback.Color.ToColor();
}
private void scriptcolorpresets_SelectedIndexChanged(object sender, EventArgs e)
{
if (!allowapplycontrol) return;
switch (scriptcolorpresets.SelectedIndex)
{
case 0: // Restore current colors
colorscriptbackground.Color = General.Colors.ScriptBackground;
colorlinenumbers.Color = General.Colors.LineNumbers;
colorplaintext.Color = General.Colors.PlainText;
colorcomments.Color = General.Colors.Comments;
colorkeywords.Color = General.Colors.Keywords;
colorliterals.Color = General.Colors.Literals;
colorconstants.Color = General.Colors.Constants;
colorstrings.Color = General.Colors.Strings;
colorincludes.Color = General.Colors.Includes;
colorindicator.Color = General.Colors.ScriptIndicator;
colorbrace.Color = General.Colors.ScriptBraceHighlight;
colorbracebad.Color = General.Colors.ScriptBadBraceHighlight;
colorwhitespace.Color = General.Colors.ScriptWhitespace;
colorfoldfore.Color = General.Colors.ScriptFoldForeColor;
colorfoldback.Color = General.Colors.ScriptFoldBackColor;
colorselectionfore.Color = General.Colors.ScriptSelectionForeColor;
colorselectionback.Color = General.Colors.ScriptSelectionBackColor;
break;
case 1: // Light theme
colorlinenumbers.Color = PixelColor.FromInt(-13921873);
colorplaintext.Color = PixelColor.FromInt(-16777216);
colorcomments.Color = PixelColor.FromInt(-16744448);
colorkeywords.Color = PixelColor.FromInt(-16741493);
colorliterals.Color = PixelColor.FromInt(-16776961);
colorconstants.Color = PixelColor.FromInt(-16744256);
colorstrings.Color = PixelColor.FromInt(-6089451);
colorincludes.Color = PixelColor.FromInt(-9868951);
colorindicator.Color = PixelColor.FromInt(-16711936);
colorbrace.Color = PixelColor.FromInt(-16711681);
colorbracebad.Color = PixelColor.FromInt(-65536);
colorwhitespace.Color = PixelColor.FromInt(-8355712);
colorfoldfore.Color = PixelColor.FromColor(SystemColors.ControlDark);
colorfoldback.Color = PixelColor.FromColor(SystemColors.ControlLightLight);
colorselectionfore.Color = PixelColor.FromInt(-1);
colorselectionback.Color = PixelColor.FromInt(-13395457);
colorscriptbackground.Color = PixelColor.FromInt(-1);
break;
case 2: // Dark theme
colorscriptbackground.Color = new PixelColor(255, 34, 40, 42);
colorlinenumbers.Color = new PixelColor(255, 63, 78, 73);
colorplaintext.Color = new PixelColor(255, 241, 242, 243);
colorcomments.Color = new PixelColor(255, 102, 116, 123);
colorkeywords.Color = new PixelColor(255, 103, 140, 177);
colorliterals.Color = new PixelColor(255, 255, 205, 34);
colorconstants.Color = new PixelColor(255, 147, 199, 99);
colorstrings.Color = new PixelColor(255, 236, 118, 0);
colorincludes.Color = new PixelColor(255, 160, 130, 189);
colorindicator.Color = new PixelColor(255, 211, 209, 85);
colorbrace.Color = new PixelColor(255, 135, 211, 85);
colorbracebad.Color = new PixelColor(255, 150, 58, 70);
colorwhitespace.Color = new PixelColor(255, 241, 242, 243);
colorfoldfore.Color = new PixelColor(255, 37, 92, 111);
colorfoldback.Color = new PixelColor(255, 41, 49, 52);
colorselectionfore.Color = new PixelColor(255, 255, 255, 255);
colorselectionback.Color = new PixelColor(255, 71, 71, 71);
break;
}
// Apply changes
scriptedit.ScriptBackground = colorscriptbackground.Color.ToColor();
scriptedit.LineNumbers = colorlinenumbers.Color.ToColor();
scriptedit.PlainText = colorplaintext.Color.ToColor();
scriptedit.Comments = colorcomments.Color.ToColor();
scriptedit.Keywords = colorkeywords.Color.ToColor();
scriptedit.Strings = colorstrings.Color.ToColor();
scriptedit.Literals = colorliterals.Color.ToColor();
scriptedit.Constants = colorconstants.Color.ToColor();
scriptedit.Includes = colorincludes.Color.ToColor();
scriptedit.SelectionForeColor = colorselectionfore.Color.ToColor();
scriptedit.SelectionBackColor = colorselectionback.Color.ToColor();
scriptedit.ScriptIndicator = colorindicator.Color.ToColor();
scriptedit.BraceHighlight = colorbrace.Color.ToColor();
scriptedit.BadBraceHighlight = colorbracebad.Color.ToColor();
scriptedit.WhitespaceColor = colorwhitespace.Color.ToColor();
scriptedit.FoldForeColor = colorfoldfore.Color.ToColor();
scriptedit.FoldBackColor = colorfoldback.Color.ToColor();
}
#endregion
#region ================== Screenshots Stuff (mxd)