Exemplo n.º 1
0
        //public Graphic_RandomApparelMulti RandomGraphic
        //{
        //    get
        //    {
        //        if (this.isRandomizedGraphic)
        //        {
        //            return GraphicDatabase.Get<Graphic_Single>(this.def.graphicData.texPath, ShaderDatabase.CutoutComplex, this.def.graphicData.drawSize, this.DrawColor, this.DrawColorTwo) as Graphic_RandomApparelMulti;
        //        }
        //        return null;
        //    }
        //}

        //public override Graphic Graphic
        //{
        //    get
        //    {
        //        if (this.isRandomizedGraphic)
        //        {
        //            return GraphicDatabase.Get<Graphic_Single>(this.randomGraphicPath, ShaderDatabase.CutoutComplex, this.def.graphicData.drawSize, this.DrawColor, this.DrawColorTwo) as Graphic_RandomApparelMulti;
        //        }
        //        return GraphicDatabase.Get<Graphic_Single>(this.def.graphicData.texPath, ShaderDatabase.CutoutComplex, this.def.graphicData.drawSize, this.DrawColor, this.DrawColorTwo);
        //    }
        //}

        private void SetFactionColor(ref Color color, CompFactionColor compF)
        {
            if (this.Wearer != null)
            {
                if (udef != null)
                {
                    if ((compF != null && compF.CProps.UseCamouflageColor))
                    {
                        color = CamouflageColorsUtility.CamouflageColors[1];
                    }
                    else
                    {
                        color = udef.FactionColor2;
                    }
                }
            }
            else
            {
                CompColorable comp = this.GetComp <CompColorable>();
                if (comp != null && comp.Active)
                {
                    color = comp.Color;
                }
            }
        }
Exemplo n.º 2
0
        public override void PostMake()
        {
            base.PostMake();
            PlayerFactionStoryTracker tracker = FactionColorUtilities.currentPlayerStoryTracker;

            if (tracker != null)
            {
                Col1 = tracker.PlayerColorOne;
                Col2 = tracker.PlayerColorTwo;
                CompFactionColor compF = this.GetComp <CompFactionColor>();
                if (compF == null)
                {
                    Log.Error("Uniform Apparel " + this.ToString() + " is missing a CompFactionColors");
                }
                if ((compF != null && compF.CProps.UseCamouflageColor))
                {
                    Col1 = CamouflageColorsUtility.CamouflageColors[0];
                    Col2 = CamouflageColorsUtility.CamouflageColors[1];
                }
            }
        }
        public static bool TryGetGraphicApparelModded(Apparel apparel, BodyType bodyType, out ApparelGraphicRecord rec)
        {
            if (bodyType == BodyType.Undefined)
            {
                Log.Error("Getting apparel graphic with undefined body type.");
                bodyType = BodyType.Male;
            }
            if (apparel.def.apparel.wornGraphicPath.NullOrEmpty())
            {
                rec = new ApparelGraphicRecord(null, null);
                return(false);
            }
            string path;

            path = apparel.def.apparel.wornGraphicPath;
            CompFactionColor compF = apparel.TryGetComp <CompFactionColor>();

            if (compF != null)
            {
                if (compF.CProps.IsRandomMultiGraphic)
                {
                    path += "/" + compF.randomGraphicPath + "/" + compF.randomGraphicPath;
                }
            }

            if (apparel.def.apparel.LastLayer != ApparelLayer.Overhead)
            {
                path += "_" + bodyType.ToString();
            }

            Graphic graphic = new Graphic();

            graphic = GraphicDatabase.Get <Graphic_Multi>(path, ShaderDatabase.CutoutComplex, apparel.def.graphicData.drawSize, apparel.DrawColor, apparel.DrawColorTwo);
            //       Log.Message(apparel.DrawColor.ToString());
            //       Log.Message(apparel.DrawColorTwo.ToString());
            rec = new ApparelGraphicRecord(graphic, apparel);
            return(true);
        }