Changed, Thing and Linedef Edit Forms, script selector drop-downs: scripts from include files are now shown using different color and after the map scripts.

Fixed, Visual mode, UDMF: sector geometry cache was not updated after using "Match Brightness" and "Change Brightness" actions on ceilings, so the changes made by them were not visible when using Classic modes in "View Ceiling Textures" mode.
Fixed, Visual mode, UDMF: "Match Brightness" and "Change Brightness" actions set brightness incorrectly in some cases.
Fixed: ACS script names gathering logic was unable to process relative #include and #import paths (like '#import "..\acs\qtilt.acs"').
Updated ZDoom_DECORATE.cfg.
This commit is contained in:
MaxED 2015-02-24 13:38:35 +00:00
parent 386b74d2ba
commit c07df8f596
19 changed files with 132 additions and 73 deletions

View file

@ -520,6 +520,7 @@ constants
Weapon.BobSpeed;
Weapon.BobStyle;
Weapon.KickBack;
Weapon.DefaultKickBack;
Weapon.ReadySound;
Weapon.SelectionOrder;
Weapon.SisterWeapon;

View file

@ -691,6 +691,9 @@
<DependentUpon>ActionSpecialHelpButton.cs</DependentUpon>
</Compile>
<Compile Include="Controls\ButtonsNumericTextboxDesigner.cs" />
<Compile Include="Controls\ColoredComboBox.cs">
<SubType>Component</SubType>
</Compile>
<Compile Include="Controls\DebugConsole.cs">
<SubType>UserControl</SubType>
</Compile>

View file

@ -0,0 +1,54 @@
using System.Windows.Forms;
using System.Drawing;
namespace CodeImp.DoomBuilder.Controls
{
public class ColoredComboBox : ComboBox
{
public ColoredComboBox()
{
this.DrawMode = DrawMode.OwnerDrawFixed;
}
protected override void OnDrawItem(DrawItemEventArgs e)
{
base.OnDrawItem(e);
e.DrawBackground();
ColoredComboBoxItem item = (ColoredComboBoxItem)this.Items[e.Index];
Brush brush = new SolidBrush(item.ForeColor);
if ((e.State & DrawItemState.Selected) == DrawItemState.Selected) brush = Brushes.White;
e.Graphics.DrawString(item.Text, this.Font, brush, e.Bounds.X, e.Bounds.Y);
}
}
public class ColoredComboBoxItem
{
private string text = "";
private object value;
Color forecolor = Color.Black;
public string Text { get { return text; } set { text = value; } }
public object Value { get { return value; } set { this.value = value; } }
public Color ForeColor { get { return forecolor; } set { forecolor = value; } }
public ColoredComboBoxItem() { }
public ColoredComboBoxItem(object value)
{
this.text = value.ToString();
this.value = value;
}
public ColoredComboBoxItem(object value, Color forecolor)
{
this.text = value.ToString();
this.value = value;
this.forecolor = forecolor;
}
public override string ToString()
{
return text;
}
}
}

View file

@ -1798,6 +1798,9 @@ namespace CodeImp.DoomBuilder.Data
//mxd
internal MemoryStream LoadFile(string name)
{
//relative path?
if(name.StartsWith("..\\")) name = name.Replace("..\\", "");
foreach (DataReader dr in containers)
if (dr.FileExists(name)) return dr.LoadFile(name);
return null;

View file

@ -6,17 +6,20 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
{
private readonly string name;
private readonly int index;
private readonly int cursorPosition;
private readonly int cursorposition;
private readonly bool isinclude;
internal string Name { get { return name; } }
internal int Index { get { return index; } }
internal int CursorPosition { get { return cursorPosition; } }
internal int CursorPosition { get { return cursorposition; } }
internal bool IsInclude { get { return isinclude; } }
internal ScriptItem(int index, string name, int cursorPosition)
internal ScriptItem(int index, string name, int cursorPosition, bool isinclude)
{
this.name = name;
this.index = index;
this.cursorPosition = cursorPosition;
this.cursorposition = cursorPosition;
this.isinclude = isinclude;
}
internal ScriptItem(int index, string name)
@ -27,13 +30,18 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
internal static int SortByIndex(ScriptItem i1, ScriptItem i2)
{
if (i1.isinclude && !i2.isinclude) return 1;
if (!i1.isinclude && i2.isinclude) return -1;
if (i1.Index > i2.Index) return 1;
if (i1.Index == i2.Index) return 0;
return -1;
}
internal static int SortByName(ScriptItem i1, ScriptItem i2)
internal static int SortByName(ScriptItem i1, ScriptItem i2)
{
if (i1.isinclude && !i2.isinclude) return 1;
if (!i1.isinclude && i2.isinclude) return -1;
if (i1.Name == i2.Name) return 0;
if (i1.Name.ToUpper()[0] > i2.Name.ToUpper()[0]) return 1;
if (i1.Name.ToUpper()[0] == i2.Name.ToUpper()[0])

View file

@ -80,7 +80,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
token = token.Substring(0, token.LastIndexOf('"'));
token = StripTokenQuotes(token);
ScriptItem i = new ScriptItem(0, token, startPos);
ScriptItem i = new ScriptItem(0, token, startPos, isinclude);
namedScripts.Add(i);
}
else //should be numbered script
@ -112,7 +112,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
}
name = (name.Length > 0 ? name + " [" + n + "]" : "Script " + n);
ScriptItem i = new ScriptItem(n, name, startPos);
ScriptItem i = new ScriptItem(n, name, startPos, isinclude);
numberedScripts.Add(i);
}
}
@ -147,7 +147,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
} while(!token.Contains(")"));
}
ScriptItem i = new ScriptItem(0, funcname, startPos);
ScriptItem i = new ScriptItem(0, funcname, startPos, isinclude);
functions.Add(i);
}
else if (processIncludes && (token == "#include" || token == "#import"))

View file

@ -44,7 +44,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
string name = "";
foreach (string s in definition) name += s + " ";
actors.Add(new ScriptItem(0, name.TrimEnd(), startPos));
actors.Add(new ScriptItem(0, name.TrimEnd(), startPos, false));
}
}
}

View file

@ -43,7 +43,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.GZDoom
if (token == "{")
{
ScriptItem i = new ScriptItem(0, modelName, startPos);
ScriptItem i = new ScriptItem(0, modelName, startPos, false);
models.Add(i);
}
}

View file

@ -2255,7 +2255,7 @@ namespace CodeImp.DoomBuilder.Geometry
temp = TextRenderer.MeasureText(obj.ToString(), cb.Font).Width;
if(temp > maxWidth) maxWidth = temp;
}
return maxWidth > 0 ? maxWidth : 1;
return maxWidth > 0 ? maxWidth + 6 : 1;
}
//mxd

View file

@ -46,7 +46,7 @@ namespace CodeImp.DoomBuilder.Windows
this.actiongroup = new System.Windows.Forms.GroupBox();
this.actionhelp = new CodeImp.DoomBuilder.Controls.ActionSpecialHelpButton();
this.argspanel = new System.Windows.Forms.Panel();
this.scriptNumbers = new System.Windows.Forms.ComboBox();
this.scriptNumbers = new CodeImp.DoomBuilder.Controls.ColoredComboBox();
this.arg2 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.arg1 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.arg0 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
@ -738,7 +738,7 @@ namespace CodeImp.DoomBuilder.Windows
private CodeImp.DoomBuilder.GZBuilder.Controls.TagSelector tagSelector;
private CodeImp.DoomBuilder.GZBuilder.Controls.PairedIntControl frontTextureOffset;
private CodeImp.DoomBuilder.GZBuilder.Controls.PairedIntControl backTextureOffset;
private System.Windows.Forms.ComboBox scriptNumbers;
private CodeImp.DoomBuilder.Controls.ColoredComboBox scriptNumbers;
private System.Windows.Forms.Panel panel;
private CodeImp.DoomBuilder.Controls.ActionSpecialHelpButton actionhelp;
private System.Windows.Forms.ToolTip tooltip;

View file

@ -20,6 +20,7 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.Geometry;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Config;
@ -128,7 +129,7 @@ namespace CodeImp.DoomBuilder.Windows
scriptNumbers.Location = new Point(arg0.Location.X, arg0.Location.Y + 2);
foreach(ScriptItem si in General.Map.NumberedScripts)
scriptNumbers.Items.Add(si);
scriptNumbers.Items.Add(new ColoredComboBoxItem(si, si.IsInclude ? SystemColors.HotTrack : SystemColors.WindowText));
scriptNumbers.DropDownWidth = Tools.GetDropDownWidth(scriptNumbers);
@ -390,16 +391,11 @@ namespace CodeImp.DoomBuilder.Windows
break;
}
}
}
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Items.Add(new ScriptItem(a0, "Script " + a0));
scriptNumbers.SelectedIndex = scriptNumbers.Items.Count - 1;
}
}
else
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Text = arg0.Text;
scriptNumbers.Text = a0.ToString();
}
}
else
@ -478,7 +474,7 @@ namespace CodeImp.DoomBuilder.Windows
if(!string.IsNullOrEmpty(scriptNumbers.Text))
{
if(scriptNumbers.SelectedItem != null)
l.Args[0] = ((ScriptItem)scriptNumbers.SelectedItem).Index;
l.Args[0] = ((ScriptItem)((ColoredComboBoxItem)scriptNumbers.SelectedItem).Value).Index;
else if(!int.TryParse(scriptNumbers.Text.Trim(), out l.Args[0]))
l.Args[0] = 0;
}

View file

@ -42,8 +42,8 @@ namespace CodeImp.DoomBuilder.Windows
this.actiongroup = new System.Windows.Forms.GroupBox();
this.actionhelp = new CodeImp.DoomBuilder.Controls.ActionSpecialHelpButton();
this.argspanel = new System.Windows.Forms.Panel();
this.scriptNumbers = new System.Windows.Forms.ComboBox();
this.scriptNames = new System.Windows.Forms.ComboBox();
this.scriptNumbers = new CodeImp.DoomBuilder.Controls.ColoredComboBox();
this.scriptNames = new CodeImp.DoomBuilder.Controls.ColoredComboBox();
this.arg2 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.arg1 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.arg0 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
@ -1503,7 +1503,7 @@ namespace CodeImp.DoomBuilder.Windows
private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox frontsector;
private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox backsector;
private System.Windows.Forms.CheckBox cbArgStr;
private System.Windows.Forms.ComboBox scriptNames;
private CodeImp.DoomBuilder.Controls.ColoredComboBox scriptNames;
private CodeImp.DoomBuilder.GZBuilder.Controls.TagSelector tagSelector;
private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox lightFront;
private System.Windows.Forms.CheckBox cbLightAbsoluteFront;
@ -1530,7 +1530,7 @@ namespace CodeImp.DoomBuilder.Windows
private CodeImp.DoomBuilder.GZBuilder.Controls.PairedIntControl backTextureOffset;
private CodeImp.DoomBuilder.Controls.CheckboxArrayControl flagsFront;
private CodeImp.DoomBuilder.Controls.CheckboxArrayControl flagsBack;
private System.Windows.Forms.ComboBox scriptNumbers;
private CodeImp.DoomBuilder.Controls.ColoredComboBox scriptNumbers;
private System.Windows.Forms.GroupBox activationGroup;
private System.Windows.Forms.PictureBox missingactivation;
private System.Windows.Forms.ToolTip tooltip;

View file

@ -26,7 +26,8 @@ using CodeImp.DoomBuilder.Config;
using CodeImp.DoomBuilder.GZBuilder.Data; //mxd
using CodeImp.DoomBuilder.Types;
using CodeImp.DoomBuilder.GZBuilder.Tools;
using CodeImp.DoomBuilder.GZBuilder.Controls; //mxd
using CodeImp.DoomBuilder.GZBuilder.Controls;
using CodeImp.DoomBuilder.Controls;
#endregion
@ -217,12 +218,14 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. Setup script numbers
scriptNumbers.Location = new Point(arg0.Location.X, arg0.Location.Y + 2);
foreach(ScriptItem si in General.Map.NumberedScripts) scriptNumbers.Items.Add(si);
foreach (ScriptItem si in General.Map.NumberedScripts)
scriptNumbers.Items.Add(new ColoredComboBoxItem(si, si.IsInclude ? SystemColors.HotTrack : SystemColors.WindowText));
scriptNumbers.DropDownWidth = Tools.GetDropDownWidth(scriptNumbers);
//mxd. Setup script names
scriptNames.Location = scriptNumbers.Location;
foreach(ScriptItem nsi in General.Map.NamedScripts) scriptNames.Items.Add(nsi);
foreach (ScriptItem nsi in General.Map.NamedScripts)
scriptNames.Items.Add(new ColoredComboBoxItem(nsi, nsi.IsInclude ? SystemColors.HotTrack : SystemColors.WindowText));
scriptNames.DropDownWidth = Tools.GetDropDownWidth(scriptNames);
// Initialize custom fields editor
@ -636,16 +639,11 @@ namespace CodeImp.DoomBuilder.Windows
break;
}
}
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Items.Add(new ScriptItem(a0, "Script " + a0));
scriptNumbers.SelectedIndex = scriptNumbers.Items.Count - 1;
}
}
else
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Text = arg0.Text;
scriptNumbers.Text = a0.ToString();
}
}
}
@ -799,7 +797,7 @@ namespace CodeImp.DoomBuilder.Windows
if(!string.IsNullOrEmpty(scriptNumbers.Text))
{
if(scriptNumbers.SelectedItem != null)
l.Args[0] = ((ScriptItem)scriptNumbers.SelectedItem).Index;
l.Args[0] = ((ScriptItem)((ColoredComboBoxItem)scriptNumbers.SelectedItem).Value).Index;
else if(!int.TryParse(scriptNumbers.Text.Trim(), out l.Args[0]))
l.Args[0] = 0;

View file

@ -53,7 +53,7 @@ namespace CodeImp.DoomBuilder.Windows
this.actiongroup = new System.Windows.Forms.GroupBox();
this.actionhelp = new CodeImp.DoomBuilder.Controls.ActionSpecialHelpButton();
this.hexenpanel = new System.Windows.Forms.Panel();
this.scriptNumbers = new System.Windows.Forms.ComboBox();
this.scriptNumbers = new CodeImp.DoomBuilder.Controls.ColoredComboBox();
this.arg2 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.arg1 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.arg0 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
@ -672,7 +672,7 @@ namespace CodeImp.DoomBuilder.Windows
private System.Windows.Forms.CheckBox cbAbsoluteHeight;
private System.Windows.Forms.CheckBox cbRandomAngle;
private CodeImp.DoomBuilder.GZBuilder.Controls.TagSelector tagSelector;
private System.Windows.Forms.ComboBox scriptNumbers;
private CodeImp.DoomBuilder.Controls.ColoredComboBox scriptNumbers;
private CodeImp.DoomBuilder.GZBuilder.Controls.AngleControl anglecontrol;
private System.Windows.Forms.PictureBox hint;
private System.Windows.Forms.Label hintlabel;

View file

@ -20,6 +20,7 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Config;
@ -117,7 +118,7 @@ namespace CodeImp.DoomBuilder.Windows
scriptNumbers.Location = new Point(arg0.Location.X, arg0.Location.Y + 2);
foreach(ScriptItem si in General.Map.NumberedScripts)
scriptNumbers.Items.Add(si);
scriptNumbers.Items.Add(new ColoredComboBoxItem(si, si.IsInclude ? SystemColors.HotTrack : SystemColors.WindowText));
scriptNumbers.DropDownWidth = Tools.GetDropDownWidth(scriptNumbers);
}
@ -274,16 +275,11 @@ namespace CodeImp.DoomBuilder.Windows
break;
}
}
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Items.Add(new ScriptItem(a0, "Script " + a0));
scriptNumbers.SelectedIndex = scriptNumbers.Items.Count - 1;
}
}
else
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Text = arg0.Text;
scriptNumbers.Text = a0.ToString();
}
}
else
@ -469,7 +465,7 @@ namespace CodeImp.DoomBuilder.Windows
if(!string.IsNullOrEmpty(scriptNumbers.Text))
{
if(scriptNumbers.SelectedItem != null)
t.Args[0] = ((ScriptItem)scriptNumbers.SelectedItem).Index;
t.Args[0] = ((ScriptItem)((ColoredComboBoxItem)scriptNumbers.SelectedItem).Value).Index;
else if(!int.TryParse(scriptNumbers.Text.Trim(), out t.Args[0]))
t.Args[0] = 0;

View file

@ -79,8 +79,8 @@
this.actiongroup = new System.Windows.Forms.GroupBox();
this.actionhelp = new CodeImp.DoomBuilder.Controls.ActionSpecialHelpButton();
this.hexenpanel = new System.Windows.Forms.Panel();
this.scriptNumbers = new System.Windows.Forms.ComboBox();
this.scriptNames = new System.Windows.Forms.ComboBox();
this.scriptNumbers = new CodeImp.DoomBuilder.Controls.ColoredComboBox();
this.scriptNames = new CodeImp.DoomBuilder.Controls.ColoredComboBox();
this.cbArgStr = new System.Windows.Forms.CheckBox();
this.arg2 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
this.arg1 = new CodeImp.DoomBuilder.Controls.ArgumentBox();
@ -1041,10 +1041,10 @@
private CodeImp.DoomBuilder.Controls.ThingBrowserControl thingtype;
private CodeImp.DoomBuilder.Controls.ButtonsNumericTextbox angle;
private System.Windows.Forms.CheckBox cbArgStr;
private System.Windows.Forms.ComboBox scriptNames;
private CodeImp.DoomBuilder.Controls.ColoredComboBox scriptNames;
private System.Windows.Forms.Label labelAngle;
private CodeImp.DoomBuilder.GZBuilder.Controls.TagSelector tagSelector;
private System.Windows.Forms.ComboBox scriptNumbers;
private CodeImp.DoomBuilder.Controls.ColoredComboBox scriptNumbers;
private System.Windows.Forms.Label labelGravity;
private CodeImp.DoomBuilder.GZBuilder.Controls.AngleControl anglecontrol;
private System.Windows.Forms.PictureBox hint;

View file

@ -20,6 +20,7 @@ using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using CodeImp.DoomBuilder.Controls;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Data;
using CodeImp.DoomBuilder.Config;
@ -141,8 +142,10 @@ namespace CodeImp.DoomBuilder.Windows
scriptNames.Location = scriptNumbers.Location;
// Setup script names
foreach(ScriptItem nsi in General.Map.NamedScripts) scriptNames.Items.Add(nsi);
foreach(ScriptItem si in General.Map.NumberedScripts) scriptNumbers.Items.Add(si);
foreach(ScriptItem nsi in General.Map.NamedScripts)
scriptNames.Items.Add(new ColoredComboBoxItem(nsi, nsi.IsInclude ? SystemColors.HotTrack : SystemColors.WindowText));
foreach(ScriptItem si in General.Map.NumberedScripts)
scriptNumbers.Items.Add(new ColoredComboBoxItem(si, si.IsInclude ? SystemColors.HotTrack : SystemColors.WindowText));
scriptNames.DropDownWidth = Tools.GetDropDownWidth(scriptNames);
scriptNumbers.DropDownWidth = Tools.GetDropDownWidth(scriptNumbers);
@ -354,16 +357,11 @@ namespace CodeImp.DoomBuilder.Windows
break;
}
}
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Items.Add(new ScriptItem(a0, "Script " + a0));
scriptNumbers.SelectedIndex = scriptNumbers.Items.Count - 1;
}
}
else
if(scriptNumbers.SelectedIndex == -1)
{
scriptNumbers.Text = arg0.Text;
scriptNumbers.Text = a0.ToString();
}
}
}
@ -611,7 +609,7 @@ namespace CodeImp.DoomBuilder.Windows
if(!string.IsNullOrEmpty(scriptNumbers.Text))
{
if(scriptNumbers.SelectedItem != null)
t.Args[0] = ((ScriptItem)scriptNumbers.SelectedItem).Index;
t.Args[0] = ((ScriptItem)((ColoredComboBoxItem)scriptNumbers.SelectedItem).Value).Index;
else if(!int.TryParse(scriptNumbers.Text.Trim(), out t.Args[0]))
t.Args[0] = 0;

View file

@ -2503,11 +2503,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
if (v.Level.sector.Fields.GetValue("lightfloorabsolute", false))
{
UDMFTools.SetInteger(v.Level.sector.Fields, "lightfloor", targetbrightness, 0);
v.Level.sector.Fields["lightfloor"] = new UniValue(UniversalType.Integer, targetbrightness);
}
else
{
v.Level.sector.Fields["lightfloor"] = new UniValue(UniversalType.Integer, targetbrightness - v.Level.sector.Brightness);
UDMFTools.SetInteger(v.Level.sector.Fields, "lightfloor", targetbrightness - v.Level.sector.Brightness, 0);
}
v.Sector.UpdateSectorGeometry(false);
@ -2517,14 +2517,15 @@ namespace CodeImp.DoomBuilder.BuilderModes
VisualCeiling v = obj as VisualCeiling;
v.Level.sector.Fields.BeforeFieldsChange();
v.Sector.Changed = true;
v.Sector.Sector.UpdateNeeded = true;
if(v.Level.sector.Fields.GetValue("lightceilingabsolute", false))
{
UDMFTools.SetInteger(v.Level.sector.Fields, "lightceiling", targetbrightness, 0);
v.Level.sector.Fields["lightceiling"] = new UniValue(UniversalType.Integer, targetbrightness);
}
else
{
v.Level.sector.Fields["lightceiling"] = new UniValue(UniversalType.Integer, targetbrightness - v.Level.sector.Brightness);
UDMFTools.SetInteger(v.Level.sector.Fields, "lightceiling", targetbrightness - v.Level.sector.Brightness, 0);
}
v.Sector.UpdateSectorGeometry(false);
@ -2537,11 +2538,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
if (v.Sidedef.Fields.GetValue("lightabsolute", false))
{
UDMFTools.SetInteger(v.Sidedef.Fields, "light", targetbrightness, 0);
v.Sidedef.Fields["light"] = new UniValue(UniversalType.Integer, targetbrightness);
}
else
{
v.Sidedef.Fields["light"] = new UniValue(UniversalType.Integer, targetbrightness - v.Sidedef.Sector.Brightness);
UDMFTools.SetInteger(v.Sidedef.Fields, "light", targetbrightness - v.Sidedef.Sector.Brightness, 0);
}
//Update 'lightfog' flag

View file

@ -387,8 +387,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
Sector.Sector.Fields.BeforeFieldsChange();
//apply changes
Sector.Sector.Fields["lightceiling"] = new UniValue(UniversalType.Integer, newLight);
UDMFTools.SetInteger(Sector.Sector.Fields, "lightceiling", newLight, (absolute ? int.MinValue : 0));
mode.SetActionResult("Changed ceiling brightness to " + newLight + ".");
Sector.Sector.UpdateNeeded = true;
Sector.Sector.UpdateCache();
//rebuild sector