Esempio n. 1
0
 public override void WindowUpdate()
 {
     base.WindowUpdate();
     if (this.selectedDesPanel != null && this.selectedDesPanel.def.showPowerGrid)
     {
         OverlayDrawHandler.DrawPowerGridOverlayThisFrame();
     }
 }
        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);
                    }
                }
            }
        }