From 100c4ae976c82c2a84870a524540e6ebe0846ed4 Mon Sep 17 00:00:00 2001 From: MaxED Date: Mon, 10 Oct 2016 14:14:47 +0000 Subject: [PATCH] Added: some numeric text inputs now support expressions (e.g. (23+15)*1.5). - inspired by https://www.doomworld.com/vb/doom-editing/91089-gzdoombuilder-patch-expression-evaluation-for-sector-heights/ Fixed, Game Configurations window: fixed a crash when switching to a game engine without the file path using the "Engine" drop-down. --- Source/Core/Controls/ButtonsNumericTextbox.cs | 1 + Source/Core/Controls/NumericTextbox.cs | 335 ++++++++++-------- .../Controls/PairedFieldsControl.Designer.cs | 2 + .../Controls/PairedFloatControl.Designer.cs | 2 + .../Controls/PairedIntControl.Designer.cs | 2 + .../Controls/SectorSlopeControl.Designer.cs | 1 + Source/Core/Windows/ConfigForm.cs | 17 +- .../Core/Windows/SectorEditForm.Designer.cs | 3 + .../Windows/SectorEditFormUDMF.Designer.cs | 3 + Source/Core/Windows/ThingEditForm.Designer.cs | 4 + .../Windows/ThingEditFormUDMF.Designer.cs | 6 + .../Core/Windows/VertexEditForm.Designer.cs | 4 + 12 files changed, 227 insertions(+), 153 deletions(-) diff --git a/Source/Core/Controls/ButtonsNumericTextbox.cs b/Source/Core/Controls/ButtonsNumericTextbox.cs index 3c218ef7..fd05785d 100644 --- a/Source/Core/Controls/ButtonsNumericTextbox.cs +++ b/Source/Core/Controls/ButtonsNumericTextbox.cs @@ -54,6 +54,7 @@ namespace CodeImp.DoomBuilder.Controls public bool AllowDecimal { get { return textbox.AllowDecimal; } set { textbox.AllowDecimal = value; UpdateButtonsTooltip(); } } public bool AllowNegative { get { return textbox.AllowNegative; } set { textbox.AllowNegative = value; } } public bool AllowRelative { get { return textbox.AllowRelative; } set { textbox.AllowRelative = value; } } + public bool AllowExpressions { get { return textbox.AllowExpressions; } set { textbox.AllowExpressions = value; } } //mxd/mgr_inz_rafal public int ButtonStep { get { return stepsize; } set { stepsize = value; } } public float ButtonStepFloat { get { return stepsizeFloat; } set { stepsizeFloat = value; } } //mxd. This is used when AllowDecimal is true public float ButtonStepBig { get { return stepsizeBig; } set { stepsizeBig = value; } } //mxd diff --git a/Source/Core/Controls/NumericTextbox.cs b/Source/Core/Controls/NumericTextbox.cs index 35cbbce9..64f11035 100644 --- a/Source/Core/Controls/NumericTextbox.cs +++ b/Source/Core/Controls/NumericTextbox.cs @@ -18,6 +18,7 @@ using System; using System.ComponentModel; +using System.Data; using System.Drawing; using System.Globalization; using System.Windows.Forms; @@ -30,6 +31,8 @@ namespace CodeImp.DoomBuilder.Controls { #region ================== Constants + private const int ROUNDING_PRECISION = 4; //mxd + #endregion #region ================== Variables @@ -37,9 +40,13 @@ namespace CodeImp.DoomBuilder.Controls private bool allownegative; // Allow negative numbers private bool allowrelative; // Allow ++, --, * and / prefix for relative changes private bool allowdecimal; // Allow decimal (float) numbers + private bool allowexpressions; // mxd/mgr_inz_rafal. Allow expressions private bool controlpressed; private int incrementstep; //mxd. Step for +++ and --- prefixes private ToolTip tooltip; //mxd + + //mxd. Used to compute expressions + private static DataTable datatable = new DataTable(); #endregion @@ -48,6 +55,7 @@ namespace CodeImp.DoomBuilder.Controls public bool AllowNegative { get { return allownegative; } set { allownegative = value; } } public bool AllowRelative { get { return allowrelative; } set { allowrelative = value; UpdateTextboxStyle(); } } public bool AllowDecimal { get { return allowdecimal; } set { allowdecimal = value; } } + public bool AllowExpressions { get { return allowexpressions; } set { allowexpressions = value; } } //mxd/mgr_inz_rafal #endregion @@ -101,8 +109,13 @@ namespace CodeImp.DoomBuilder.Controls // Determine allowed chars if(allownegative) allowedchars += CultureInfo.CurrentCulture.NumberFormat.NegativeSign; if(allowrelative) allowedchars += "+-*/"; //mxd + if(allowexpressions) + { + allowedchars += "()"; //mxd/mgr_inz_rafal + if(!allowrelative) allowedchars += "+-*/"; //mxd + } if(controlpressed) allowedchars += "\u0018\u0003\u0016"; - if(allowdecimal || this.Text.StartsWith("*") || this.Text.StartsWith("/")) //mxd + if(allowdecimal || allowexpressions || this.Text.StartsWith("*") || this.Text.StartsWith("/")) //mxd allowedchars += CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator; // Check if key is not allowed @@ -111,7 +124,7 @@ namespace CodeImp.DoomBuilder.Controls // Cancel this e.Handled = true; } - else + else if(!allowexpressions) { //mxd. Check if * or / is pressed if(e.KeyChar == '*' || e.KeyChar == '/') @@ -180,6 +193,22 @@ namespace CodeImp.DoomBuilder.Controls base.OnKeyPress(e); } + //mxd + protected override void OnTextChanged(EventArgs e) + { + // Validate expression + if(allowexpressions) + { + // Check if expression is valid. We may want "++" and "--" on their own... + if(IsValidResult(StripPrefixes(this.Text)) || this.Text == "++" || this.Text == "--") + this.ForeColor = (allowrelative ? SystemColors.HotTrack : SystemColors.WindowText); + else + this.ForeColor = Color.DarkRed; + } + + base.OnTextChanged(e); + } + // Validate contents protected override void OnValidating(CancelEventArgs e) { @@ -190,29 +219,55 @@ namespace CodeImp.DoomBuilder.Controls base.OnValidating(e); return; } - - // Strip prefixes - string textpart = this.Text.Replace("+", "").Replace("*", "").Replace("/", ""); //mxd - if(!allownegative) textpart = textpart.Replace("-", ""); - - // No numbers left? - if(textpart.Length == 0) + + if(allowexpressions) //mxd { - // Make the textbox empty - this.Text = ""; - } + if(!IsValidResult(StripPrefixes(this.Text))) + { + // Make the textbox empty + this.Text = ""; + } + } + else + { + // Strip prefixes + string textpart = this.Text.Replace("+", "").Replace("*", "").Replace("/", ""); //mxd + if(!allownegative) + textpart = textpart.Replace("-", ""); + + // No numbers left? + if(textpart.Length == 0) + { + // Make the textbox empty + this.Text = ""; + } + } // Call base base.OnValidating(e); } + + //mxd + private string StripPrefixes(string input) + { + if(allowrelative) + { + // Strip prefixes + if(input.StartsWith("+++") || input.StartsWith("---")) return input.Substring(3); + if(input.StartsWith("++") || input.StartsWith("--")) return input.Substring(2); + if(input.StartsWith("*") || input.StartsWith("/")) return input.Substring(1); + } + + return input; + } // This checks if the number is relative public bool CheckIsRelative() { // Prefixed with +++, ---, ++, --, * or /? return ( (this.Text.Length > 3 && (this.Text.StartsWith("+++") || this.Text.StartsWith("---"))) || //mxd - (this.Text.Length > 2 && (this.Text.StartsWith("++") || this.Text.StartsWith("--") || this.Text.StartsWith("**") || this.Text.StartsWith("//"))) || //mxd - (this.Text.Length > 1 && (this.Text.StartsWith("*") || this.Text.StartsWith("/"))) ); //mxd + (this.Text.Length > 2 && (this.Text.StartsWith("++") || this.Text.StartsWith("--") )) || //mxd + (this.Text.Length > 1 && (this.Text.StartsWith("*") || this.Text.StartsWith("/"))) ); //mxd } //mxd. This determines the result value @@ -224,78 +279,7 @@ namespace CodeImp.DoomBuilder.Controls //mxd. This determines the result value public int GetResult(int original, int step) { - string textpart = this.Text; - - // Strip prefixes - textpart = textpart.TrimStart('+', '-', '*', '/'); //mxd - - // Any numbers left? - if(textpart.Length > 0) - { - int result; - - //mxd. Prefixed with +++? - if(this.Text.StartsWith("+++")) - { - // Add number to original - int.TryParse(textpart, out result); - return original + result * step; - } - //mxd. Prefixed with ---? - if(this.Text.StartsWith("---")) - { - // Subtract number from original - int.TryParse(textpart, out result); - int newvalue = original - result * step; - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; - } - // Prefixed with ++? - if(this.Text.StartsWith("++")) - { - // Add number to original - int.TryParse(textpart, out result); - return original + result; - } - // Prefixed with --? - if(this.Text.StartsWith("--")) - { - // Subtract number from original - int.TryParse(textpart, out result); - int newvalue = original - result; - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; - } - //mxd. Prefixed with *? - if(this.Text.StartsWith("*")) - { - // Multiply original by number - float resultf; - float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out resultf); - int newvalue = (int)Math.Round(original * resultf); - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; - } - //mxd. Prefixed with /? - if(this.Text.StartsWith("/")) - { - // Divide original by number - float resultf; - float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out resultf); - if(resultf == 0) return original; - int newvalue = (int)Math.Round(original / resultf); - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; - } - - //mxd. Return the new value - if(!int.TryParse(this.Text, out result)) return original; - if(!allownegative && (result < 0)) return 0; - return result; - } - - // Nothing given, keep original value - return original; + return (int)Math.Round(GetResultFloat(original, step)); } //mxd. This determines the result value @@ -308,68 +292,97 @@ namespace CodeImp.DoomBuilder.Controls public float GetResultFloat(float original, int step) { // Strip prefixes - string textpart = this.Text.Replace("+", "").Replace("-", "").Replace("*", "").Replace("/", ""); //mxd; + string textpart = StripPrefixes(this.Text); // Any numbers left? if(textpart.Length > 0) { float result; - - //mxd. Prefixed with +++? - if(this.Text.StartsWith("+++")) + if(allowrelative) { - // Add number to original - if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) result = 0; - return original + result * step; - } - //mxd. Prefixed with ---? - if(this.Text.StartsWith("---")) - { - // Subtract number from original - if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) result = 0; - float newvalue = original - result * step; - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; - } - // Prefixed with ++? - if(this.Text.StartsWith("++")) - { - // Add number to original - if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) result = 0; - return original + result; - } - // Prefixed with --? - if(this.Text.StartsWith("--")) - { - // Subtract number from original - if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) result = 0; - float newvalue = original - result; - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; - } - //mxd. Prefixed with *? - if(this.Text.StartsWith("*")) - { - // Multiply original by number - if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) result = 0; - float newvalue = original * result; - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; - } - //mxd. Prefixed with /? - if(this.Text.StartsWith("/")) - { - // Divide original by number - if(!float.TryParse(textpart, NumberStyles.Float, CultureInfo.CurrentCulture, out result) || result == 0) return original; - float newvalue = (float)Math.Round(original / result, 3); - if(!allownegative && (newvalue < 0)) newvalue = 0; - return newvalue; + //mxd. Prefixed with +++? + if(this.Text.StartsWith("+++")) + { + // Add number to original + if(TryGetResultValue(textpart, out result)) + return original + result * step; + + // Keep original value + return original; + } + + //mxd. Prefixed with ---? + if(this.Text.StartsWith("---")) + { + // Subtract number from original + if(TryGetResultValue(textpart, out result)) + { + float newvalue = original - result * step; + return (!allownegative && (newvalue < 0)) ? original : newvalue; + } + + // Keep original value + return original; + } + + // Prefixed with ++? + if(this.Text.StartsWith("++")) + { + // Add number to original + if(TryGetResultValue(textpart, out result)) + return original + result; + + // Keep original value + return original; + } + + // Prefixed with --? + if(this.Text.StartsWith("--")) + { + // Subtract number from original + if(TryGetResultValue(textpart, out result)) + { + float newvalue = original - result; + return (!allownegative && (newvalue < 0)) ? original : newvalue; + } + + // Keep original value + return original; + } + + //mxd. Prefixed with *? + if(this.Text.StartsWith("*")) + { + // Multiply original by number + if(TryGetResultValue(textpart, out result)) + { + float newvalue = (float)Math.Round(original * result, ROUNDING_PRECISION); + return (!allownegative && (newvalue < 0f)) ? original : newvalue; + } + + // Keep original value + return original; + } + + //mxd. Prefixed with /? + if(this.Text.StartsWith("/")) + { + // Divide original by number + if(TryGetResultValue(textpart, out result)) + { + if(result == 0.0f) return original; + float newvalue = (float)Math.Round(original / result, ROUNDING_PRECISION); + return (!allownegative && (newvalue < 0f)) ? original : newvalue; + } + + // Keep original value + return original; + } } //mxd. Return the new value - if(!float.TryParse(this.Text, NumberStyles.Float, CultureInfo.CurrentCulture, out result)) return original; - if(!allownegative && (result < 0)) return 0; - return result; + if(TryGetResultValue(textpart, out result)) + return (!allownegative && (result < 0f)) ? original : result; } // Nothing given, keep original value @@ -377,20 +390,50 @@ namespace CodeImp.DoomBuilder.Controls } //mxd - public void UpdateTextboxStyle() + private bool IsValidResult(string expression) { - UpdateTextboxStyle(string.Empty); + float unused; + return TryGetResultValue(expression, out unused); } //mxd - public void UpdateTextboxStyle(string tip) + private bool TryGetResultValue(string expression, out float value) + { + //Compute expression + if(allowexpressions) + { + try { expression = datatable.Compute(expression, null).ToString(); } + catch + { + value = 0f; + return false; + } + } + + // Parse result + return float.TryParse(expression, NumberStyles.Float, CultureInfo.InvariantCulture, out value); + } + + //mxd + public void UpdateTextboxStyle() { UpdateTextboxStyle(string.Empty); } + public void UpdateTextboxStyle(string tip) { this.ForeColor = (allowrelative ? SystemColors.HotTrack : SystemColors.WindowText); - if(allowrelative) + if(allowrelative || allowexpressions) { - tooltip.SetToolTip(this, "Use ++ or -- prefixes to change by given value." + Environment.NewLine + - "Use +++ or --- prefixes to incrementally change by given value." + Environment.NewLine + - "Use * or / prefixes to multiply or divide by given value." + Environment.NewLine + tip); + string s = string.Empty; + if(allowexpressions) + { + s += "You can use expressions. Example: (128+64)*2.5" + Environment.NewLine; + } + if(allowrelative) + { + s += "Use ++ or -- prefixes to change by given value." + Environment.NewLine + + "Use +++ or --- prefixes to incrementally change by given value." + Environment.NewLine + + "Use * or / prefixes to multiply or divide by given value." + Environment.NewLine; + } + + tooltip.SetToolTip(this, s + tip); } else if(!string.IsNullOrEmpty(tip)) { diff --git a/Source/Core/Controls/PairedFieldsControl.Designer.cs b/Source/Core/Controls/PairedFieldsControl.Designer.cs index aac40193..467e23bc 100644 --- a/Source/Core/Controls/PairedFieldsControl.Designer.cs +++ b/Source/Core/Controls/PairedFieldsControl.Designer.cs @@ -60,6 +60,7 @@ this.value1.AllowDecimal = false; this.value1.AllowNegative = true; this.value1.AllowRelative = true; + this.value1.AllowExpressions = true; this.value1.ButtonStep = 1; this.value1.ButtonStepFloat = 1F; this.value1.ButtonStepsWrapAround = false; @@ -76,6 +77,7 @@ this.value2.AllowDecimal = false; this.value2.AllowNegative = true; this.value2.AllowRelative = true; + this.value2.AllowExpressions = true; this.value2.ButtonStep = 1; this.value2.ButtonStepFloat = 1F; this.value2.ButtonStepsWrapAround = false; diff --git a/Source/Core/Controls/PairedFloatControl.Designer.cs b/Source/Core/Controls/PairedFloatControl.Designer.cs index 5d1a8432..88f04dfc 100644 --- a/Source/Core/Controls/PairedFloatControl.Designer.cs +++ b/Source/Core/Controls/PairedFloatControl.Designer.cs @@ -39,6 +39,7 @@ this.value1.AllowDecimal = true; this.value1.AllowNegative = true; this.value1.AllowRelative = true; + this.value1.AllowExpressions = true; this.value1.ButtonStep = 1; this.value1.ButtonStepFloat = 1F; this.value1.ButtonStepsWrapAround = false; @@ -56,6 +57,7 @@ this.value2.AllowDecimal = true; this.value2.AllowNegative = true; this.value2.AllowRelative = true; + this.value2.AllowExpressions = true; this.value2.ButtonStep = 1; this.value2.ButtonStepFloat = 1F; this.value2.ButtonStepsWrapAround = false; diff --git a/Source/Core/Controls/PairedIntControl.Designer.cs b/Source/Core/Controls/PairedIntControl.Designer.cs index 9b454e65..7ab219d0 100644 --- a/Source/Core/Controls/PairedIntControl.Designer.cs +++ b/Source/Core/Controls/PairedIntControl.Designer.cs @@ -49,6 +49,7 @@ this.value1.AllowDecimal = false; this.value1.AllowNegative = true; this.value1.AllowRelative = true; + this.value1.AllowExpressions = true; this.value1.ButtonStep = 1; this.value1.ButtonStepFloat = 1F; this.value1.ButtonStepsWrapAround = false; @@ -65,6 +66,7 @@ this.value2.AllowDecimal = false; this.value2.AllowNegative = true; this.value2.AllowRelative = true; + this.value2.AllowExpressions = true; this.value2.ButtonStep = 1; this.value2.ButtonStepFloat = 1F; this.value2.ButtonStepsWrapAround = false; diff --git a/Source/Core/Controls/SectorSlopeControl.Designer.cs b/Source/Core/Controls/SectorSlopeControl.Designer.cs index 3a2f3e23..85b8a521 100644 --- a/Source/Core/Controls/SectorSlopeControl.Designer.cs +++ b/Source/Core/Controls/SectorSlopeControl.Designer.cs @@ -166,6 +166,7 @@ this.slopeoffset.AllowDecimal = true; this.slopeoffset.AllowNegative = true; this.slopeoffset.AllowRelative = true; + this.slopeoffset.AllowExpressions = true; this.slopeoffset.ButtonStep = 1; this.slopeoffset.ButtonStepBig = 16F; this.slopeoffset.ButtonStepFloat = 8F; diff --git a/Source/Core/Windows/ConfigForm.cs b/Source/Core/Windows/ConfigForm.cs index 4563d8f4..f4099c21 100644 --- a/Source/Core/Windows/ConfigForm.cs +++ b/Source/Core/Windows/ConfigForm.cs @@ -303,7 +303,7 @@ namespace CodeImp.DoomBuilder.Windows configinfo.TestProgram = testapplication.Text; //mxd. User entered engine name before picking the engine? - if(cbEngineSelector.SelectedIndex == -1) + if(cbEngineSelector.SelectedIndex == -1 || string.IsNullOrEmpty(configinfo.TestProgram)) { ApplyTestEngineNameChange(); } @@ -710,27 +710,26 @@ namespace CodeImp.DoomBuilder.Windows { preventchanges = true; + // Remove EngineInfos without program path + configinfo.TestEngines.RemoveAll(info => string.IsNullOrEmpty(info.TestProgram)); + // Add new EngineInfo EngineInfo newInfo = new EngineInfo(); newInfo.TestSkill = (int)Math.Ceiling(gameconfig.Skills.Count / 2f); // Set Medium skill level configinfo.TestEngines.Add(newInfo); configinfo.Changed = true; - // Store current engine name - if(!String.IsNullOrEmpty(cbEngineSelector.Text)) - configinfo.TestProgramName = cbEngineSelector.Text; - // Refresh engines list cbEngineSelector.Items.Clear(); foreach(EngineInfo info in configinfo.TestEngines) cbEngineSelector.Items.Add(info.TestProgramName); cbEngineSelector.SelectedIndex = configinfo.TestEngines.Count - 1; - btnRemoveEngine.Enabled = true; + btnRemoveEngine.Enabled = (configinfo.TestEngines.Count > 1); preventchanges = false; - // Set engine path + // Set engine path (will also update current engine name) testapplication.Text = testprogramdialog.FileName; } } @@ -766,6 +765,8 @@ namespace CodeImp.DoomBuilder.Windows private void cbEngineSelector_SelectedIndexChanged(object sender, EventArgs e) { if(cbEngineSelector.SelectedIndex == -1) return; + + preventchanges = true; //set new values configinfo.CurrentEngineIndex = cbEngineSelector.SelectedIndex; @@ -788,6 +789,8 @@ namespace CodeImp.DoomBuilder.Windows skill.Value = skilllevel - 1; //mxd. WHY??? skill.Value = skilllevel; customparameters.Checked = configinfo.CustomParameters; + + preventchanges = false; } //mxd diff --git a/Source/Core/Windows/SectorEditForm.Designer.cs b/Source/Core/Windows/SectorEditForm.Designer.cs index 9a007a9a..7f3c7d73 100644 --- a/Source/Core/Windows/SectorEditForm.Designer.cs +++ b/Source/Core/Windows/SectorEditForm.Designer.cs @@ -214,6 +214,7 @@ namespace CodeImp.DoomBuilder.Windows this.heightoffset.AllowDecimal = false; this.heightoffset.AllowNegative = true; this.heightoffset.AllowRelative = true; + this.heightoffset.AllowExpressions = true; this.heightoffset.ButtonStep = 8; this.heightoffset.ButtonStepBig = 16F; this.heightoffset.ButtonStepFloat = 1F; @@ -250,6 +251,7 @@ namespace CodeImp.DoomBuilder.Windows this.ceilingheight.AllowDecimal = false; this.ceilingheight.AllowNegative = true; this.ceilingheight.AllowRelative = true; + this.ceilingheight.AllowExpressions = true; this.ceilingheight.ButtonStep = 8; this.ceilingheight.ButtonStepBig = 16F; this.ceilingheight.ButtonStepFloat = 1F; @@ -317,6 +319,7 @@ namespace CodeImp.DoomBuilder.Windows this.floorheight.AllowDecimal = false; this.floorheight.AllowNegative = true; this.floorheight.AllowRelative = true; + this.floorheight.AllowExpressions = true; this.floorheight.ButtonStep = 8; this.floorheight.ButtonStepBig = 16F; this.floorheight.ButtonStepFloat = 1F; diff --git a/Source/Core/Windows/SectorEditFormUDMF.Designer.cs b/Source/Core/Windows/SectorEditFormUDMF.Designer.cs index 293e1594..8786a591 100644 --- a/Source/Core/Windows/SectorEditFormUDMF.Designer.cs +++ b/Source/Core/Windows/SectorEditFormUDMF.Designer.cs @@ -419,6 +419,7 @@ this.heightoffset.AllowDecimal = false; this.heightoffset.AllowNegative = true; this.heightoffset.AllowRelative = true; + this.heightoffset.AllowExpressions = true; this.heightoffset.ButtonStep = 8; this.heightoffset.ButtonStepBig = 16F; this.heightoffset.ButtonStepFloat = 1F; @@ -437,6 +438,7 @@ this.ceilingheight.AllowDecimal = false; this.ceilingheight.AllowNegative = true; this.ceilingheight.AllowRelative = true; + this.ceilingheight.AllowExpressions = true; this.ceilingheight.ButtonStep = 8; this.ceilingheight.ButtonStepBig = 16F; this.ceilingheight.ButtonStepFloat = 1F; @@ -473,6 +475,7 @@ this.floorheight.AllowDecimal = false; this.floorheight.AllowNegative = true; this.floorheight.AllowRelative = true; + this.floorheight.AllowExpressions = true; this.floorheight.ButtonStep = 8; this.floorheight.ButtonStepBig = 16F; this.floorheight.ButtonStepFloat = 1F; diff --git a/Source/Core/Windows/ThingEditForm.Designer.cs b/Source/Core/Windows/ThingEditForm.Designer.cs index 6d6e7cbc..73feb71d 100644 --- a/Source/Core/Windows/ThingEditForm.Designer.cs +++ b/Source/Core/Windows/ThingEditForm.Designer.cs @@ -125,6 +125,7 @@ namespace CodeImp.DoomBuilder.Windows this.posX.AllowDecimal = false; this.posX.AllowNegative = true; this.posX.AllowRelative = true; + this.posX.AllowExpressions = true; this.posX.ButtonStep = 8; this.posX.ButtonStepBig = 16F; this.posX.ButtonStepFloat = 1F; @@ -143,6 +144,7 @@ namespace CodeImp.DoomBuilder.Windows this.posY.AllowDecimal = false; this.posY.AllowNegative = true; this.posY.AllowRelative = true; + this.posY.AllowExpressions = true; this.posY.ButtonStep = 8; this.posY.ButtonStepBig = 16F; this.posY.ButtonStepFloat = 1F; @@ -161,6 +163,7 @@ namespace CodeImp.DoomBuilder.Windows this.posZ.AllowDecimal = false; this.posZ.AllowNegative = true; this.posZ.AllowRelative = true; + this.posZ.AllowExpressions = true; this.posZ.ButtonStep = 8; this.posZ.ButtonStepBig = 16F; this.posZ.ButtonStepFloat = 1F; @@ -242,6 +245,7 @@ namespace CodeImp.DoomBuilder.Windows this.angle.AllowDecimal = false; this.angle.AllowNegative = true; this.angle.AllowRelative = true; + this.posX.AllowExpressions = true; this.angle.ButtonStep = 5; this.angle.ButtonStepBig = 15F; this.angle.ButtonStepFloat = 1F; diff --git a/Source/Core/Windows/ThingEditFormUDMF.Designer.cs b/Source/Core/Windows/ThingEditFormUDMF.Designer.cs index a6ef760a..06a14c88 100644 --- a/Source/Core/Windows/ThingEditFormUDMF.Designer.cs +++ b/Source/Core/Windows/ThingEditFormUDMF.Designer.cs @@ -195,6 +195,7 @@ this.roll.AllowDecimal = false; this.roll.AllowNegative = true; this.roll.AllowRelative = true; + this.roll.AllowExpressions = true; this.roll.ButtonStep = 5; this.roll.ButtonStepBig = 15F; this.roll.ButtonStepFloat = 1F; @@ -222,6 +223,7 @@ this.pitch.AllowDecimal = false; this.pitch.AllowNegative = true; this.pitch.AllowRelative = true; + this.pitch.AllowExpressions = true; this.pitch.ButtonStep = 5; this.pitch.ButtonStepBig = 15F; this.pitch.ButtonStepFloat = 1F; @@ -249,6 +251,7 @@ this.angle.AllowDecimal = false; this.angle.AllowNegative = true; this.angle.AllowRelative = true; + this.angle.AllowExpressions = true; this.angle.ButtonStep = 5; this.angle.ButtonStepBig = 15F; this.angle.ButtonStepFloat = 1F; @@ -478,6 +481,7 @@ this.posX.AllowDecimal = true; this.posX.AllowNegative = true; this.posX.AllowRelative = true; + this.posX.AllowExpressions = true; this.posX.ButtonStep = 8; this.posX.ButtonStepBig = 8F; this.posX.ButtonStepFloat = 1F; @@ -496,6 +500,7 @@ this.posY.AllowDecimal = true; this.posY.AllowNegative = true; this.posY.AllowRelative = true; + this.posY.AllowExpressions = true; this.posY.ButtonStep = 8; this.posY.ButtonStepBig = 8F; this.posY.ButtonStepFloat = 1F; @@ -514,6 +519,7 @@ this.posZ.AllowDecimal = true; this.posZ.AllowNegative = true; this.posZ.AllowRelative = true; + this.posZ.AllowExpressions = true; this.posZ.ButtonStep = 8; this.posZ.ButtonStepBig = 8F; this.posZ.ButtonStepFloat = 1F; diff --git a/Source/Core/Windows/VertexEditForm.Designer.cs b/Source/Core/Windows/VertexEditForm.Designer.cs index 85f0f7ca..0640b99f 100644 --- a/Source/Core/Windows/VertexEditForm.Designer.cs +++ b/Source/Core/Windows/VertexEditForm.Designer.cs @@ -125,6 +125,7 @@ namespace CodeImp.DoomBuilder.Windows this.zceiling.AllowDecimal = false; this.zceiling.AllowNegative = true; this.zceiling.AllowRelative = true; + this.zceiling.AllowExpressions = true; this.zceiling.ButtonStep = 8; this.zceiling.ButtonStepBig = 16F; this.zceiling.ButtonStepFloat = 1F; @@ -143,6 +144,7 @@ namespace CodeImp.DoomBuilder.Windows this.zfloor.AllowDecimal = false; this.zfloor.AllowNegative = true; this.zfloor.AllowRelative = true; + this.zfloor.AllowExpressions = true; this.zfloor.ButtonStep = 8; this.zfloor.ButtonStepBig = 16F; this.zfloor.ButtonStepFloat = 1F; @@ -179,6 +181,7 @@ namespace CodeImp.DoomBuilder.Windows this.positiony.AllowDecimal = false; this.positiony.AllowNegative = true; this.positiony.AllowRelative = true; + this.positiony.AllowExpressions = true; this.positiony.ButtonStep = 1; this.positiony.ButtonStepBig = 8F; this.positiony.ButtonStepFloat = 1F; @@ -197,6 +200,7 @@ namespace CodeImp.DoomBuilder.Windows this.positionx.AllowDecimal = false; this.positionx.AllowNegative = true; this.positionx.AllowRelative = true; + this.positionx.AllowExpressions = true; this.positionx.ButtonStep = 1; this.positionx.ButtonStepBig = 8F; this.positionx.ButtonStepFloat = 1F;