Example #1
0
        public StorageSettings              GetParentStoreSettings()
        {
            //Log.Message( string.Format( "{0}.GetParentStoreSettings( {1} )", this.ThingID, Scribe.mode.ToString() ) );
            if (
                (Scribe.mode != LoadSaveMode.Inactive) &&
                (Scribe.mode != LoadSaveMode.ResolvingCrossRefs)
                )
            {
                return(null);
            }
            var hopperUser = CompHopper.FindHopperUser();

            if (hopperUser == null)
            {
                return(null);
            }
            return(hopperUser.ResourceSettings);
        }
Example #2
0
        /// <summary>
        /// Draws a target highlight on Hopper user or connection cell
        /// </summary>
        /// <param name="def"></param>
        /// <param name="center"></param>
        /// <param name="rot"></param>
        public override void                DrawGhost(ThingDef def, IntVec3 center, Rot4 rot)
        {
            var connectionCell = center + rot.FacingCell;
            var hopperUser     = CompHopper.FindHopperUser(connectionCell);
            var thingUser      = hopperUser == null ? (Thing)null : hopperUser.parent;

            if (
                (thingUser != null) &&
                (!thingUser.OccupiedRect().Cells.Contains(center))
                )
            {
                GenDraw.DrawFieldEdges(thingUser.OccupiedRect().Cells.ToList());
                GenDraw.DrawTargetHighlight(thingUser);
            }
            else
            {
                GenDraw.DrawTargetHighlight(connectionCell);
            }
        }