Linedef Edit Form: added "Subtractive" render style (no Visual mode support yet).

Fixed a misleading hint.
This commit is contained in:
MaxED 2013-12-20 13:41:57 +00:00
parent 2dee709ed6
commit 4e93bc71d3
6 changed files with 15 additions and 15 deletions

View file

@ -644,7 +644,8 @@ namespace CodeImp.DoomBuilder.Windows
this.cbRenderStyle.FormattingEnabled = true;
this.cbRenderStyle.Items.AddRange(new object[] {
"Translucent",
"Additive"});
"Additive",
"Subtractive"});
this.cbRenderStyle.Location = new System.Drawing.Point(92, 26);
this.cbRenderStyle.Name = "cbRenderStyle";
this.cbRenderStyle.Size = new System.Drawing.Size(86, 22);

View file

@ -49,9 +49,10 @@ namespace CodeImp.DoomBuilder.Windows
private ICollection<Linedef> lines;
private List<LinedefProperties> linedefProps; //mxd
private bool preventchanges = false;
private bool preventchanges;
private string arg0str; //mxd
private bool haveArg0Str; //mxd
private readonly List<string> renderStyles = new List<string>() { "translucent", "add", "subtract" };
//mxd. Persistent settings
private static bool linkFrontTopScale;
@ -331,9 +332,8 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. UDMF Settings
if(General.Map.FormatInterface.HasCustomFields) {
fieldslist.SetValues(fl.Fields, true); // Custom fields
string renderStyle = fl.Fields.GetValue("renderstyle", "");
cbRenderStyle.SelectedIndex = (renderStyle == "add" ? 1 : 0);
int renderstyle = renderStyles.IndexOf(fl.Fields.GetValue("renderstyle", ""));
cbRenderStyle.SelectedIndex = (renderstyle == -1 ? 0 : renderstyle);
alpha.Text = General.Clamp(fl.Fields.GetValue("alpha", 1.0f), 0f, 1f).ToString();
lockNumber.Text = fl.Fields.GetValue("locknumber", 0).ToString();
arg0str = fl.Fields.GetValue("arg0str", string.Empty);
@ -459,8 +459,7 @@ namespace CodeImp.DoomBuilder.Windows
//mxd. UDMF Settings
if(General.Map.FormatInterface.HasCustomFields) {
int i = (l.Fields.GetValue("renderstyle", "") == "add" ? 1 : 0);
int i = Math.Max(0, renderStyles.IndexOf(l.Fields.GetValue("renderstyle", "")));
if(cbRenderStyle.SelectedIndex != -1 && i != cbRenderStyle.SelectedIndex)
cbRenderStyle.SelectedIndex = -1;
@ -927,12 +926,12 @@ namespace CodeImp.DoomBuilder.Windows
if(preventchanges) return;
//update values
if(cbRenderStyle.SelectedIndex == 1) { //add
foreach(Linedef l in lines)
l.Fields["renderstyle"] = new UniValue(UniversalType.String, "add");
} else {
if(cbRenderStyle.SelectedIndex == 0) {
foreach(Linedef l in lines)
if(l.Fields.ContainsKey("renderstyle")) l.Fields.Remove("renderstyle");
} else {
foreach(Linedef l in lines)
l.Fields["renderstyle"] = new UniValue(UniversalType.String, renderStyles[cbRenderStyle.SelectedIndex]);
}
General.Map.IsChanged = true;

View file

@ -269,7 +269,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
string gridIncKey = Actions.Action.GetShortcutKeyDesc("builder_griddec");
string gridDecKey = Actions.Action.GetShortcutKeyDesc("builder_gridinc");
hints = new[]{ "Press " + panKey + " to pan the view",
hints = new[]{ "Hold " + panKey + " to pan the view",
"Press " + selectKey + " to select a linedef",
"Hold " + selectKey + " and drag to use rectangular selection",
"Press " + clearKey + " to clear selection",

View file

@ -536,7 +536,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
string gridIncKey = Actions.Action.GetShortcutKeyDesc("builder_griddec");
string gridDecKey = Actions.Action.GetShortcutKeyDesc("builder_gridinc");
hints = new[]{ "Press " + panKey + " to pan the view",
hints = new[]{ "Hold " + panKey + " to pan the view",
"Press " + selectKey + " to select a sector",
"Hold " + selectKey + " and drag to use rectangular selection",
"Press " + clearKey + " to clear selection",

View file

@ -647,7 +647,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
string gridIncKey = Actions.Action.GetShortcutKeyDesc("builder_griddec");
string gridDecKey = Actions.Action.GetShortcutKeyDesc("builder_gridinc");
hints = new[]{ "Press " + panKey + " to pan the view",
hints = new[]{ "Hold " + panKey + " to pan the view",
"Press " + selectKey + " to select a thing",
"Hold " + selectKey + " and drag to use rectangular selection",
"Press " + clearKey + " to clear selection",

View file

@ -658,7 +658,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
string gridIncKey = Actions.Action.GetShortcutKeyDesc("builder_griddec");
string gridDecKey = Actions.Action.GetShortcutKeyDesc("builder_gridinc");
hints = new[]{ "Press " + panKey + " to pan the view",
hints = new[]{ "Hold " + panKey + " to pan the view",
"Press " + selectKey + " to select a vertex",
"Hold " + selectKey + " and drag to use rectangular selection",
"Press " + clearKey + " to clear selection",