mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 04:12:12 +00:00
Added "Allman-style bracing in snippets" setting (located in Preferences -> Appearance -> Script Editor).
Snippets: changed token syntax from $XX to [XX] [LB] (Line Break) marker can now be used in snippets. Game Configurations: added "enabledbydefault" parameter. When set to true, a game configuration will be available by default (e.g. when an user starts the editor for the first time). GZDB will no longer throw an exception when trying to update default value in a TypeHandler, which doesn't implement default value handling.
This commit is contained in:
parent
9401828f73
commit
15bcea9417
24 changed files with 124 additions and 54 deletions
|
@ -11,6 +11,9 @@ game = "Boom: Doom 2 (Doom format)";
|
||||||
// This is the simplified game engine/sourceport name
|
// This is the simplified game engine/sourceport name
|
||||||
engine = "boom";
|
engine = "boom";
|
||||||
|
|
||||||
|
// Should this configuration be initially available?
|
||||||
|
enabledbydefault = true;
|
||||||
|
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
// * *
|
// * *
|
||||||
// * Note: all the elements that could be factorized *
|
// * Note: all the elements that could be factorized *
|
||||||
|
|
|
@ -11,6 +11,9 @@ game = "Doom: Doom 2 (Doom format)";
|
||||||
// This is the simplified game engine/sourceport name
|
// This is the simplified game engine/sourceport name
|
||||||
engine = "doom2";
|
engine = "doom2";
|
||||||
|
|
||||||
|
// Should this configuration be initially available?
|
||||||
|
enabledbydefault = true;
|
||||||
|
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
// * *
|
// * *
|
||||||
// * Note: all the elements that could be factorized *
|
// * Note: all the elements that could be factorized *
|
||||||
|
|
|
@ -11,6 +11,9 @@ game = "GZDoom: Doom (Hexen format)";
|
||||||
// This is the simplified game engine/sourceport name
|
// This is the simplified game engine/sourceport name
|
||||||
engine = "gzdoom";
|
engine = "gzdoom";
|
||||||
|
|
||||||
|
// Should this configuration be initially available?
|
||||||
|
enabledbydefault = true;
|
||||||
|
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
// * *
|
// * *
|
||||||
// * Note: all the elements that could be factorized *
|
// * Note: all the elements that could be factorized *
|
||||||
|
|
|
@ -11,6 +11,9 @@ game = "GZDoom: Doom (UDMF)";
|
||||||
// This is the simplified game engine/sourceport name
|
// This is the simplified game engine/sourceport name
|
||||||
engine = "gzdoom";
|
engine = "gzdoom";
|
||||||
|
|
||||||
|
// Should this configuration be initially available?
|
||||||
|
enabledbydefault = true;
|
||||||
|
|
||||||
// *******************************************************
|
// *******************************************************
|
||||||
// * *
|
// * *
|
||||||
// * Note: all the elements that could be factorized *
|
// * Note: all the elements that could be factorized *
|
||||||
|
|
|
@ -108,7 +108,7 @@ monsters
|
||||||
{
|
{
|
||||||
title = "Spectre";
|
title = "Spectre";
|
||||||
width = 30;
|
width = 30;
|
||||||
sprite = "SARGA2A8";
|
sprite = "SARGF1";
|
||||||
class = "Spectre";
|
class = "Spectre";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
do {
|
do[LB]{
|
||||||
|
|
||||||
} until ($EP);
|
} until ([EP]);
|
|
@ -1,3 +1,3 @@
|
||||||
do {
|
do[LB]{
|
||||||
|
|
||||||
} while ($EP);
|
} while ([EP]);
|
|
@ -1,3 +1,3 @@
|
||||||
for (int i = 0; i < $EP; i++) {
|
for (int i = 0; i < [EP]; i++)[LB]{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
if ($EP) {
|
if ([EP])[LB]{
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
if ($EP) {
|
if ([EP])[LB]{
|
||||||
|
|
||||||
} else {
|
}[LB]else[LB]{
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,5 +1,5 @@
|
||||||
#include "zcommon.acs"
|
#include "zcommon.acs"
|
||||||
|
|
||||||
script 1 OPEN {
|
script 1 OPEN[LB]{
|
||||||
$EP
|
[EP]
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
script $EP (void) {
|
script [EP] (void)[LB]{
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
until ($EP) {
|
until ([EP])[LB]{
|
||||||
|
|
||||||
}
|
}
|
|
@ -1,3 +1,3 @@
|
||||||
while ($EP) {
|
while ([EP])[LB]{
|
||||||
|
|
||||||
}
|
}
|
|
@ -34,8 +34,14 @@
|
||||||
<strong>Example:</strong> to create the while loop, type "<strong>while</strong>"...<br /><img src="snippets_expand1.jpg"/><br />
|
<strong>Example:</strong> to create the while loop, type "<strong>while</strong>"...<br /><img src="snippets_expand1.jpg"/><br />
|
||||||
<br />...and press the <strong>Tab</strong> key.<br /><img src="snippets_expand2.jpg"/></p>
|
<br />...and press the <strong>Tab</strong> key.<br /><img src="snippets_expand2.jpg"/></p>
|
||||||
<p><strong>Creating new code snippets:</strong><br />
|
<p><strong>Creating new code snippets:</strong><br />
|
||||||
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 <strong>$EP</strong> (Entry Point) - that's the place where the cursor will be placed after inserting a snippet.<br />
|
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.<br />
|
||||||
<span class="style1">Warning:</span> snippet's file name should not contain spaces.</p>
|
There are several special tokens you can use: </p>
|
||||||
|
<ul>
|
||||||
|
<li><strong>[EP]</strong> (Entry Point) - that's the place where the cursor will be placed after inserting a snippet.</li>
|
||||||
|
<li><strong>[LB]</strong> (Line Break)
|
||||||
|
- these will be converted to line breaks when "<strong>Allman-style bracing in snippets</strong>" (located in Preferences -> Appearance -> Script Editor) setting is enabled, or a space character when it's not.
|
||||||
|
</ul>
|
||||||
|
<span class="style1">Warning:</span> snippet's file name must not contain spaces.
|
||||||
<p><strong>Creating new code snippets for custom scripting configurations:</strong><br />
|
<p><strong>Creating new code snippets for custom scripting configurations:</strong><br />
|
||||||
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:</p>
|
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:</p>
|
||||||
<ol>
|
<ol>
|
||||||
|
|
|
@ -118,7 +118,7 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
this.nodebuildertest = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuildertest", MISSING_NODEBUILDER);
|
this.nodebuildertest = General.Settings.ReadSetting("configurations." + settingskey + ".nodebuildertest", MISSING_NODEBUILDER);
|
||||||
this.resources = new DataLocationList(General.Settings.Config, "configurations." + settingskey + ".resources");
|
this.resources = new DataLocationList(General.Settings.Config, "configurations." + settingskey + ".resources");
|
||||||
this.startmode = General.Settings.ReadSetting("configurations." + settingskey + ".startmode", "VerticesMode");
|
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
|
//mxd. read test engines
|
||||||
testEngines = new List<EngineInfo>();
|
testEngines = new List<EngineInfo>();
|
||||||
|
|
|
@ -66,6 +66,7 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
private bool scriptfontbold;
|
private bool scriptfontbold;
|
||||||
private bool scriptontop;
|
private bool scriptontop;
|
||||||
private bool scriptautoindent;
|
private bool scriptautoindent;
|
||||||
|
private bool snippetsallmanstyle; //mxd
|
||||||
private int scripttabwidth;
|
private int scripttabwidth;
|
||||||
private int previewimagesize;
|
private int previewimagesize;
|
||||||
private int autoscrollspeed;
|
private int autoscrollspeed;
|
||||||
|
@ -155,6 +156,7 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
public bool AnimateVisualSelection { get { return animatevisualselection; } internal set { animatevisualselection = value; } }
|
public bool AnimateVisualSelection { get { return animatevisualselection; } internal set { animatevisualselection = value; } }
|
||||||
public int ScriptTabWidth { get { return scripttabwidth; } internal set { scripttabwidth = value; } }
|
public int ScriptTabWidth { get { return scripttabwidth; } internal set { scripttabwidth = value; } }
|
||||||
public bool ScriptAutoIndent { get { return scriptautoindent; } internal set { scriptautoindent = 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 int PreviousVersion { get { return previousversion; } }
|
||||||
internal PasteOptions PasteOptions { get { return pasteoptions; } set { pasteoptions = value; } }
|
internal PasteOptions PasteOptions { get { return pasteoptions; } set { pasteoptions = value; } }
|
||||||
public int DockersPosition { get { return dockersposition; } internal set { dockersposition = value; } }
|
public int DockersPosition { get { return dockersposition; } internal set { dockersposition = value; } }
|
||||||
|
@ -254,6 +256,7 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
scriptfontsize = cfg.ReadSetting("scriptfontsize", 10);
|
scriptfontsize = cfg.ReadSetting("scriptfontsize", 10);
|
||||||
scriptfontbold = cfg.ReadSetting("scriptfontbold", false);
|
scriptfontbold = cfg.ReadSetting("scriptfontbold", false);
|
||||||
scriptautoindent = cfg.ReadSetting("scriptautoindent", true);
|
scriptautoindent = cfg.ReadSetting("scriptautoindent", true);
|
||||||
|
snippetsallmanstyle = cfg.ReadSetting("snippetsallmanstyle", false); //mxd
|
||||||
scriptontop = cfg.ReadSetting("scriptontop", true);
|
scriptontop = cfg.ReadSetting("scriptontop", true);
|
||||||
scripttabwidth = cfg.ReadSetting("scripttabwidth", 4);
|
scripttabwidth = cfg.ReadSetting("scripttabwidth", 4);
|
||||||
previewimagesize = cfg.ReadSetting("previewimagesize", 1);
|
previewimagesize = cfg.ReadSetting("previewimagesize", 1);
|
||||||
|
@ -344,6 +347,7 @@ namespace CodeImp.DoomBuilder.Config
|
||||||
cfg.WriteSetting("scriptontop", scriptontop);
|
cfg.WriteSetting("scriptontop", scriptontop);
|
||||||
cfg.WriteSetting("scripttabwidth", scripttabwidth);
|
cfg.WriteSetting("scripttabwidth", scripttabwidth);
|
||||||
cfg.WriteSetting("scriptautoindent", scriptautoindent);
|
cfg.WriteSetting("scriptautoindent", scriptautoindent);
|
||||||
|
cfg.WriteSetting("snippetsallmanstyle", snippetsallmanstyle); //mxd
|
||||||
cfg.WriteSetting("previewimagesize", previewimagesize);
|
cfg.WriteSetting("previewimagesize", previewimagesize);
|
||||||
cfg.WriteSetting("autoscrollspeed", autoscrollspeed);
|
cfg.WriteSetting("autoscrollspeed", autoscrollspeed);
|
||||||
cfg.WriteSetting("zoomfactor", zoomfactor);
|
cfg.WriteSetting("zoomfactor", zoomfactor);
|
||||||
|
|
|
@ -663,18 +663,18 @@ namespace CodeImp.DoomBuilder.Controls
|
||||||
string spaces = new String(' ', General.Settings.ScriptTabWidth);
|
string spaces = new String(' ', General.Settings.ScriptTabWidth);
|
||||||
int entrypos = -1;
|
int entrypos = -1;
|
||||||
int entryline = -1;
|
int entryline = -1;
|
||||||
string[] processedlines = new string[lines.Length];
|
string[] processedlines = processLineBreaks(lines);
|
||||||
|
|
||||||
for (int i = 0; i < lines.Length; i++) {
|
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) {
|
if (entrypos == -1) {
|
||||||
int pos = processedlines[i].IndexOf("$EP");
|
int pos = processedlines[i].IndexOf("[EP]");
|
||||||
if (pos != -1) {
|
if (pos != -1) {
|
||||||
entryline = curline + i;
|
entryline = curline + i;
|
||||||
entrypos = pos + numtabs;
|
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.SelectionEnd = scriptedit.WordEndPosition(scriptedit.CurrentPos, true);
|
||||||
scriptedit.ReplaceSel(text);
|
scriptedit.ReplaceSel(text);
|
||||||
|
|
||||||
//move the cursor if we had the $EP marker
|
//move the cursor if we had the [EP] marker
|
||||||
if (entrypos != -1) {
|
if (entrypos != -1) {
|
||||||
MoveToLine(entryline);
|
MoveToLine(entryline);
|
||||||
scriptedit.SelectionStart = scriptedit.PositionFromLine(entryline) + entrypos;
|
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<string> result = new List<string>(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
|
#endregion
|
||||||
|
|
||||||
#region ================== Events
|
#region ================== Events
|
||||||
|
|
|
@ -73,8 +73,6 @@ namespace CodeImp.DoomBuilder.Types
|
||||||
|
|
||||||
public override void SetValue(object value)
|
public override void SetValue(object value)
|
||||||
{
|
{
|
||||||
int result;
|
|
||||||
|
|
||||||
// Null?
|
// Null?
|
||||||
if(value == null)
|
if(value == null)
|
||||||
{
|
{
|
||||||
|
@ -89,6 +87,7 @@ namespace CodeImp.DoomBuilder.Types
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Try parsing as string
|
// Try parsing as string
|
||||||
|
int result;
|
||||||
if(int.TryParse(value.ToString(), NumberStyles.Integer, CultureInfo.CurrentCulture, out result))
|
if(int.TryParse(value.ToString(), NumberStyles.Integer, CultureInfo.CurrentCulture, out result))
|
||||||
{
|
{
|
||||||
this.value = result;
|
this.value = result;
|
||||||
|
|
|
@ -64,7 +64,7 @@ namespace CodeImp.DoomBuilder.Types
|
||||||
base.SetupField(attr, fieldinfo);
|
base.SetupField(attr, fieldinfo);
|
||||||
|
|
||||||
// Keep enum list reference
|
// Keep enum list reference
|
||||||
if(fieldinfo != null) list = fieldinfo.Enum; else list = new EnumList();
|
list = (fieldinfo != null ? fieldinfo.Enum : new EnumList());
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
@ -140,7 +140,8 @@ namespace CodeImp.DoomBuilder.Types
|
||||||
}
|
}
|
||||||
|
|
||||||
//mxd
|
//mxd
|
||||||
public override void SetDefaultValue() {
|
public override void SetDefaultValue()
|
||||||
|
{
|
||||||
value = defaultValue;
|
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
|
// This returns an enum list
|
||||||
|
|
|
@ -124,10 +124,8 @@ namespace CodeImp.DoomBuilder.Types
|
||||||
// How the value is actually validated and stored is up to the implementation
|
// How the value is actually validated and stored is up to the implementation
|
||||||
public abstract void SetValue(object value);
|
public abstract void SetValue(object value);
|
||||||
|
|
||||||
//mxd. this should replace current value with default one
|
//mxd. This should replace current value with the default one
|
||||||
public virtual void SetDefaultValue() {
|
public virtual void SetDefaultValue() { }
|
||||||
throw new NotSupportedException("Override this method to support default value for this type");
|
|
||||||
}
|
|
||||||
|
|
||||||
// This must return the value as one of the primitive data types
|
// This must return the value as one of the primitive data types
|
||||||
// supported by UDMF: int, string, float or bool
|
// 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)
|
// This must return the value as integer (for arguments)
|
||||||
public virtual int GetIntValue()
|
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
|
// This must return the value as a string for displaying
|
||||||
|
|
57
Source/Core/Windows/PreferencesForm.Designer.cs
generated
57
Source/Core/Windows/PreferencesForm.Designer.cs
generated
|
@ -38,6 +38,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
System.Windows.Forms.Label label18;
|
System.Windows.Forms.Label label18;
|
||||||
System.Windows.Forms.Label label20;
|
System.Windows.Forms.Label label20;
|
||||||
System.Windows.Forms.Label label21;
|
System.Windows.Forms.Label label21;
|
||||||
|
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(PreferencesForm));
|
||||||
this.recentFiles = new Dotnetrix.Controls.TrackBar();
|
this.recentFiles = new Dotnetrix.Controls.TrackBar();
|
||||||
this.labelRecentFiles = new System.Windows.Forms.Label();
|
this.labelRecentFiles = new System.Windows.Forms.Label();
|
||||||
this.label25 = 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.imagebrightnesslabel = new System.Windows.Forms.Label();
|
||||||
this.imagebrightness = new Dotnetrix.Controls.TrackBar();
|
this.imagebrightness = new Dotnetrix.Controls.TrackBar();
|
||||||
this.colorsgroup3 = new System.Windows.Forms.GroupBox();
|
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.scripttabwidth = new CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox();
|
||||||
this.scriptautoindent = new System.Windows.Forms.CheckBox();
|
this.scriptautoindent = new System.Windows.Forms.CheckBox();
|
||||||
this.label10 = new System.Windows.Forms.Label();
|
this.label10 = new System.Windows.Forms.Label();
|
||||||
|
this.fontpreview = new System.Windows.Forms.RichTextBox();
|
||||||
this.scriptfontsize = new System.Windows.Forms.ComboBox();
|
this.scriptfontsize = new System.Windows.Forms.ComboBox();
|
||||||
this.label8 = new System.Windows.Forms.Label();
|
this.label8 = new System.Windows.Forms.Label();
|
||||||
this.scriptfontbold = new System.Windows.Forms.CheckBox();
|
this.scriptfontbold = new System.Windows.Forms.CheckBox();
|
||||||
|
@ -478,6 +480,8 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
label18.TabIndex = 25;
|
label18.TabIndex = 25;
|
||||||
label18.Text = "Max. dynamic lights to render:";
|
label18.Text = "Max. dynamic lights to render:";
|
||||||
label18.TextAlign = System.Drawing.ContentAlignment.TopRight;
|
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
|
// 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)
|
this.colorsgroup3.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
|
||||||
| System.Windows.Forms.AnchorStyles.Right)));
|
| 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.scripttabwidth);
|
||||||
this.colorsgroup3.Controls.Add(this.scriptautoindent);
|
this.colorsgroup3.Controls.Add(this.scriptautoindent);
|
||||||
this.colorsgroup3.Controls.Add(this.label10);
|
this.colorsgroup3.Controls.Add(this.label10);
|
||||||
|
this.colorsgroup3.Controls.Add(this.fontpreview);
|
||||||
this.colorsgroup3.Controls.Add(this.scriptfontsize);
|
this.colorsgroup3.Controls.Add(this.scriptfontsize);
|
||||||
this.colorsgroup3.Controls.Add(this.label8);
|
this.colorsgroup3.Controls.Add(this.label8);
|
||||||
this.colorsgroup3.Controls.Add(this.scriptfontbold);
|
this.colorsgroup3.Controls.Add(this.scriptfontbold);
|
||||||
|
@ -1514,19 +1519,16 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
this.colorsgroup3.Text = " Script editor ";
|
this.colorsgroup3.Text = " Script editor ";
|
||||||
this.colorsgroup3.Visible = false;
|
this.colorsgroup3.Visible = false;
|
||||||
//
|
//
|
||||||
// fontpreview
|
// snippetsallmanstyle
|
||||||
//
|
//
|
||||||
this.fontpreview.Cursor = System.Windows.Forms.Cursors.Arrow;
|
this.snippetsallmanstyle.AutoSize = true;
|
||||||
this.fontpreview.DetectUrls = false;
|
this.snippetsallmanstyle.Location = new System.Drawing.Point(202, 187);
|
||||||
this.fontpreview.Location = new System.Drawing.Point(202, 73);
|
this.snippetsallmanstyle.Name = "snippetsallmanstyle";
|
||||||
this.fontpreview.Name = "fontpreview";
|
this.snippetsallmanstyle.Size = new System.Drawing.Size(179, 18);
|
||||||
this.fontpreview.ReadOnly = true;
|
this.snippetsallmanstyle.TabIndex = 34;
|
||||||
this.fontpreview.ScrollBars = System.Windows.Forms.RichTextBoxScrollBars.None;
|
this.snippetsallmanstyle.Text = "Allman-style bracing in snippets";
|
||||||
this.fontpreview.Size = new System.Drawing.Size(233, 100);
|
this.toolTip1.SetToolTip(this.snippetsallmanstyle, resources.GetString("snippetsallmanstyle.ToolTip"));
|
||||||
this.fontpreview.TabIndex = 33;
|
this.snippetsallmanstyle.UseVisualStyleBackColor = true;
|
||||||
this.fontpreview.Text = "1 #include \"zcommon.acs\"\n2 script 0 (void) { //a comment\n3 CONSTANT_VALUE;\n" +
|
|
||||||
"4 }";
|
|
||||||
this.fontpreview.WordWrap = false;
|
|
||||||
//
|
//
|
||||||
// scripttabwidth
|
// scripttabwidth
|
||||||
//
|
//
|
||||||
|
@ -1535,7 +1537,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
this.scripttabwidth.AllowRelative = false;
|
this.scripttabwidth.AllowRelative = false;
|
||||||
this.scripttabwidth.ButtonStep = 2;
|
this.scripttabwidth.ButtonStep = 2;
|
||||||
this.scripttabwidth.ButtonStepFloat = 1F;
|
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.Name = "scripttabwidth";
|
||||||
this.scripttabwidth.Size = new System.Drawing.Size(71, 24);
|
this.scripttabwidth.Size = new System.Drawing.Size(71, 24);
|
||||||
this.scripttabwidth.StepValues = null;
|
this.scripttabwidth.StepValues = null;
|
||||||
|
@ -1544,7 +1546,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
// scriptautoindent
|
// scriptautoindent
|
||||||
//
|
//
|
||||||
this.scriptautoindent.AutoSize = true;
|
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.Name = "scriptautoindent";
|
||||||
this.scriptautoindent.Size = new System.Drawing.Size(81, 18);
|
this.scriptautoindent.Size = new System.Drawing.Size(81, 18);
|
||||||
this.scriptautoindent.TabIndex = 31;
|
this.scriptautoindent.TabIndex = 31;
|
||||||
|
@ -1554,12 +1556,26 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
// label10
|
// label10
|
||||||
//
|
//
|
||||||
this.label10.AutoSize = true;
|
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.Name = "label10";
|
||||||
this.label10.Size = new System.Drawing.Size(57, 14);
|
this.label10.Size = new System.Drawing.Size(57, 14);
|
||||||
this.label10.TabIndex = 30;
|
this.label10.TabIndex = 30;
|
||||||
this.label10.Text = "Tab width:";
|
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
|
// scriptfontsize
|
||||||
//
|
//
|
||||||
this.scriptfontsize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
this.scriptfontsize.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
|
||||||
|
@ -1582,7 +1598,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
"36",
|
"36",
|
||||||
"48",
|
"48",
|
||||||
"72"});
|
"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.Name = "scriptfontsize";
|
||||||
this.scriptfontsize.Size = new System.Drawing.Size(94, 22);
|
this.scriptfontsize.Size = new System.Drawing.Size(94, 22);
|
||||||
this.scriptfontsize.TabIndex = 25;
|
this.scriptfontsize.TabIndex = 25;
|
||||||
|
@ -1591,7 +1607,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
// label8
|
// label8
|
||||||
//
|
//
|
||||||
this.label8.AutoSize = true;
|
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.Name = "label8";
|
||||||
this.label8.Size = new System.Drawing.Size(31, 14);
|
this.label8.Size = new System.Drawing.Size(31, 14);
|
||||||
this.label8.TabIndex = 28;
|
this.label8.TabIndex = 28;
|
||||||
|
@ -1600,7 +1616,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
// scriptfontbold
|
// scriptfontbold
|
||||||
//
|
//
|
||||||
this.scriptfontbold.AutoSize = true;
|
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.Name = "scriptfontbold";
|
||||||
this.scriptfontbold.Size = new System.Drawing.Size(47, 18);
|
this.scriptfontbold.Size = new System.Drawing.Size(47, 18);
|
||||||
this.scriptfontbold.TabIndex = 26;
|
this.scriptfontbold.TabIndex = 26;
|
||||||
|
@ -1941,5 +1957,6 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
private Dotnetrix.Controls.TrackBar recentFiles;
|
private Dotnetrix.Controls.TrackBar recentFiles;
|
||||||
private System.Windows.Forms.Label labelRecentFiles;
|
private System.Windows.Forms.Label labelRecentFiles;
|
||||||
private System.Windows.Forms.Label label25;
|
private System.Windows.Forms.Label label25;
|
||||||
|
private System.Windows.Forms.CheckBox snippetsallmanstyle;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -74,6 +74,7 @@ namespace CodeImp.DoomBuilder.Windows
|
||||||
scriptontop.Checked = General.Settings.ScriptOnTop;
|
scriptontop.Checked = General.Settings.ScriptOnTop;
|
||||||
scripttabwidth.Text = General.Settings.ScriptTabWidth.ToString();
|
scripttabwidth.Text = General.Settings.ScriptTabWidth.ToString();
|
||||||
scriptautoindent.Checked = General.Settings.ScriptAutoIndent;
|
scriptautoindent.Checked = General.Settings.ScriptAutoIndent;
|
||||||
|
snippetsallmanstyle.Checked = General.Settings.SnippetsAllmanStyle; //mxd
|
||||||
previewsize.Value = General.Clamp(General.Settings.PreviewImageSize, previewsize.Minimum, previewsize.Maximum);
|
previewsize.Value = General.Clamp(General.Settings.PreviewImageSize, previewsize.Minimum, previewsize.Maximum);
|
||||||
autoscrollspeed.Value = General.Clamp(General.Settings.AutoScrollSpeed, autoscrollspeed.Minimum, autoscrollspeed.Maximum);
|
autoscrollspeed.Value = General.Clamp(General.Settings.AutoScrollSpeed, autoscrollspeed.Minimum, autoscrollspeed.Maximum);
|
||||||
zoomfactor.Value = General.Clamp(General.Settings.ZoomFactor, zoomfactor.Minimum, zoomfactor.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.ScriptOnTop = scriptontop.Checked;
|
||||||
General.Settings.ScriptTabWidth = scripttabwidth.GetResult(General.Settings.ScriptTabWidth);
|
General.Settings.ScriptTabWidth = scripttabwidth.GetResult(General.Settings.ScriptTabWidth);
|
||||||
General.Settings.ScriptAutoIndent = scriptautoindent.Checked;
|
General.Settings.ScriptAutoIndent = scriptautoindent.Checked;
|
||||||
|
General.Settings.SnippetsAllmanStyle = snippetsallmanstyle.Checked; //mxd
|
||||||
General.Settings.PreviewImageSize = previewsize.Value;
|
General.Settings.PreviewImageSize = previewsize.Value;
|
||||||
General.Settings.AutoScrollSpeed = autoscrollspeed.Value;
|
General.Settings.AutoScrollSpeed = autoscrollspeed.Value;
|
||||||
General.Settings.ZoomFactor = zoomfactor.Value;
|
General.Settings.ZoomFactor = zoomfactor.Value;
|
||||||
|
|
|
@ -144,4 +144,14 @@
|
||||||
<metadata name="label21.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
<metadata name="label21.GenerateMember" type="System.Boolean, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||||
<value>False</value>
|
<value>False</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
<data name="snippetsallmanstyle.ToolTip" xml:space="preserve">
|
||||||
|
<value>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
|
||||||
|
</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
Loading…
Reference in a new issue