mirror of
https://git.do.srb2.org/STJr/ZoneBuilder.git
synced 2025-03-04 00:21:44 +00:00
Changed, Visual mode: "Paste Selection" action (Ctrl-V) can now paste both copied textures and things, based on what was copied last.
Changed, Map Analysis mode: the view is now much more zoomed after clocking on a "Check very short linedefs" error check result. Removed single testing engine launchable by the editor at once limitation (it worked properly only when using Test map actions anyway). Fixed: re-did the fix for invalid geometry created when drawing very large grids from R2653, because it caused other issues.
This commit is contained in:
parent
d301042f42
commit
18517b2257
6 changed files with 30 additions and 17 deletions
|
@ -719,7 +719,7 @@ namespace CodeImp.DoomBuilder.Editing
|
|||
|
||||
if(s == null)
|
||||
{
|
||||
General.MainWindow.DisplayStatus(StatusType.Warning, "Can't test from current position: cursor is not inside sector!");
|
||||
General.MainWindow.DisplayStatus(StatusType.Warning, "Can't test from current position: mouse cursor must be inside a sector!");
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
@ -100,7 +100,7 @@ namespace CodeImp.DoomBuilder.GZBuilder.Data
|
|||
if(File.Exists(testprogram))
|
||||
{
|
||||
Icon i = Icon.ExtractAssociatedIcon(testprogram);
|
||||
icon = (i != null ? i.ToBitmap() : new Bitmap(Properties.Resources.Question));
|
||||
icon = new Bitmap(i != null ? i.ToBitmap() : Properties.Resources.Question);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -939,7 +939,6 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
if(points[0].stitch) mergeverts.Add(v1); else nonmergeverts.Add(v1);
|
||||
|
||||
// Go for all other points
|
||||
int roundprecision = (General.Map.FormatInterface.VertexDecimals > 0 ? General.Map.FormatInterface.VertexDecimals - 1 : 0); //mxd
|
||||
for(int i = 1; i < points.Count; i++)
|
||||
{
|
||||
// Create vertex for point
|
||||
|
@ -965,7 +964,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
// Check if any other lines intersect this line
|
||||
List<float> intersections = new List<float>();
|
||||
Line2D measureline = ld.Line;
|
||||
Dictionary<Linedef, bool> processed = new Dictionary<Linedef, bool>(); //mxd
|
||||
HashSet<Linedef> processed = new HashSet<Linedef>(); //mxd
|
||||
|
||||
//mxd
|
||||
foreach(Sector s in map.Sectors)
|
||||
|
@ -975,7 +974,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
{
|
||||
foreach(Sidedef side in s.Sidedefs)
|
||||
{
|
||||
if(processed.ContainsKey(side.Line)) continue;
|
||||
if(processed.Contains(side.Line)) continue;
|
||||
if(side.Line == ld) continue;
|
||||
|
||||
float u;
|
||||
|
@ -985,7 +984,7 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
intersections.Add(u);
|
||||
}
|
||||
|
||||
processed.Add(side.Line, false);
|
||||
processed.Add(side.Line);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1002,10 +1001,6 @@ namespace CodeImp.DoomBuilder.Geometry
|
|||
// may already have changed in length due to a previous split
|
||||
Vector2D splitpoint = measureline.GetCoordinatesAt(u);
|
||||
|
||||
//mxd. Work around some imprecisions when splitting very long lines (like 19000 mu long)
|
||||
splitpoint.x = (float)Math.Round(splitpoint.x, roundprecision);
|
||||
splitpoint.y = (float)Math.Round(splitpoint.y, roundprecision);
|
||||
|
||||
// Make the vertex
|
||||
Vertex splitvertex = map.CreateVertex(splitpoint);
|
||||
if(splitvertex == null) return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ namespace CodeImp.DoomBuilder.Map
|
|||
|
||||
/// <summary>Stiching distance. This is only to get around inaccuracies. Basically,
|
||||
/// geometry only stitches when exactly on top of each other.</summary>
|
||||
public const float STITCH_DISTANCE = 0.001f;
|
||||
public const float STITCH_DISTANCE = 0.005f; //mxd. 0.001f is not enough when drawing very long lines...
|
||||
|
||||
// Virtual sector identification
|
||||
// This contains a character that is invalid in the UDMF standard, but valid
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
#region ================== Namespaces
|
||||
|
||||
using System;
|
||||
using System.Drawing;
|
||||
using CodeImp.DoomBuilder.Map;
|
||||
using CodeImp.DoomBuilder.Rendering;
|
||||
|
||||
|
@ -50,7 +51,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
// This must return the string that is displayed in the listbox
|
||||
public override string ToString()
|
||||
{
|
||||
return "Linedef " + line.Index + " is shorter than 1 m.u.";
|
||||
return "Linedef " + line.Index + " is shorter than 1 mu.";
|
||||
}
|
||||
|
||||
// Rendering
|
||||
|
@ -61,6 +62,19 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
renderer.PlotVertex(line.End, ColorCollection.VERTICES);
|
||||
}
|
||||
|
||||
// We must zoom in way more than usual...
|
||||
public override RectangleF GetZoomArea()
|
||||
{
|
||||
// Get Area
|
||||
RectangleF area = base.GetZoomArea();
|
||||
|
||||
// Remove padding
|
||||
area.Inflate(-97f, -97f);
|
||||
|
||||
// Return area
|
||||
return area;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
|
@ -3001,7 +3001,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
public void TextureCopy()
|
||||
{
|
||||
PreActionNoChange();
|
||||
GetTargetEventReceiver(true).OnCopyTexture(); //mxd
|
||||
IVisualEventReceiver i = GetTargetEventReceiver(true);
|
||||
i.OnCopyTexture(); //mxd
|
||||
if(!(i is VisualThing)) copybuffer.Clear(); //mxd. Not copying things any more...
|
||||
PostAction();
|
||||
}
|
||||
|
||||
|
@ -3434,7 +3436,9 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
VisualThing vt = (VisualThing)i;
|
||||
if(vt != null) copybuffer.Add(new ThingCopyData(vt.Thing));
|
||||
}
|
||||
General.Interface.DisplayStatus(StatusType.Info, "Copied " + copybuffer.Count + " Things");
|
||||
|
||||
string rest = copybuffer.Count + (copybuffer.Count > 1 ? " things." : " thing.");
|
||||
General.Interface.DisplayStatus(StatusType.Info, "Copied " + rest);
|
||||
}
|
||||
|
||||
//mxd
|
||||
|
@ -3444,7 +3448,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
CopySelection();
|
||||
|
||||
//Create undo
|
||||
string rest = copybuffer.Count + " thing" + (copybuffer.Count > 1 ? "s." : ".");
|
||||
string rest = copybuffer.Count + (copybuffer.Count > 1 ? " things." : " thing.");
|
||||
CreateUndo("Cut " + rest);
|
||||
General.Interface.DisplayStatus(StatusType.Info, "Cut " + rest);
|
||||
|
||||
|
@ -3470,7 +3474,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
{
|
||||
if(copybuffer.Count == 0)
|
||||
{
|
||||
General.Interface.DisplayStatus(StatusType.Warning, "Nothing to paste, cut or copy some Things first!");
|
||||
TexturePaste(); // I guess we may paste a texture or two instead
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3482,7 +3486,7 @@ namespace CodeImp.DoomBuilder.BuilderModes
|
|||
return;
|
||||
}
|
||||
|
||||
string rest = copybuffer.Count + " thing" + (copybuffer.Count > 1 ? "s" : "");
|
||||
string rest = copybuffer.Count + (copybuffer.Count > 1 ? " things." : " thing.");
|
||||
General.Map.UndoRedo.CreateUndo("Paste " + rest);
|
||||
General.Interface.DisplayStatus(StatusType.Info, "Pasted " + rest);
|
||||
|
||||
|
|
Loading…
Reference in a new issue