Visual modes: selected objects are not highlighted when "Toggle highlight" (H key) option is set to off.

Error Checks Mode: added linedef index to message text of all linedef-related errors.
UDMF: wall texture offsets are now rounded when user edits them via cursor keys or mouse dragging (because they are stored as integers anyway).
This commit is contained in:
MaxED 2012-10-08 13:07:56 +00:00
parent ca9c464526
commit 4632fdbe99
15 changed files with 49 additions and 21 deletions

View file

@ -110,7 +110,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This must return the string that is displayed in the listbox
public override string ToString()
{
return "Linedef is missing front side";
return "Linedef " + line.Index + " is missing front side";
}
// Rendering

View file

@ -143,7 +143,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This must return the string that is displayed in the listbox
public override string ToString()
{
return "Linedef is missing both sides";
return "Linedef " + line.Index + " is missing both sides";
}
// Rendering

View file

@ -108,7 +108,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This must return the string that is displayed in the listbox
public override string ToString()
{
return "Linedef is marked double-sided but has no back side";
return "Linedef " + line.Index + " is marked double-sided but has no back side";
}
// Rendering

View file

@ -73,7 +73,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This must return the string that is displayed in the listbox
public override string ToString()
{
return "Linedef is marked single-sided but has two sides";
return "Linedef " + line.Index + " is marked single-sided but has two sides";
}
// Rendering

View file

@ -73,7 +73,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
// This must return the string that is displayed in the listbox
public override string ToString()
{
return "Linedefs are overlapping and references different sectors";
return "Linedefs " + line1.Index + " and " + line2.Index + " are overlapping and references different sectors";
}
// Rendering

View file

@ -78,13 +78,13 @@ namespace CodeImp.DoomBuilder.BuilderModes
switch (part)
{
case SidedefPart.Upper:
return "Sidedef has missing upper texture (" + sidestr + " side)";
return "Sidedef " + side.Index + " has missing upper texture (" + sidestr + " side)";
case SidedefPart.Middle:
return "Sidedef has missing middle texture (" + sidestr + " side)";
return "Sidedef " + side.Index + " has missing middle texture (" + sidestr + " side)";
case SidedefPart.Lower:
return "Sidedef has missing lower texture (" + sidestr + " side)";
return "Sidedef " + side.Index + " has missing lower texture (" + sidestr + " side)";
default:
return "ERROR";

View file

@ -1,6 +1,4 @@
using System;
//using System.Collections.Generic;
//using System.Text;
using CodeImp.DoomBuilder.Map;
using CodeImp.DoomBuilder.Rendering;

View file

@ -149,7 +149,16 @@ namespace CodeImp.DoomBuilder.BuilderModes
public float HighlightRange { get { return highlightrange; } }
public float HighlightThingsRange { get { return highlightthingsrange; } }
public float SplitLinedefsRange { get { return splitlinedefsrange; } }
public bool UseHighlight { get { return usehighlight; } set { usehighlight = value; } }
public bool UseHighlight {
get {
return usehighlight;
}
set {
usehighlight = value;
General.Map.Renderer3D.ShowSelection = usehighlight;
General.Map.Renderer3D.ShowHighlight = usehighlight;
}
}
public bool AutoDragOnPaste { get { return autodragonpaste; } set { autodragonpaste = value; } }
#endregion

View file

@ -613,8 +613,11 @@ namespace CodeImp.DoomBuilder.BuilderModes
renderer.SetFogMode(true);
// Set target for highlighting
if(BuilderPlug.Me.UseHighlight)
renderer.SetHighlightedObject(target.picked);
renderer.ShowSelection = BuilderPlug.Me.UseHighlight; //mxd
if (BuilderPlug.Me.UseHighlight)
renderer.SetHighlightedObject(target.picked);
// Begin with geometry
renderer.StartGeometry();

View file

@ -365,6 +365,14 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
poly = newp;
}
//mxd
protected float getRoundedTextureOffset(float offset, float scale) {
if (offset == 0f) return 0f;
float result = (float)Math.Round(offset * scale);
if (result == 0) result = 1f * (offset < 0 ? -1 : 1);
return result;
}
#endregion

View file

@ -828,6 +828,8 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
renderer.SetFogMode(true);
// Set target for highlighting
renderer.ShowSelection = BuilderPlug.Me.UseHighlight; //mxd
if(BuilderPlug.Me.UseHighlight)
renderer.SetHighlightedObject(target.picked);

View file

@ -236,8 +236,10 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
float oldy = Sidedef.Fields.GetValue("offsety_bottom", 0.0f);
float scalex = Sidedef.Fields.GetValue("scalex_bottom", 1.0f);
float scaley = Sidedef.Fields.GetValue("scaley_bottom", 1.0f);
Sidedef.Fields["offsetx_bottom"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
Sidedef.Fields["offsety_bottom"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
Sidedef.Fields["offsetx_bottom"] = new UniValue(UniversalType.Float, oldx + getRoundedTextureOffset((float)xy.X, scalex)); //mxd
Sidedef.Fields["offsety_bottom"] = new UniValue(UniversalType.Float, oldy + getRoundedTextureOffset((float)xy.Y, scaley)); //mxd
//Sidedef.Fields["offsetx_bottom"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
//Sidedef.Fields["offsety_bottom"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
}
protected override Point GetTextureOffset()

View file

@ -309,8 +309,10 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
float oldy = Sidedef.Fields.GetValue("offsety_mid", 0.0f);
float scalex = Sidedef.Fields.GetValue("scalex_mid", 1.0f);
float scaley = Sidedef.Fields.GetValue("scaley_mid", 1.0f);
Sidedef.Fields["offsetx_mid"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
Sidedef.Fields["offsety_mid"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
Sidedef.Fields["offsetx_mid"] = new UniValue(UniversalType.Float, oldx + getRoundedTextureOffset((float)xy.X, scalex)); //mxd
Sidedef.Fields["offsety_mid"] = new UniValue(UniversalType.Float, oldy + getRoundedTextureOffset((float)xy.Y, scaley)); //mxd
//Sidedef.Fields["offsetx_mid"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
//Sidedef.Fields["offsety_mid"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
}
protected override Point GetTextureOffset()

View file

@ -237,8 +237,10 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
float oldy = Sidedef.Fields.GetValue("offsety_mid", 0.0f);
float scalex = Sidedef.Fields.GetValue("scalex_mid", 1.0f);
float scaley = Sidedef.Fields.GetValue("scaley_mid", 1.0f);
Sidedef.Fields["offsetx_mid"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
Sidedef.Fields["offsety_mid"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
Sidedef.Fields["offsetx_mid"] = new UniValue(UniversalType.Float, oldx + getRoundedTextureOffset((float)xy.X, scalex)); //mxd
Sidedef.Fields["offsety_mid"] = new UniValue(UniversalType.Float, oldy + getRoundedTextureOffset((float)xy.Y, scaley)); //mxd
//Sidedef.Fields["offsetx_mid"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
//Sidedef.Fields["offsety_mid"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
}
protected override Point GetTextureOffset()

View file

@ -236,8 +236,10 @@ namespace CodeImp.DoomBuilder.GZDoomEditing
float oldy = Sidedef.Fields.GetValue("offsety_top", 0.0f);
float scalex = Sidedef.Fields.GetValue("scalex_top", 1.0f);
float scaley = Sidedef.Fields.GetValue("scaley_top", 1.0f);
Sidedef.Fields["offsetx_top"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
Sidedef.Fields["offsety_top"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
Sidedef.Fields["offsetx_top"] = new UniValue(UniversalType.Float, oldx + getRoundedTextureOffset((float)xy.X, scalex)); //mxd
Sidedef.Fields["offsety_top"] = new UniValue(UniversalType.Float, oldy + getRoundedTextureOffset((float)xy.Y, scaley)); //mxd
//Sidedef.Fields["offsetx_top"] = new UniValue(UniversalType.Float, oldx + (float)xy.X * scalex);
//Sidedef.Fields["offsety_top"] = new UniValue(UniversalType.Float, oldy + (float)xy.Y * scaley);
}
protected override Point GetTextureOffset()