Exemplo n.º 1
0
 public override void PostPrintOnto(SectionLayer layer)
 {
     base.PostPrintOnto(layer);
     if (this.connectParent != null)
     {
         PowerNetGraphics.PrintWirePieceConnecting(layer, this.parent, this.connectParent.parent, false);
     }
 }
Exemplo n.º 2
0
 public override void CompPrintForPowerGrid(SectionLayer layer)
 {
     if (this.TransmitsPowerNow)
     {
         PowerOverlayMats.LinkedOverlayGraphic.Print(layer, this.parent);
     }
     if (this.parent.def.ConnectToPower)
     {
         PowerNetGraphics.PrintOverlayConnectorBaseFor(layer, this.parent);
     }
     if (this.connectParent != null)
     {
         PowerNetGraphics.PrintWirePieceConnecting(layer, this.parent, this.connectParent.parent, true);
     }
 }
        public static void TryDrawPowerGridAndAnticipatedConnection(BuildableDef def, Rot4 rotation)
        {
            ThingDef thingDef = def as ThingDef;

            if (thingDef != null && (thingDef.EverTransmitsPower || thingDef.ConnectToPower))
            {
                OverlayDrawHandler.DrawPowerGridOverlayThisFrame();
                if (thingDef.ConnectToPower)
                {
                    IntVec3   intVec    = UI.MouseCell();
                    CompPower compPower = PowerConnectionMaker.BestTransmitterForConnector(intVec, Find.CurrentMap, null);
                    if (compPower != null && !compPower.parent.Position.Fogged(compPower.parent.Map))
                    {
                        PowerNetGraphics.RenderAnticipatedWirePieceConnecting(intVec, rotation, def.Size, compPower.parent);
                    }
                }
            }
        }