コード例 #1
0
        public static int ToPawnLayerIndex(ApparelProperties apparelProperties)
        {
            ApparelLayer layer = apparelProperties.LastLayer;

            if (layer == ApparelLayer.OnSkin && apparelProperties.bodyPartGroups.Count == 1 && apparelProperties.bodyPartGroups[0].Equals(BodyPartGroupDefOf.Legs))
            {
                return(Pants);
            }
            else
            {
                switch (layer)
                {
                case ApparelLayer.OnSkin:
                    return(BottomClothingLayer);

                case ApparelLayer.Middle:
                    return(MiddleClothingLayer);

                case ApparelLayer.Shell:
                    return(TopClothingLayer);

                case ApparelLayer.Accessory:
                    return(Accessory);

                case ApparelLayer.Overhead:
                    return(Hat);

                default:
                {
                    Log.Warning("Cannot find matching layer for apparel.  Last layer: " + apparelProperties.LastLayer);
                    return(-1);
                }
                }
            }
        }
コード例 #2
0
            public bool CoatButNoShirt()
            {
                bool flag  = false;
                bool flag2 = false;

                for (int i = 0; i < this.aps.Count; i++)
                {
                    if (this.aps[i].thing.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso))
                    {
                        for (int j = 0; j < this.aps[i].thing.apparel.layers.Count; j++)
                        {
                            ApparelLayer apparelLayer = this.aps[i].thing.apparel.layers[j];
                            if (apparelLayer == ApparelLayer.OnSkin)
                            {
                                flag2 = true;
                            }
                            if (apparelLayer == ApparelLayer.Shell || apparelLayer == ApparelLayer.Middle)
                            {
                                flag = true;
                            }
                        }
                    }
                }
                return(flag && !flag2);
            }
コード例 #3
0
 public static void GenerateLayerGroupPairs(BodyDef body, ThingDef td, Action <ApparelUtility.LayerGroupPair> callback)
 {
     for (int i = 0; i < td.apparel.layers.Count; i++)
     {
         ApparelLayer       layer = td.apparel.layers[i];
         BodyPartGroupDef[] interferingBodyPartGroups = td.apparel.GetInterferingBodyPartGroups(body);
         for (int j = 0; j < interferingBodyPartGroups.Length; j++)
         {
             callback(new ApparelUtility.LayerGroupPair(layer, interferingBodyPartGroups[j]));
         }
     }
 }
コード例 #4
0
        public List <Material> NakedMatsBodyBaseAt(Rot4 facing, RotDrawMode bodyCondition = RotDrawMode.Fresh)
        {
            int num = facing.AsInt + 1000 * (int)bodyCondition;

            if (num != this._cachedNakedMatsBodyBaseHash)
            {
                this._cachedNakedMatsBodyBase.Clear();
                this._cachedNakedMatsBodyBaseHash = num;
                PawnGraphicSet graphics = this.Pawn.Drawer.renderer.graphics;
                if (bodyCondition == RotDrawMode.Fresh)
                {
                    this._cachedNakedMatsBodyBase.Add(graphics.nakedGraphic.MatAt(facing));
                }
                else if (bodyCondition == RotDrawMode.Rotting || graphics.dessicatedGraphic == null)
                {
                    this._cachedNakedMatsBodyBase.Add(graphics.rottingGraphic.MatAt(facing));
                }
                else if (bodyCondition == RotDrawMode.Dessicated)
                {
                    this._cachedNakedMatsBodyBase.Add(graphics.dessicatedGraphic.MatAt(facing));
                }

                for (int i = 0; i < graphics.apparelGraphics.Count; i++)
                {
                    ApparelLayer lastLayer = graphics.apparelGraphics[i].sourceApparel.def.apparel.LastLayer;

                    if (this.Pawn.Dead)
                    {
                        if (lastLayer != ApparelLayer.Shell && lastLayer != ApparelLayer.Overhead)
                        {
                            this._cachedNakedMatsBodyBase.Add(graphics.apparelGraphics[i].graphic.MatAt(facing));
                        }
                    }
                }
            }

            return(this._cachedNakedMatsBodyBase);
        }
コード例 #5
0
        public static int ToPawnLayerIndex(ApparelLayer layer)
        {
            switch (layer)
            {
            case ApparelLayer.OnSkin:
                return(BottomClothingLayer);

            case ApparelLayer.Middle:
                return(MiddleClothingLayer);

            case ApparelLayer.Shell:
                return(TopClothingLayer);

            case ApparelLayer.Overhead:
                return(Hat);

            case ApparelLayer.Accessory:
                return(Accessory);

            default:
                return(-1);
            }
        }
コード例 #6
0
            public bool CoatButNoShirt()
            {
                bool flag  = false;
                bool flag2 = false;

                for (int i = 0; i < this.aps.Count; i++)
                {
                    ThingStuffPair thingStuffPair = this.aps[i];
                    if (thingStuffPair.thing.apparel.bodyPartGroups.Contains(BodyPartGroupDefOf.Torso))
                    {
                        int num = 0;
                        while (true)
                        {
                            int            num2            = num;
                            ThingStuffPair thingStuffPair2 = this.aps[i];
                            if (num2 < thingStuffPair2.thing.apparel.layers.Count)
                            {
                                ThingStuffPair thingStuffPair3 = this.aps[i];
                                ApparelLayer   apparelLayer    = thingStuffPair3.thing.apparel.layers[num];
                                if (apparelLayer == ApparelLayer.OnSkin)
                                {
                                    flag2 = true;
                                }
                                if (apparelLayer == ApparelLayer.Shell || apparelLayer == ApparelLayer.Middle)
                                {
                                    flag = true;
                                }
                                num++;
                                continue;
                            }
                            break;
                        }
                    }
                }
                return(flag && !flag2);
            }
コード例 #7
0
 public LayerGroupPair(ApparelLayer layer, BodyPartGroupDef group)
 {
     this.layer = layer;
     this.group = group;
 }