示例#1
0
 public static void DrawDetails(Pawn pawn, Apparel curr)
 {
     try
     {
         if (pawn.needs != null && pawn.story != null && !pawn.kindDef.factionLeader)
         {
             ApparelDetailDrawer drawer;
             if ((drawer = curr.TryGetComp <ApparelDetailDrawer>()) != null)
             {
                 drawer.PostSpawnSetup();
                 if (drawer.HasDetail)
                 {
                     ApparelGraphicRecord recDetail;
                     if (ApparelDetailDrawer.TryGetApparelDetails(curr, drawer.DetailGraphic, out recDetail))
                     {
                         //                              Log.Message("Inserting Detail");
                         pawn.Drawer.renderer.graphics.apparelGraphics.Add(recDetail);
                     }
                 }
             }
         }
     }
     catch
     {
     }
 }
示例#2
0
        public void ResolveApparelGraphicsOriginal()
        {
            this.ClearCache();
            this.apparelGraphics.Clear();
            List <Apparel> OriginalItems = new List <Apparel>();

            foreach (Apparel current in this.pawn.apparel.WornApparelInDrawOrder)
            {
                ApparelGraphicRecord item;
                if (current.GetComp <CompFactionColor>() != null)
                {
                    if ((ApparelGraphicGetterFC.TryGetGraphicApparelModded(current, this.pawn.story.BodyType, out item)))
                    {
                        if (current.GetComp <ApparelDetailDrawer>() != null && !current.Spawned)
                        {
                            OriginalItems.Add(current);
                        }

                        this.apparelGraphics.Add(item);
                    }
                }

                else if (ApparelGraphicRecordGetter.TryGetGraphicApparel(current, this.pawn.story.BodyType, out item))
                {
                    this.apparelGraphics.Add(item);
                }
            }
            Corruption.AfflictionDrawerUtility.DrawChaosOverlays(this.pawn);
            foreach (Apparel app in OriginalItems)
            {
                ApparelDetailDrawer.DrawDetails(this.pawn, app);
            }
        }
示例#3
0
        public void ResolveApparelGraphicsModded()
        {
            this.ClearCache();
            this.apparelGraphics.Clear();


            List <ApparelGraphicRecord> ApparelDetails = new List <ApparelGraphicRecord>();
            List <Apparel> OriginalItems = new List <Apparel>();

            foreach (Apparel current in this.pawn.apparel.WornApparelInDrawOrder)
            {
                ApparelGraphicRecord item;
                if (current.AllComps.Any(i => i.GetType() == typeof(CompFactionColor)))
                {
                    if (this.pawn.def.race.intelligence <= Intelligence.ToolUser)
                    {
                        btype = BodyType.Male;
                    }
                    else
                    {
                        btype = this.pawn.story.BodyType;
                    }
                    if (ApparelGraphicGetterFC.TryGetGraphicApparelModded(current, btype, out item))
                    {
                        this.apparelGraphics.Add(item);
                        if (current.GetComp <ApparelDetailDrawer>() != null && !current.Spawned)
                        {
                            //         current.GetComp<ApparelDetailDrawer>().PostSpawnSetup();
                            //         ApparelGraphicRecord detail;
                            //         ApparelDetailDrawer.ReturnApparelDetails(current, out detail);
                            //         this.apparelGraphics.Add(detail);
                            OriginalItems.Add(current);
                        }
                    }
                }
                else if (current.AllComps.Any(i => i.GetType() == typeof(CompRenderToolUserApparel)))
                {
                    btype = BodyType.Male;

                    //   ApparelGraphicGetterFC.TryGetGraphicApparelModded(current, btype, out item, current.DrawColor, current.DrawColorTwo);
                    //   this.apparelGraphics.Add(item);
                }
                else if (ApparelGraphicRecordGetter.TryGetGraphicApparel(current, this.pawn.story.BodyType, out item))
                {
                    this.apparelGraphics.Add(item);
                }
            }
            //      Corruption.AfflictionDrawerUtility.DrawChaosOverlays(this.pawn);
            foreach (Apparel app in OriginalItems)
            {
                ApparelDetailDrawer.DrawDetails(this.pawn, app);
            }
        }
示例#4
0
        public static bool ReturnApparelDetails(Apparel curr, out ApparelGraphicRecord result)
        {
            ApparelDetailDrawer drawer;

            if ((drawer = curr.TryGetComp <ApparelDetailDrawer>()) != null)
            {
                //      Log.Message("Checking Available Details");
                if (drawer.HasDetail)
                {
                    //            Log.Message("Found Detail");
                    ApparelGraphicRecord recDetail;
                    if (ApparelDetailDrawer.TryGetApparelDetails(curr, drawer.DetailGraphic, out recDetail))
                    {
                        //              Log.Message("Gotten ApparelDetailRecord");
                        result = recDetail;
                        return(true);
                    }
                }
            }
            result = new ApparelGraphicRecord();
            return(false);
        }