Exemple #1
0
    public void PrintForPowerGrid(SectionLayer layer)
    {
        //Transmitter stuff
        if (TransmitsPower)
        {
            foreach (IntVec3 sq in GenAdj.SquaresOccupiedBy(this))
            {
                //Transmission lines
                LinkDrawers.transmitterOverlay.PrintOnto(layer, this, sq);
            }
        }


        //The connector base (small blue circle)
        if (def.ConnectToPower)
        {
            PowerNetGraphics.PrintOverlayConnectorBaseFor(layer, this);
        }

        //The connector wire
        if (connectedToTransmitter != null)
        {
            PowerNetGraphics.PrintWirePieceConnecting(layer, this, connectedToTransmitter, true);
        }
    }
Exemple #2
0
    public override void PrintOnto(SectionLayer layer)
    {
        //Yield power wires connecting me to my transmitter
        if (connectedToTransmitter != null)
        {
            PowerNetGraphics.PrintWirePieceConnecting(layer, this, connectedToTransmitter, false);
        }

        base.PrintOnto(layer);
    }
Exemple #3
0
        public static void Postfix(ref BuildableDef def)
        {
            ThingDef thingDef = def as ThingDef;

            if (thingDef != null && thingDef.GetCompProperties <CompProperties_SteamAlternator>() != null)
            {
                IntVec3   intVec    = UI.MouseCell();
                CompPower compPower = PowerConnectionMaker.BestTransmitterForConnector(intVec, Find.VisibleMap, null);
                if (compPower != null)
                {
                    PowerNetGraphics.RenderAnticipatedWirePieceConnecting(intVec, compPower.parent);
                }
            }
        }
        public override void SelectedUpdate()
        {
            base.SelectedUpdate();
            IntVec3  intVec   = UI.MouseCell();
            ThingDef thingDef = this.entDef as ThingDef;

            if (thingDef != null && (thingDef.EverTransmitsPower || thingDef.ConnectToPower))
            {
                OverlayDrawHandler.DrawPowerGridOverlayThisFrame();
                if (thingDef.ConnectToPower)
                {
                    CompPower compPower = PowerConnectionMaker.BestTransmitterForConnector(intVec, Find.VisibleMap, null);
                    if (compPower != null)
                    {
                        PowerNetGraphics.RenderAnticipatedWirePieceConnecting(intVec, compPower.parent);
                    }
                }
            }
        }
Exemple #5
0
        public static void DrawPowerGrid(SectionLayer layer, CompPower comp)
        {
            if (comp.TransmitsPowerNow)
            {
                //Graphic_LinkedTransmitterOverlay graphic = (Graphic_LinkedTransmitterOverlay)PowerOverlayMats.LinkedOverlayGraphic;
                //Color color = GetNetColor(comp);
                //SectionLayer l = layer;

                //Graphic_LinkedTransmitterOverlay colored = GetColoredVersion(graphic, graphic.Shader, color, color);
                //colored.Print(l, comp.parent);
                Graphic_LinkedTransmitterOverlay graphic = NewPowerOverlayMats.LinkedOverlayGraphic;
                graphic.Print(layer, comp.parent);
            }
            if (comp.parent.def.ConnectToPower)
            {
                PowerNetGraphics.PrintOverlayConnectorBaseFor(layer, comp.parent);
            }
            if (comp.connectParent != null)
            {
                PowerNetGraphics.PrintWirePieceConnecting(layer, comp.parent, comp.connectParent.parent, true);
            }
        }