public override void PostSpawnSetup(bool respawningAfterLoad)
 {
     base.PostSpawnSetup(respawningAfterLoad);
     this.currentColor = Props.colorOptions[currentColorInd];
     this.dirty        = true;
     this.compPower    = this.parent.GetComp <CompPowerTrader>();
 }
        public void UpdateGlower(int colorOptionInd)
        {
            RemoveGlower();
            var colorOption = Props.colorOptions[colorOptionInd];

            this.currentColor    = colorOption;
            this.currentColorInd = colorOptionInd;
            this.compGlower      = new CompGlower();
            Thing dummyThing = null;

            if (Props.spawnGlowerInFacedCell)
            {
                dummyThing = ThingMaker.MakeThing(ThingDef.Named("RE_WallLightDummyWorkaround"));
                var cellGlower = this.parent.Position + base.parent.Rotation.FacingCell;
                GenSpawn.Spawn(dummyThing, cellGlower, this.parent.Map);
                this.compGlower.parent = dummyThing as ThingWithComps;
            }
            else
            {
                this.compGlower.parent = this.parent;
            }
            this.compGlower.Initialize(new CompProperties_Glower()
            {
                glowColor       = colorOption.glowColor,
                glowRadius      = colorOption.glowRadius,
                overlightRadius = colorOption.overlightRadius
            });
            base.parent.Map.mapDrawer.MapMeshDirty(base.parent.Position, MapMeshFlag.Things);
            base.parent.Map.glowGrid.RegisterGlower(this.compGlower);
            if (Props.spawnGlowerInFacedCell)
            {
                dummyThing.DeSpawn();
            }
        }
Beispiel #3
0
        public void UpdateGlower(int colorOptionInd)
        {
            RemoveGlower();
            var colorOption = Props.colorOptions[colorOptionInd];

            this.currentColor    = colorOption;
            this.currentColorInd = colorOptionInd;

            this.compGlower        = new CompGlower();
            this.compGlower.parent = this.parent;
            this.compGlower.Initialize(new CompProperties_Glower()
            {
                glowColor       = colorOption.glowColor,
                glowRadius      = colorOption.glowRadius,
                overlightRadius = colorOption.overlightRadius
            });

            base.parent.Map.mapDrawer.MapMeshDirty(base.parent.Position, MapMeshFlag.Things);
            base.parent.Map.glowGrid.RegisterGlower(this.compGlower);
        }
 public override void PostExposeData()
 {
     base.PostExposeData();
     Scribe_Values.Look(ref currentColorInd, "currentColorInd");
     this.currentColor = Props.colorOptions[currentColorInd];
 }