diff --git a/1.6/1.6/Assemblies/ArachnaeSwarm.dll b/1.6/1.6/Assemblies/ArachnaeSwarm.dll index b5d2326..aa912e9 100644 Binary files a/1.6/1.6/Assemblies/ArachnaeSwarm.dll and b/1.6/1.6/Assemblies/ArachnaeSwarm.dll differ diff --git a/Source/ArachnaeSwarm/Building_Comps/ARA_NutrientNetwork/CompLineDrawer.cs b/Source/ArachnaeSwarm/Building_Comps/ARA_NutrientNetwork/CompLineDrawer.cs index 9bd7783..5ac2183 100644 --- a/Source/ArachnaeSwarm/Building_Comps/ARA_NutrientNetwork/CompLineDrawer.cs +++ b/Source/ArachnaeSwarm/Building_Comps/ARA_NutrientNetwork/CompLineDrawer.cs @@ -10,7 +10,8 @@ namespace ArachnaeSwarm { public List linkableBuildings; public float maxDistance = 999f; - + public string lineTexturePath = "Things/Special/Power/Wire"; + public CompProperties_LineDrawer() { compClass = typeof(CompLineDrawer); @@ -21,6 +22,19 @@ namespace ArachnaeSwarm { private CompProperties_LineDrawer Props => (CompProperties_LineDrawer)props; private List linkedBuildings = new List(); + private Material lineMat; + + private Material LineMat + { + get + { + if (lineMat == null) + { + lineMat = MaterialPool.MatFrom(Props.lineTexturePath, ShaderDatabase.Transparent, Color.white); + } + return lineMat; + } + } public override void PostSpawnSetup(bool respawningAfterLoad) { @@ -44,7 +58,7 @@ namespace ArachnaeSwarm linkedBuildings.Clear(); if (Props.linkableBuildings.NullOrEmpty()) return; - var potentialTargets = parent.Map.listerBuildings.allBuildingsColonist.Where(b => + var potentialTargets = parent.Map.listerBuildings.allBuildingsColonist.Where(b => b != parent && Props.linkableBuildings.Contains(b.def) && parent.Position.DistanceTo(b.Position) <= Props.maxDistance @@ -63,7 +77,12 @@ namespace ArachnaeSwarm base.PostPrintOnto(layer); foreach (var building in linkedBuildings) { - PowerNetGraphics.PrintWirePieceConnecting(layer, this.parent, building, false); + Vector3 center = (this.parent.TrueCenter() + this.parent.Graphic.DrawOffset(this.parent.Rotation) + building.TrueCenter() + building.Graphic.DrawOffset(building.Rotation)) / 2f; + center.y = AltitudeLayer.SmallWire.AltitudeFor(); + Vector3 v = building.TrueCenter() - this.parent.TrueCenter(); + Vector2 size = new Vector2(1f, v.MagnitudeHorizontal()); + float rot = v.AngleFlat(); + Printer_Plane.PrintPlane(layer, center, size, this.LineMat, rot); } } }