mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-12-03 17:12:06 +00:00
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:
parent
ca9c464526
commit
4632fdbe99
15 changed files with 49 additions and 21 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System;
|
||||
//using System.Collections.Generic;
|
||||
//using System.Text;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue