diff --git a/Sledge.Editor/Tools/EntityTool.cs b/Sledge.Editor/Tools/EntityTool.cs index ebaf910f4..50d4a9a4b 100644 --- a/Sledge.Editor/Tools/EntityTool.cs +++ b/Sledge.Editor/Tools/EntityTool.cs @@ -73,6 +73,10 @@ public override void DocumentChanged() private void BuildMenu() { + if (_menu != null) foreach (var item in _menu) item.Dispose(); + _menu = null; + if (Document == null) return; + var items = new List(); var classes = Document.GameData.Classes.Where(x => x.ClassType != ClassType.Base && x.ClassType != ClassType.Solid).ToList(); var groups = classes.GroupBy(x => x.Name.Split('_')[0]); diff --git a/Sledge.Editor/Tools/TextureTool/TextureToolSidebarPanel.Designer.cs b/Sledge.Editor/Tools/TextureTool/TextureToolSidebarPanel.Designer.cs index 7ec0f98b7..9ca5078e8 100644 --- a/Sledge.Editor/Tools/TextureTool/TextureToolSidebarPanel.Designer.cs +++ b/Sledge.Editor/Tools/TextureTool/TextureToolSidebarPanel.Designer.cs @@ -92,6 +92,11 @@ private void InitializeComponent() this.RandomShiftMax.Name = "RandomShiftMax"; this.RandomShiftMax.Size = new System.Drawing.Size(46, 20); this.RandomShiftMax.TabIndex = 1; + this.RandomShiftMax.Value = new decimal(new int[] { + 256, + 0, + 0, + 0}); // // label3 // diff --git a/Sledge.Providers/Map/ObjProvider.cs b/Sledge.Providers/Map/ObjProvider.cs index ba93fae43..d1ec44019 100644 --- a/Sledge.Providers/Map/ObjProvider.cs +++ b/Sledge.Providers/Map/ObjProvider.cs @@ -254,7 +254,8 @@ private Solid SolidifyFace(DataStructures.MapObjects.Map map, Face face) solid.Colour = Colour.GetRandomBrushColour(); solid.Faces.Add(face); face.Parent = solid; - var offset = face.BoundingBox.Center - face.Plane.Normal * 5; + var center = face.Vertices.Aggregate(Coordinate.Zero, (sum, v) => sum + v.Location) / face.Vertices.Count; + var offset = center - face.Plane.Normal * 5; for (var i = 0; i < face.Vertices.Count; i++) { var v1 = face.Vertices[i];