diff --git a/Help/gzdb/features/features.html b/Help/gzdb/features/features.html index b6ac09a4..03ce05b8 100644 --- a/Help/gzdb/features/features.html +++ b/Help/gzdb/features/features.html @@ -128,7 +128,7 @@
  • [new] Sector Info panel shows the number of sector's sidedefs as well as light and fade colors (UDMF only):
  • -
  • [new] Sector effects are now shown on top of unselected sectors (works only if "View Selection Numbering" option is enabled).
  • +
  • [new] Sector effects are shown on top of unselected sectors (works only if "View Selection Numbering" option is enabled).
  • diff --git a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs index 374c2197..2a7e52da 100644 --- a/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs +++ b/Source/Plugins/BuilderModes/ClassicModes/SectorsMode.cs @@ -63,6 +63,7 @@ namespace CodeImp.DoomBuilder.BuilderModes //mxd. Effects private Dictionary effects; + private int maxEffectLabelLength; #endregion @@ -80,7 +81,9 @@ namespace CodeImp.DoomBuilder.BuilderModes //mxd effects = new Dictionary(); foreach (SectorEffectInfo info in General.Map.Config.SortedSectorEffects) { - effects.Add(info.Index, new[] { info.Index + ": " + info.Title, "E"+info.Index }); + string name = info.Index + ": " + info.Title; + if (name.Length > maxEffectLabelLength) maxEffectLabelLength = name.Length; + effects.Add(info.Index, new[] { name, "E" + info.Index }); } } @@ -135,7 +138,7 @@ namespace CodeImp.DoomBuilder.BuilderModes for(int i = 0; i < s.Labels.Count; i++) { Vector2D v = s.Labels[i].position; - labelarray[i] = new TextLabel(20); + labelarray[i] = new TextLabel(maxEffectLabelLength); labelarray[i].TransformCoords = true; labelarray[i].Rectangle = new RectangleF(v.x, v.y, 0.0f, 0.0f); labelarray[i].AlignX = TextAlignmentX.Center; @@ -153,10 +156,32 @@ namespace CodeImp.DoomBuilder.BuilderModes { if(renderer.StartOverlay(true)) { + //mxd. Render highlighted sector + if(highlighted != null) { + int highlightedColor = General.Colors.Highlight.WithAlpha(42).ToInt(); + FlatVertex[] verts = new FlatVertex[highlighted.FlatVertices.Length]; + highlighted.FlatVertices.CopyTo(verts, 0); + for(int i = 0; i < verts.Length; i++) verts[i].c = highlightedColor; + renderer.RenderGeometry(verts, null, true); + } + + // Go for all selected sectors + ICollection orderedselection = General.Map.Map.GetSelectedSectors(true); + + //mxd. Render selected sectors + int selectedColor = General.Colors.Selection.WithAlpha(42).ToInt(); //mxd + foreach (Sector s in orderedselection) { + if (s != highlighted) { + FlatVertex[] verts = new FlatVertex[s.FlatVertices.Length]; + s.FlatVertices.CopyTo(verts, 0); + for (int i = 0; i < verts.Length; i++) + verts[i].c = selectedColor; + renderer.RenderGeometry(verts, null, true); + } + } + if(BuilderPlug.Me.ViewSelectionNumbers) { - // Go for all selected sectors - ICollection orderedselection = General.Map.Map.GetSelectedSectors(true); foreach(Sector s in orderedselection) { // Render labels