Ejemplo n.º 1
0
        public static void UseModifiedGraphicParams(PawnGraphicSet __instance)
        {
            if (__instance.pawn.RaceProps.Humanlike)
            {
                if (HarmonyPatches_BHair.loadedBabiesAndChildren)
                {
                    if (Patch_BabiesAndChildren.BCCompat_IsYoungerThanChild(__instance.pawn))
                    {
                        __instance.hairGraphic = GraphicDatabase.Get <Graphic_Multi>("Things/Pawn/Humanlike/null", ShaderDatabase.Cutout, Vector2.one, Color.white);
                        return;
                    }
                }

                string hairTexturePath = __instance.pawn.story.hairDef.texPath;

                HairColor2_Comp comp       = __instance.pawn.GetComp <HairColor2_Comp>();
                Color           hairColor2 = Color.white;
                if (comp != null)
                {
                    hairColor2 = comp.HairColorTwoExpo.hairColor2;
                }

                if (HarmonyPatches_BHair.loadedGradientHair)
                {
                    Color gradientColor = Compat_GradientHair.GHCompat_TryGetGradientColor(__instance.pawn);
                    hairTexturePath += ":" + gradientColor.a.ToString() + ":" + gradientColor.r.ToString() + ":" + gradientColor.g.ToString() + ":" + gradientColor.b.ToString();
                    hairTexturePath += Compat_GradientHair.GHCompat_TryGetGradientPath(__instance.pawn);
                }

                __instance.hairGraphic = GraphicDatabase.Get <Graphic_Multi_BHair>(hairTexturePath, ShaderDatabase.CutoutComplex, Vector2.one, __instance.pawn.story.hairColor, hairColor2);
            }
        }
        public static void SetHairColor2(Pawn pawn, Color color)
        {
            HairColor2_Comp comp = pawn.GetComp <HairColor2_Comp>();

            if (comp == null)
            {
                return;
            }
            else
            {
                comp.HairColorTwoExpo.hairColor2 = color;
            }
        }
        public static Color GetHairColor2(Pawn pawn)
        {
            HairColor2_Comp comp = pawn.GetComp <HairColor2_Comp>();

            if (comp == null)
            {
                return(Color.white);
            }
            else
            {
                return(comp.HairColorTwoExpo.hairColor2);
            }
        }