Exemplo n.º 1
0
        public static string GetBreastLabel(this Pawn pawn)
        {
            var hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("breast"));

            if (hediff != null)
            {
                return(hediff.LabelBase.CapitalizeFirst() + "\n(" + hediff.LabelInBrackets + ")");
            }
            else
            {
                return("");
            }
        }
        public override IEnumerable <BodyPartRecord> GetPartsToApplyOn(Pawn pawn, RecipeDef recipe)
        {
            if (pawn.gender != Gender.Female)
            {
                yield break;
            }

            BodyPartRecord part = Genital_Helper.get_breastsBPR(pawn);

            if (part != null)
            {
                if (pawn.GetBreastComp() != null)
                {
                    yield return(part);
                }
            }
        }
Exemplo n.º 3
0
        public static HediffComp_Breast GetBreastComp(this Pawn pawn)
        {
            var hedifflist = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn))?.FindAll((Hediff h) => h is Hediff_PartBaseNatural || h is Hediff_PartBaseArtifical);
            HediffComp_Breast result;

            if (hedifflist.NullOrEmpty())
            {
                return(null);
            }
            else
            {
                foreach (Hediff h in hedifflist)
                {
                    result = h.TryGetComp <HediffComp_Breast>();
                    if (result != null)
                    {
                        return(result);
                    }
                }
            }
            return(null);
        }
Exemplo n.º 4
0
        public static void DrawBreastIcon(this Pawn pawn, Rect rect, bool drawOrigin = false)
        {
            var       hediff = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_breastsBPR(pawn)).FirstOrDefault((Hediff h) => h.def.defName.ToLower().Contains("breast"));
            Texture2D breast, nipple, areola;

            if (hediff != null)
            {
                HediffComp_Breast comp = hediff.TryGetComp <HediffComp_Breast>();
                string            icon;
                if (comp != null)
                {
                    icon = comp.Props.BreastTex ?? "Breasts/Breast_Breast";
                }
                else
                {
                    breast = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00", false);

                    nipple = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Nipple00", false);

                    areola = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Areola00", false);

                    GUI.color = pawn.story?.SkinColor ?? Color.white;
                    GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);
                    GUI.color = Color.white;
                    GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
                    GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
                    return;
                }

                if (hediff.Severity < 0.20f)
                {
                    icon += "_Breast00";
                }
                else if (hediff.Severity < 0.40f)
                {
                    icon += "_Breast01";
                }
                else if (hediff.Severity < 0.60f)
                {
                    icon += "_Breast02";
                }
                else if (hediff.Severity < 0.80f)
                {
                    icon += "_Breast03";
                }
                else if (hediff.Severity < 1.00f)
                {
                    icon += "_Breast04";
                }
                else
                {
                    icon += "_Breast05";
                }

                string nippleicon, areolaicon;
                float  nipplesize, areolasize;
                if (drawOrigin)
                {
                    nipplesize = comp.OriginNipple;
                    areolasize = comp.OriginAreola;
                }
                else
                {
                    nipplesize = comp.NippleSize;
                    areolasize = comp.AreolaSize;
                }

                nippleicon = icon + "_Nipple0" + GetNippleIndex(nipplesize);
                areolaicon = icon + "_Areola0" + GetAreolaIndex(areolasize);


                breast = ContentFinder <Texture2D> .Get(icon, false);

                areola = ContentFinder <Texture2D> .Get(areolaicon, false);

                nipple = ContentFinder <Texture2D> .Get(nippleicon, false);

                GUI.color = pawn.story.SkinColor;
                GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);

                if (drawOrigin)
                {
                    GUI.color = comp.OriginColor;
                }
                else
                {
                    GUI.color = comp.NippleColor;
                }
                GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);

                GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);


                if (Configurations.Debug)
                {
                    TooltipHandler.TipRegion(rect, comp.DebugInfo());
                }
            }
            else
            {
                breast = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00", false);

                nipple = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Nipple00", false);

                areola = ContentFinder <Texture2D> .Get("Breasts/Breast_Breast00_Areola00", false);

                GUI.color = pawn.story.SkinColor;
                GUI.DrawTexture(rect, breast, ScaleMode.ScaleToFit);
                GUI.color = Color.white;
                GUI.DrawTexture(rect, areola, ScaleMode.ScaleToFit);
                GUI.DrawTexture(rect, nipple, ScaleMode.ScaleToFit);
            }
        }