diff --git a/Build/Configurations/Boom_Doom2Doom.cfg b/Build/Configurations/Boom_Doom2Doom.cfg index d6f3a6ca..82e282a7 100644 --- a/Build/Configurations/Boom_Doom2Doom.cfg +++ b/Build/Configurations/Boom_Doom2Doom.cfg @@ -11,6 +11,9 @@ game = "Boom: Doom 2 (Doom format)"; // This is the simplified game engine/sourceport name engine = "boom"; +// Should this configuration be initially available? +enabledbydefault = true; + // ******************************************************* // * * // * Note: all the elements that could be factorized * diff --git a/Build/Configurations/Doom_Doom2Doom.cfg b/Build/Configurations/Doom_Doom2Doom.cfg index dee99977..cbcfab3a 100644 --- a/Build/Configurations/Doom_Doom2Doom.cfg +++ b/Build/Configurations/Doom_Doom2Doom.cfg @@ -11,6 +11,9 @@ game = "Doom: Doom 2 (Doom format)"; // This is the simplified game engine/sourceport name engine = "doom2"; +// Should this configuration be initially available? +enabledbydefault = true; + // ******************************************************* // * * // * Note: all the elements that could be factorized * diff --git a/Build/Configurations/GZDoom_DoomHexen.cfg b/Build/Configurations/GZDoom_DoomHexen.cfg index 4faa67f1..d5b99f20 100644 --- a/Build/Configurations/GZDoom_DoomHexen.cfg +++ b/Build/Configurations/GZDoom_DoomHexen.cfg @@ -11,6 +11,9 @@ game = "GZDoom: Doom (Hexen format)"; // This is the simplified game engine/sourceport name engine = "gzdoom"; +// Should this configuration be initially available? +enabledbydefault = true; + // ******************************************************* // * * // * Note: all the elements that could be factorized * diff --git a/Build/Configurations/GZDoom_DoomUDMF.cfg b/Build/Configurations/GZDoom_DoomUDMF.cfg index 51d69677..cc6b0683 100644 --- a/Build/Configurations/GZDoom_DoomUDMF.cfg +++ b/Build/Configurations/GZDoom_DoomUDMF.cfg @@ -11,6 +11,9 @@ game = "GZDoom: Doom (UDMF)"; // This is the simplified game engine/sourceport name engine = "gzdoom"; +// Should this configuration be initially available? +enabledbydefault = true; + // ******************************************************* // * * // * Note: all the elements that could be factorized * diff --git a/Build/Configurations/Includes/Doom_things.cfg b/Build/Configurations/Includes/Doom_things.cfg index 8d085cc1..dfcf0759 100644 --- a/Build/Configurations/Includes/Doom_things.cfg +++ b/Build/Configurations/Includes/Doom_things.cfg @@ -108,7 +108,7 @@ monsters { title = "Spectre"; width = 30; - sprite = "SARGA2A8"; + sprite = "SARGF1"; class = "Spectre"; } diff --git a/Build/Snippets/acs/dountil.txt b/Build/Snippets/acs/dountil.txt index 674191f9..7357a45d 100644 --- a/Build/Snippets/acs/dountil.txt +++ b/Build/Snippets/acs/dountil.txt @@ -1,3 +1,3 @@ -do { +do[LB]{ -} until ($EP); \ No newline at end of file +} until ([EP]); \ No newline at end of file diff --git a/Build/Snippets/acs/dowhile.txt b/Build/Snippets/acs/dowhile.txt index a75ae734..e0fbc7bd 100644 --- a/Build/Snippets/acs/dowhile.txt +++ b/Build/Snippets/acs/dowhile.txt @@ -1,3 +1,3 @@ -do { +do[LB]{ -} while ($EP); \ No newline at end of file +} while ([EP]); \ No newline at end of file diff --git a/Build/Snippets/acs/for.txt b/Build/Snippets/acs/for.txt index 5b627014..7e17d770 100644 --- a/Build/Snippets/acs/for.txt +++ b/Build/Snippets/acs/for.txt @@ -1,3 +1,3 @@ -for (int i = 0; i < $EP; i++) { +for (int i = 0; i < [EP]; i++)[LB]{ } diff --git a/Build/Snippets/acs/if.txt b/Build/Snippets/acs/if.txt index 7619da51..14badb6f 100644 --- a/Build/Snippets/acs/if.txt +++ b/Build/Snippets/acs/if.txt @@ -1,3 +1,3 @@ -if ($EP) { +if ([EP])[LB]{ } \ No newline at end of file diff --git a/Build/Snippets/acs/ifelse.txt b/Build/Snippets/acs/ifelse.txt index 0f434e5d..7a295ac3 100644 --- a/Build/Snippets/acs/ifelse.txt +++ b/Build/Snippets/acs/ifelse.txt @@ -1,5 +1,5 @@ -if ($EP) { +if ([EP])[LB]{ -} else { +}[LB]else[LB]{ } \ No newline at end of file diff --git a/Build/Snippets/acs/include.txt b/Build/Snippets/acs/include.txt index a42605cb..bb0362a9 100644 --- a/Build/Snippets/acs/include.txt +++ b/Build/Snippets/acs/include.txt @@ -1,5 +1,5 @@ #include "zcommon.acs" -script 1 OPEN { - $EP +script 1 OPEN[LB]{ + [EP] } \ No newline at end of file diff --git a/Build/Snippets/acs/script.txt b/Build/Snippets/acs/script.txt index df9a30b3..1e948199 100644 --- a/Build/Snippets/acs/script.txt +++ b/Build/Snippets/acs/script.txt @@ -1,3 +1,3 @@ -script $EP (void) { +script [EP] (void)[LB]{ } \ No newline at end of file diff --git a/Build/Snippets/acs/until.txt b/Build/Snippets/acs/until.txt index 6c90ca51..4639be43 100644 --- a/Build/Snippets/acs/until.txt +++ b/Build/Snippets/acs/until.txt @@ -1,3 +1,3 @@ -until ($EP) { +until ([EP])[LB]{ } \ No newline at end of file diff --git a/Build/Snippets/acs/while.txt b/Build/Snippets/acs/while.txt index f01f9a82..4c9f6321 100644 --- a/Build/Snippets/acs/while.txt +++ b/Build/Snippets/acs/while.txt @@ -1,3 +1,3 @@ -while ($EP) { +while ([EP])[LB]{ } \ No newline at end of file diff --git a/Help/gzdb/features/scripting/snippets.html b/Help/gzdb/features/scripting/snippets.html index e2ffbff7..f79ca609 100644 --- a/Help/gzdb/features/scripting/snippets.html +++ b/Help/gzdb/features/scripting/snippets.html @@ -34,8 +34,14 @@ Example: to create the while loop, type "while"...


...and press the Tab key.

Creating new code snippets:
- Code snippets are plain text files stored in [GZDB]\Snippets\[category], so just create a new text file there and add the code you want into it. Currently the only supported "special" token is $EP (Entry Point) - that's the place where the cursor will be placed after inserting a snippet.
- Warning: snippet's file name should not contain spaces.

+ Code snippets are plain text files stored in [GZDB]\Snippets\[category], so just create a new text file there and add the code you want into it.
+ There are several special tokens you can use:

+ + Warning: snippet's file name must not contain spaces.

Creating new code snippets for custom scripting configurations:
To add snippets to a scripting configuration, which doesn't already have existing snippets ("Insert a Code Snippet" drop-down is disabled in the Script Editor), you'll have to:

    diff --git a/Source/Core/Config/ConfigurationInfo.cs b/Source/Core/Config/ConfigurationInfo.cs index 1e58694a..09b6c25f 100644 --- a/Source/Core/Config/ConfigurationInfo.cs +++ b/Source/Core/Config/ConfigurationInfo.cs @@ -118,7 +118,7 @@ namespace CodeImp.DoomBuilder.Config this.nodebuildertest = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuildertest", MISSING_NODEBUILDER); this.resources = new DataLocationList(General.Settings.Config, "configurations." + settingskey + ".resources"); this.startmode = General.Settings.ReadSetting("configurations." + settingskey + ".startmode", "VerticesMode"); - this.enabled = General.Settings.ReadSetting("configurations." + settingskey + ".enabled", false); //mxd + this.enabled = General.Settings.ReadSetting("configurations." + settingskey + ".enabled", config.ReadSetting("enabledbydefault", false)); //mxd //mxd. read test engines testEngines = new List(); diff --git a/Source/Core/Config/ProgramConfiguration.cs b/Source/Core/Config/ProgramConfiguration.cs index 55844757..6b2cfccc 100644 --- a/Source/Core/Config/ProgramConfiguration.cs +++ b/Source/Core/Config/ProgramConfiguration.cs @@ -66,6 +66,7 @@ namespace CodeImp.DoomBuilder.Config private bool scriptfontbold; private bool scriptontop; private bool scriptautoindent; + private bool snippetsallmanstyle; //mxd private int scripttabwidth; private int previewimagesize; private int autoscrollspeed; @@ -155,6 +156,7 @@ namespace CodeImp.DoomBuilder.Config public bool AnimateVisualSelection { get { return animatevisualselection; } internal set { animatevisualselection = value; } } public int ScriptTabWidth { get { return scripttabwidth; } internal set { scripttabwidth = value; } } public bool ScriptAutoIndent { get { return scriptautoindent; } internal set { scriptautoindent = value; } } + public bool SnippetsAllmanStyle { get { return snippetsallmanstyle; } internal set { snippetsallmanstyle = value; } } //mxd internal int PreviousVersion { get { return previousversion; } } internal PasteOptions PasteOptions { get { return pasteoptions; } set { pasteoptions = value; } } public int DockersPosition { get { return dockersposition; } internal set { dockersposition = value; } } @@ -254,6 +256,7 @@ namespace CodeImp.DoomBuilder.Config scriptfontsize = cfg.ReadSetting("scriptfontsize", 10); scriptfontbold = cfg.ReadSetting("scriptfontbold", false); scriptautoindent = cfg.ReadSetting("scriptautoindent", true); + snippetsallmanstyle = cfg.ReadSetting("snippetsallmanstyle", false); //mxd scriptontop = cfg.ReadSetting("scriptontop", true); scripttabwidth = cfg.ReadSetting("scripttabwidth", 4); previewimagesize = cfg.ReadSetting("previewimagesize", 1); @@ -344,6 +347,7 @@ namespace CodeImp.DoomBuilder.Config cfg.WriteSetting("scriptontop", scriptontop); cfg.WriteSetting("scripttabwidth", scripttabwidth); cfg.WriteSetting("scriptautoindent", scriptautoindent); + cfg.WriteSetting("snippetsallmanstyle", snippetsallmanstyle); //mxd cfg.WriteSetting("previewimagesize", previewimagesize); cfg.WriteSetting("autoscrollspeed", autoscrollspeed); cfg.WriteSetting("zoomfactor", zoomfactor); diff --git a/Source/Core/Controls/ScriptEditorControl.cs b/Source/Core/Controls/ScriptEditorControl.cs index 4ea78025..f47817d2 100644 --- a/Source/Core/Controls/ScriptEditorControl.cs +++ b/Source/Core/Controls/ScriptEditorControl.cs @@ -663,18 +663,18 @@ namespace CodeImp.DoomBuilder.Controls string spaces = new String(' ', General.Settings.ScriptTabWidth); int entrypos = -1; int entryline = -1; - string[] processedlines = new string[lines.Length]; + string[] processedlines = processLineBreaks(lines); for (int i = 0; i < lines.Length; i++) { - processedlines[i] = lines[i].Replace("\t", spaces); + processedlines[i] = processedlines[i].Replace("\t", spaces); - //check if we have the $EP marker + //check if we have the [EP] marker if (entrypos == -1) { - int pos = processedlines[i].IndexOf("$EP"); + int pos = processedlines[i].IndexOf("[EP]"); if (pos != -1) { entryline = curline + i; entrypos = pos + numtabs; - processedlines[i] = processedlines[i].Remove(pos, 3); + processedlines[i] = processedlines[i].Remove(pos, 4); } } } @@ -685,7 +685,7 @@ namespace CodeImp.DoomBuilder.Controls scriptedit.SelectionEnd = scriptedit.WordEndPosition(scriptedit.CurrentPos, true); scriptedit.ReplaceSel(text); - //move the cursor if we had the $EP marker + //move the cursor if we had the [EP] marker if (entrypos != -1) { MoveToLine(entryline); scriptedit.SelectionStart = scriptedit.PositionFromLine(entryline) + entrypos; @@ -693,6 +693,27 @@ namespace CodeImp.DoomBuilder.Controls } } + //mxd. This converts [LB] markers to line breaks if necessary + private string[] processLineBreaks(string[] lines) + { + List result = new List(lines.Length); + string[] separator = new[] { "[LB]" }; + + foreach(string line in lines) { + if(line.IndexOf(separator[0]) != -1) { + if(General.Settings.SnippetsAllmanStyle) { + result.AddRange(line.Split(separator, StringSplitOptions.RemoveEmptyEntries)); + } else { + result.Add(line.Replace(separator[0], " ")); + } + } else { + result.Add(line); + } + } + + return result.ToArray(); + } + #endregion #region ================== Events diff --git a/Source/Core/Types/EnumBitsHandler.cs b/Source/Core/Types/EnumBitsHandler.cs index 4ddfcfb0..3ccc3220 100644 --- a/Source/Core/Types/EnumBitsHandler.cs +++ b/Source/Core/Types/EnumBitsHandler.cs @@ -73,8 +73,6 @@ namespace CodeImp.DoomBuilder.Types public override void SetValue(object value) { - int result; - // Null? if(value == null) { @@ -89,6 +87,7 @@ namespace CodeImp.DoomBuilder.Types else { // Try parsing as string + int result; if(int.TryParse(value.ToString(), NumberStyles.Integer, CultureInfo.CurrentCulture, out result)) { this.value = result; diff --git a/Source/Core/Types/EnumOptionHandler.cs b/Source/Core/Types/EnumOptionHandler.cs index 1ac0fab4..d61432ec 100644 --- a/Source/Core/Types/EnumOptionHandler.cs +++ b/Source/Core/Types/EnumOptionHandler.cs @@ -64,7 +64,7 @@ namespace CodeImp.DoomBuilder.Types base.SetupField(attr, fieldinfo); // Keep enum list reference - if(fieldinfo != null) list = fieldinfo.Enum; else list = new EnumList(); + list = (fieldinfo != null ? fieldinfo.Enum : new EnumList()); } #endregion @@ -140,7 +140,8 @@ namespace CodeImp.DoomBuilder.Types } //mxd - public override void SetDefaultValue() { + public override void SetDefaultValue() + { value = defaultValue; } @@ -171,9 +172,9 @@ namespace CodeImp.DoomBuilder.Types } } - public override string GetStringValue() + public override string GetStringValue() { - if(this.value != null) return this.value.Title; else return "NULL"; + return (this.value != null ? this.value.Title : "NULL"); } // This returns an enum list diff --git a/Source/Core/Types/TypeHandler.cs b/Source/Core/Types/TypeHandler.cs index df37216c..9c8bab8e 100644 --- a/Source/Core/Types/TypeHandler.cs +++ b/Source/Core/Types/TypeHandler.cs @@ -124,10 +124,8 @@ namespace CodeImp.DoomBuilder.Types // How the value is actually validated and stored is up to the implementation public abstract void SetValue(object value); - //mxd. this should replace current value with default one - public virtual void SetDefaultValue() { - throw new NotSupportedException("Override this method to support default value for this type"); - } + //mxd. This should replace current value with the default one + public virtual void SetDefaultValue() { } // This must return the value as one of the primitive data types // supported by UDMF: int, string, float or bool @@ -136,7 +134,7 @@ namespace CodeImp.DoomBuilder.Types // This must return the value as integer (for arguments) public virtual int GetIntValue() { - throw new NotSupportedException("Override this method to support it as integer for arguments"); + throw new NotImplementedException("Override this method to support it as integer for arguments"); } // This must return the value as a string for displaying diff --git a/Source/Core/Windows/PreferencesForm.Designer.cs b/Source/Core/Windows/PreferencesForm.Designer.cs index 8fb8506e..81198f0d 100644 --- a/Source/Core/Windows/PreferencesForm.Designer.cs +++ b/Source/Core/Windows/PreferencesForm.Designer.cs @@ -38,6 +38,7 @@ namespace CodeImp.DoomBuilder.Windows System.Windows.Forms.Label label18; System.Windows.Forms.Label label20; System.Windows.Forms.Label label21; + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreferencesForm)); this.recentFiles = new Dotnetrix.Controls.TrackBar(); this.labelRecentFiles = new System.Windows.Forms.Label(); this.label25 = new System.Windows.Forms.Label(); @@ -142,10 +143,11 @@ namespace CodeImp.DoomBuilder.Windows this.imagebrightnesslabel = new System.Windows.Forms.Label(); this.imagebrightness = new Dotnetrix.Controls.TrackBar(); this.colorsgroup3 = new System.Windows.Forms.GroupBox(); - this.fontpreview = new System.Windows.Forms.RichTextBox(); + this.snippetsallmanstyle = new System.Windows.Forms.CheckBox(); this.scripttabwidth = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox(); this.scriptautoindent = new System.Windows.Forms.CheckBox(); this.label10 = new System.Windows.Forms.Label(); + this.fontpreview = new System.Windows.Forms.RichTextBox(); this.scriptfontsize = new System.Windows.Forms.ComboBox(); this.label8 = new System.Windows.Forms.Label(); this.scriptfontbold = new System.Windows.Forms.CheckBox(); @@ -478,6 +480,8 @@ namespace CodeImp.DoomBuilder.Windows label18.TabIndex = 25; label18.Text = "Max. dynamic lights to render:"; label18.TextAlign = System.Drawing.ContentAlignment.TopRight; + this.toolTip1.SetToolTip(label18, "Controlls how many dynamic lights could be \r\nrendered simultaneously in Visual mo" + + "de "); // // label20 // @@ -1490,10 +1494,11 @@ namespace CodeImp.DoomBuilder.Windows // this.colorsgroup3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - this.colorsgroup3.Controls.Add(this.fontpreview); + this.colorsgroup3.Controls.Add(this.snippetsallmanstyle); this.colorsgroup3.Controls.Add(this.scripttabwidth); this.colorsgroup3.Controls.Add(this.scriptautoindent); this.colorsgroup3.Controls.Add(this.label10); + this.colorsgroup3.Controls.Add(this.fontpreview); this.colorsgroup3.Controls.Add(this.scriptfontsize); this.colorsgroup3.Controls.Add(this.label8); this.colorsgroup3.Controls.Add(this.scriptfontbold); @@ -1514,19 +1519,16 @@ namespace CodeImp.DoomBuilder.Windows this.colorsgroup3.Text = " Script editor "; this.colorsgroup3.Visible = false; // - // fontpreview + // snippetsallmanstyle // - this.fontpreview.Cursor = System.Windows.Forms.Cursors.Arrow; - this.fontpreview.DetectUrls = false; - this.fontpreview.Location = new System.Drawing.Point(202, 73); - this.fontpreview.Name = "fontpreview"; - this.fontpreview.ReadOnly = true; - this.fontpreview.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; - this.fontpreview.Size = new System.Drawing.Size(233, 100); - this.fontpreview.TabIndex = 33; - this.fontpreview.Text = "1 #include \"zcommon.acs\"\n2 script 0 (void) { //a comment\n3 CONSTANT_VALUE;\n" + - "4 }"; - this.fontpreview.WordWrap = false; + this.snippetsallmanstyle.AutoSize = true; + this.snippetsallmanstyle.Location = new System.Drawing.Point(202, 187); + this.snippetsallmanstyle.Name = "snippetsallmanstyle"; + this.snippetsallmanstyle.Size = new System.Drawing.Size(179, 18); + this.snippetsallmanstyle.TabIndex = 34; + this.snippetsallmanstyle.Text = "Allman-style bracing in snippets"; + this.toolTip1.SetToolTip(this.snippetsallmanstyle, resources.GetString("snippetsallmanstyle.ToolTip")); + this.snippetsallmanstyle.UseVisualStyleBackColor = true; // // scripttabwidth // @@ -1535,7 +1537,7 @@ namespace CodeImp.DoomBuilder.Windows this.scripttabwidth.AllowRelative = false; this.scripttabwidth.ButtonStep = 2; this.scripttabwidth.ButtonStepFloat = 1F; - this.scripttabwidth.Location = new System.Drawing.Point(259, 179); + this.scripttabwidth.Location = new System.Drawing.Point(364, 157); this.scripttabwidth.Name = "scripttabwidth"; this.scripttabwidth.Size = new System.Drawing.Size(71, 24); this.scripttabwidth.StepValues = null; @@ -1544,7 +1546,7 @@ namespace CodeImp.DoomBuilder.Windows // scriptautoindent // this.scriptautoindent.AutoSize = true; - this.scriptautoindent.Location = new System.Drawing.Point(354, 183); + this.scriptautoindent.Location = new System.Drawing.Point(202, 161); this.scriptautoindent.Name = "scriptautoindent"; this.scriptautoindent.Size = new System.Drawing.Size(81, 18); this.scriptautoindent.TabIndex = 31; @@ -1554,12 +1556,26 @@ namespace CodeImp.DoomBuilder.Windows // label10 // this.label10.AutoSize = true; - this.label10.Location = new System.Drawing.Point(199, 184); + this.label10.Location = new System.Drawing.Point(304, 162); this.label10.Name = "label10"; this.label10.Size = new System.Drawing.Size(57, 14); this.label10.TabIndex = 30; this.label10.Text = "Tab width:"; // + // fontpreview + // + this.fontpreview.Cursor = System.Windows.Forms.Cursors.Arrow; + this.fontpreview.DetectUrls = false; + this.fontpreview.Location = new System.Drawing.Point(202, 70); + this.fontpreview.Name = "fontpreview"; + this.fontpreview.ReadOnly = true; + this.fontpreview.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None; + this.fontpreview.Size = new System.Drawing.Size(233, 80); + this.fontpreview.TabIndex = 33; + this.fontpreview.Text = "1 #include \"zcommon.acs\"\n2 script 0 (void) { //a comment\n3 CONSTANT_VALUE;\n" + + "4 }"; + this.fontpreview.WordWrap = false; + // // scriptfontsize // this.scriptfontsize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList; @@ -1582,7 +1598,7 @@ namespace CodeImp.DoomBuilder.Windows "36", "48", "72"}); - this.scriptfontsize.Location = new System.Drawing.Point(236, 45); + this.scriptfontsize.Location = new System.Drawing.Point(236, 43); this.scriptfontsize.Name = "scriptfontsize"; this.scriptfontsize.Size = new System.Drawing.Size(94, 22); this.scriptfontsize.TabIndex = 25; @@ -1591,7 +1607,7 @@ namespace CodeImp.DoomBuilder.Windows // label8 // this.label8.AutoSize = true; - this.label8.Location = new System.Drawing.Point(199, 48); + this.label8.Location = new System.Drawing.Point(199, 46); this.label8.Name = "label8"; this.label8.Size = new System.Drawing.Size(31, 14); this.label8.TabIndex = 28; @@ -1600,7 +1616,7 @@ namespace CodeImp.DoomBuilder.Windows // scriptfontbold // this.scriptfontbold.AutoSize = true; - this.scriptfontbold.Location = new System.Drawing.Point(354, 47); + this.scriptfontbold.Location = new System.Drawing.Point(354, 45); this.scriptfontbold.Name = "scriptfontbold"; this.scriptfontbold.Size = new System.Drawing.Size(47, 18); this.scriptfontbold.TabIndex = 26; @@ -1941,5 +1957,6 @@ namespace CodeImp.DoomBuilder.Windows private Dotnetrix.Controls.TrackBar recentFiles; private System.Windows.Forms.Label labelRecentFiles; private System.Windows.Forms.Label label25; + private System.Windows.Forms.CheckBox snippetsallmanstyle; } } \ No newline at end of file diff --git a/Source/Core/Windows/PreferencesForm.cs b/Source/Core/Windows/PreferencesForm.cs index c227fdda..52a3c2fc 100644 --- a/Source/Core/Windows/PreferencesForm.cs +++ b/Source/Core/Windows/PreferencesForm.cs @@ -74,6 +74,7 @@ namespace CodeImp.DoomBuilder.Windows scriptontop.Checked = General.Settings.ScriptOnTop; scripttabwidth.Text = General.Settings.ScriptTabWidth.ToString(); scriptautoindent.Checked = General.Settings.ScriptAutoIndent; + snippetsallmanstyle.Checked = General.Settings.SnippetsAllmanStyle; //mxd previewsize.Value = General.Clamp(General.Settings.PreviewImageSize, previewsize.Minimum, previewsize.Maximum); autoscrollspeed.Value = General.Clamp(General.Settings.AutoScrollSpeed, autoscrollspeed.Minimum, autoscrollspeed.Maximum); zoomfactor.Value = General.Clamp(General.Settings.ZoomFactor, zoomfactor.Minimum, zoomfactor.Maximum); @@ -225,6 +226,7 @@ namespace CodeImp.DoomBuilder.Windows General.Settings.ScriptOnTop = scriptontop.Checked; General.Settings.ScriptTabWidth = scripttabwidth.GetResult(General.Settings.ScriptTabWidth); General.Settings.ScriptAutoIndent = scriptautoindent.Checked; + General.Settings.SnippetsAllmanStyle = snippetsallmanstyle.Checked; //mxd General.Settings.PreviewImageSize = previewsize.Value; General.Settings.AutoScrollSpeed = autoscrollspeed.Value; General.Settings.ZoomFactor = zoomfactor.Value; diff --git a/Source/Core/Windows/PreferencesForm.resx b/Source/Core/Windows/PreferencesForm.resx index d68fbbd5..21b0019c 100644 --- a/Source/Core/Windows/PreferencesForm.resx +++ b/Source/Core/Windows/PreferencesForm.resx @@ -144,4 +144,14 @@ False + + When enabled, the opening brace +will be placed on a new line. + +Technical side: when enabled, $LB +markers in snippets will be replaced +with newline characters, otherwise +they will be replaced with spaces + + \ No newline at end of file