コード例 #1
0
        public override void DoWindowContents(Rect inRect)
        {
            Rect rect  = new Rect(0f, 0f, 170f, 28f);
            Rect rect2 = new Rect(170f, 0f, 140f, 28f);

            Widgets.Label(rect, "MedGroupColonist".Translate());
            MedicalCareUtility.MedicalCareSetter(rect2, ref Find.PlaySettings.defaultCareForColonyHumanlike);
            rect.y  += 34f;
            rect2.y += 34f;
            Widgets.Label(rect, "MedGroupImprisonedColonist".Translate());
            MedicalCareUtility.MedicalCareSetter(rect2, ref Find.PlaySettings.defaultCareForColonyPrisoner);
            rect.y  += 34f;
            rect2.y += 34f;
            Widgets.Label(rect, "MedGroupColonyAnimal".Translate());
            MedicalCareUtility.MedicalCareSetter(rect2, ref Find.PlaySettings.defaultCareForColonyAnimal);
            rect.y  += 52f;
            rect2.y += 52f;
            Widgets.Label(rect, "MedGroupNeutralAnimal".Translate());
            MedicalCareUtility.MedicalCareSetter(rect2, ref Find.PlaySettings.defaultCareForNeutralAnimal);
            rect.y  += 34f;
            rect2.y += 34f;
            Widgets.Label(rect, "MedGroupNeutralFaction".Translate());
            MedicalCareUtility.MedicalCareSetter(rect2, ref Find.PlaySettings.defaultCareForNeutralFaction);
            rect.y  += 52f;
            rect2.y += 52f;
            Widgets.Label(rect, "MedGroupHostileFaction".Translate());
            MedicalCareUtility.MedicalCareSetter(rect2, ref Find.PlaySettings.defaultCareForHostileFaction);
        }
コード例 #2
0
        protected override void FillTab()
        {
            PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.PrisonerTab, KnowledgeAmount.FrameDisplayed);
            Text.Font = GameFont.Small;
            Rect rect  = new Rect(0f, 0f, base.size.x, base.size.y);
            Rect rect2 = rect.ContractedBy(10f);

            rect2.yMin += 24f;
            bool             isPrisonerOfColony = base.SelPawn.IsPrisonerOfColony;
            Listing_Standard listing_Standard   = new Listing_Standard();

            listing_Standard.Begin(rect2);
            Rect rect3 = listing_Standard.GetRect(Text.LineHeight);

            rect3.width *= 0.75f;
            bool getsFood = base.SelPawn.guest.GetsFood;

            Widgets.CheckboxLabeled(rect3, "GetsFood".Translate(), ref getsFood, false);
            base.SelPawn.guest.GetsFood = getsFood;
            listing_Standard.Gap(12f);
            Rect rect4 = listing_Standard.GetRect(28f);

            rect4.width = 140f;
            MedicalCareUtility.MedicalCareSetter(rect4, ref base.SelPawn.playerSettings.medCare);
            listing_Standard.Gap(4f);
            if (isPrisonerOfColony)
            {
                listing_Standard.Label("RecruitmentDifficulty".Translate() + ": " + base.SelPawn.RecruitDifficulty(Faction.OfPlayer, false).ToStringPercent(), -1f);
                if (base.SelPawn.guilt.IsGuilty)
                {
                    listing_Standard.Label("ConsideredGuilty".Translate(base.SelPawn.guilt.TicksUntilInnocent.ToStringTicksToPeriod(true, false, true)), -1f);
                }
                if (Prefs.DevMode)
                {
                    listing_Standard.Label("Dev: Prison break MTB days: " + (int)PrisonBreakUtility.InitiatePrisonBreakMtbDays(base.SelPawn), -1f);
                }
                Rect rect5 = listing_Standard.GetRect(200f).Rounded();
                Widgets.DrawMenuSection(rect5);
                Rect position = rect5.ContractedBy(10f);
                GUI.BeginGroup(position);
                Rect rect6 = new Rect(0f, 0f, position.width, 30f);
                foreach (PrisonerInteractionModeDef item in from pim in DefDatabase <PrisonerInteractionModeDef> .AllDefs
                         orderby pim.listOrder
                         select pim)
                {
                    if (Widgets.RadioButtonLabeled(rect6, item.LabelCap, base.SelPawn.guest.interactionMode == item))
                    {
                        base.SelPawn.guest.interactionMode = item;
                        if (item == PrisonerInteractionModeDefOf.Execution && base.SelPawn.MapHeld != null && !this.ColonyHasAnyWardenCapableOfViolence(base.SelPawn.MapHeld))
                        {
                            Messages.Message("MessageCantDoExecutionBecauseNoWardenCapableOfViolence".Translate(), base.SelPawn, MessageTypeDefOf.CautionInput);
                        }
                    }
                    rect6.y += 28f;
                }
                GUI.EndGroup();
            }
            listing_Standard.End();
        }
コード例 #3
0
        protected override void FillTab()
        {
            PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.PrisonerTab, KnowledgeAmount.FrameDisplayed);
            Text.Font = GameFont.Small;
            Rect rect  = new Rect(0f, 0f, this.size.x, this.size.y);
            Rect rect2 = rect.ContractedBy(10f);

            rect2.yMin += 24f;
            bool             isPrisonerOfColony = base.SelPawn.IsPrisonerOfColony;
            Listing_Standard listing_Standard   = new Listing_Standard();

            listing_Standard.maxOneColumn = true;
            listing_Standard.Begin(rect2);
            Rect rect3 = listing_Standard.GetRect(28f);

            rect3.width = 140f;
            MedicalCareUtility.MedicalCareSetter(rect3, ref base.SelPawn.playerSettings.medCare);
            listing_Standard.Gap(4f);
            if (isPrisonerOfColony)
            {
                listing_Standard.Label("RecruitmentDifficulty".Translate() + ": " + base.SelPawn.RecruitDifficulty(Faction.OfPlayer).ToStringPercent(), -1f, null);
                listing_Standard.Label("RecruitmentResistance".Translate() + ": " + base.SelPawn.guest.resistance.ToString("F1"), -1f, null);
                if (base.SelPawn.guilt.IsGuilty)
                {
                    listing_Standard.Label("ConsideredGuilty".Translate(base.SelPawn.guilt.TicksUntilInnocent.ToStringTicksToPeriod()), -1f, null);
                }
                Rect rect4 = listing_Standard.GetRect(160f).Rounded();
                Widgets.DrawMenuSection(rect4);
                Rect position = rect4.ContractedBy(10f);
                GUI.BeginGroup(position);
                Rect rect5 = new Rect(0f, 0f, position.width, 30f);
                foreach (PrisonerInteractionModeDef current in from pim in DefDatabase <PrisonerInteractionModeDef> .AllDefs
                         orderby pim.listOrder
                         select pim)
                {
                    if (Widgets.RadioButtonLabeled(rect5, current.LabelCap, base.SelPawn.guest.interactionMode == current))
                    {
                        base.SelPawn.guest.interactionMode = current;
                        if (current == PrisonerInteractionModeDefOf.Execution && base.SelPawn.MapHeld != null && !this.ColonyHasAnyWardenCapableOfViolence(base.SelPawn.MapHeld))
                        {
                            Messages.Message("MessageCantDoExecutionBecauseNoWardenCapableOfViolence".Translate(), base.SelPawn, MessageTypeDefOf.CautionInput, false);
                        }
                    }
                    rect5.y += 28f;
                }
                GUI.EndGroup();
                if (Prefs.DevMode)
                {
                    listing_Standard.Label("Dev: Prison break MTB days: " + (int)PrisonBreakUtility.InitiatePrisonBreakMtbDays(base.SelPawn), -1f, null);
                }
            }
            listing_Standard.End();
            this.size = new Vector2(280f, listing_Standard.CurHeight + 20f + 24f);
        }
コード例 #4
0
        protected override void FillTab()
        {
            PlayerKnowledgeDatabase.KnowledgeDemonstrated(ConceptDefOf.PrisonerTab, KnowledgeAmount.FrameDisplayed);
            Text.Font = GameFont.Small;
            Rect             rect = new Rect(0f, 0f, size.x, size.y).ContractedBy(10f);
            bool             isPrisonerOfColony = base.SelPawn.IsPrisonerOfColony;
            bool             flag             = base.SelPawn.IsWildMan();
            Listing_Standard listing_Standard = new Listing_Standard();

            listing_Standard.maxOneColumn = true;
            listing_Standard.Begin(rect);
            Rect rect2 = listing_Standard.GetRect(28f);

            rect2.width = 140f;
            MedicalCareUtility.MedicalCareSetter(rect2, ref base.SelPawn.playerSettings.medCare);
            listing_Standard.Gap(4f);
            if (isPrisonerOfColony)
            {
                if (!flag)
                {
                    Rect rect3 = listing_Standard.Label("RecruitmentDifficulty".Translate() + ": " + base.SelPawn.RecruitDifficulty(Faction.OfPlayer).ToStringPercent());
                    if (base.SelPawn.royalty != null)
                    {
                        RoyalTitle title2 = base.SelPawn.royalty.MostSeniorTitle;
                        if (title2 != null && Mouse.IsOver(rect3))
                        {
                            string valueString = title2.def.recruitmentDifficultyOffset.ToStringByStyle(ToStringStyle.PercentOne, ToStringNumberSense.Offset);
                            TooltipHandler.TipRegion(rect3, () => "RecruitmentValueOffsetRoyal".Translate() + " (" + title2.def.GetLabelCapFor(base.SelPawn) + ")" + ": " + valueString, 947584751);
                            Widgets.DrawHighlight(rect3);
                        }
                    }
                    string value  = RecruitUtility.RecruitChanceFactorForRecruitDifficulty(base.SelPawn, Faction.OfPlayer).ToStringPercent();
                    string value2 = RecruitUtility.RecruitChanceFactorForMood(base.SelPawn).ToStringPercent();
                    string text   = base.SelPawn.RecruitChanceFinalByFaction(Faction.OfPlayer).ToStringPercent();
                    Rect   rect4  = listing_Standard.Label("RecruitmentChance".Translate() + ": " + text);
                    if (Mouse.IsOver(rect4))
                    {
                        string recruitmentChanceTooltip = null;
                        recruitmentChanceTooltip = "RecruitmentChanceExplanation".Translate(value, value2, text);
                        if (!base.SelPawn.guest.lastRecruiterName.NullOrEmpty())
                        {
                            recruitmentChanceTooltip += "RecruitmentChanceWithLastRecruiterExplanationPart".Translate().Formatted(value, value2, text, base.SelPawn.guest.lastRecruiterName, base.SelPawn.guest.lastRecruiterNegotiationAbilityFactor.ToStringPercent(), base.SelPawn.guest.lastRecruiterOpinionChanceFactor.ToStringPercent(), base.SelPawn.guest.hasOpinionOfLastRecruiter ? base.SelPawn.guest.lastRecruiterOpinion.ToStringWithSign() : "-", base.SelPawn.guest.lastRecruiterFinalChance.ToStringPercent(), base.SelPawn.guest.lastRecruiterResistanceReduce.ToString("0.0"));
                            if (base.SelPawn.guest.lastRecruiterResistanceReduce > 0f)
                            {
                                recruitmentChanceTooltip += "RecruitmentLastRecruiterResistanceReduceExplanationPart".Translate(base.SelPawn.guest.lastRecruiterResistanceReduce.ToString("0.0"));
                            }
                        }
                        TooltipHandler.TipRegion(rect4, () => recruitmentChanceTooltip, 947584753);
                    }
                    Widgets.DrawHighlightIfMouseover(rect4);
                    Rect rect5 = listing_Standard.Label("RecruitmentResistance".Translate() + ": " + base.SelPawn.guest.resistance.ToString("F1"));
                    if (base.SelPawn.royalty != null)
                    {
                        RoyalTitle title = base.SelPawn.royalty.MostSeniorTitle;
                        if (title != null && Mouse.IsOver(rect5))
                        {
                            TooltipHandler.TipRegion(rect5, delegate
                            {
                                StringBuilder stringBuilder = new StringBuilder();
                                if (title.def.recruitmentResistanceOffset != 1f)
                                {
                                    stringBuilder.AppendLine("RecruitmentValueFactorRoyal".Translate() + " (" + title.def.GetLabelCapFor(base.SelPawn) + ")" + ": " + title.def.recruitmentResistanceFactor.ToStringPercent());
                                }
                                if (title.def.recruitmentResistanceOffset != 0f)
                                {
                                    string t2 = title.def.recruitmentDifficultyOffset.ToStringByStyle(ToStringStyle.FloatMaxOne, ToStringNumberSense.Offset);
                                    stringBuilder.AppendLine("RecruitmentValueOffsetRoyal".Translate() + " (" + title.def.GetLabelCapFor(base.SelPawn) + ")" + ": " + t2);
                                }
                                return(stringBuilder.ToString().TrimEndNewlines());
                            }, 947584755);
                            Widgets.DrawHighlight(rect5);
                        }
                    }
                }
                listing_Standard.Label("SlavePrice".Translate() + ": " + base.SelPawn.GetStatValue(StatDefOf.MarketValue).ToStringMoney());
                TaggedString t;
                if (base.SelPawn.Faction == null || base.SelPawn.Faction.IsPlayer || !base.SelPawn.Faction.CanChangeGoodwillFor(Faction.OfPlayer, 1))
                {
                    t = "None".Translate();
                }
                else
                {
                    bool isHealthy;
                    int  goodwillGainForPrisonerRelease = base.SelPawn.Faction.GetGoodwillGainForPrisonerRelease(base.SelPawn, out isHealthy);
                    t = ((!isHealthy) ? ("None".Translate() + " (" + "UntendedInjury".Translate().ToLower() + ")") : (base.SelPawn.Faction.NameColored + " " + goodwillGainForPrisonerRelease.ToStringWithSign()));
                }
                TooltipHandler.TipRegionByKey(listing_Standard.Label("PrisonerReleasePotentialRelationGains".Translate() + ": " + t), "PrisonerReleaseRelationGainsDesc");
                if (base.SelPawn.guilt.IsGuilty)
                {
                    if (!base.SelPawn.InAggroMentalState)
                    {
                        listing_Standard.Label("ConsideredGuilty".Translate(base.SelPawn.guilt.TicksUntilInnocent.ToStringTicksToPeriod().Colorize(ColoredText.DateTimeColor)));
                    }
                    else
                    {
                        listing_Standard.Label("ConsideredGuiltyNoTimer".Translate() + " (" + base.SelPawn.MentalStateDef.label + ")");
                    }
                }
                int    num   = (int)PrisonBreakUtility.InitiatePrisonBreakMtbDays(base.SelPawn);
                string text2 = "PrisonBreakMTBDays".Translate() + ": ";
                text2 = ((!base.SelPawn.Awake()) ? ((string)(text2 + "NotWhileAsleep".Translate())) : ((num >= 0) ? (text2 + "PeriodDays".Translate(num).ToString().Colorize(ColoredText.DateTimeColor)) : ((string)(text2 + "Never".Translate()))));
                TooltipHandler.TipRegionByKey(listing_Standard.Label(text2), "PrisonBreakMTBDaysDescription");
                Rect rect6 = listing_Standard.GetRect(160f).Rounded();
                Widgets.DrawMenuSection(rect6);
                Rect position = rect6.ContractedBy(10f);
                GUI.BeginGroup(position);
                Rect rect7 = new Rect(0f, 0f, position.width, 30f);
                foreach (PrisonerInteractionModeDef item in DefDatabase <PrisonerInteractionModeDef> .AllDefs.OrderBy((PrisonerInteractionModeDef pim) => pim.listOrder))
                {
                    if (flag && !item.allowOnWildMan)
                    {
                        continue;
                    }
                    if (Widgets.RadioButtonLabeled(rect7, item.LabelCap, base.SelPawn.guest.interactionMode == item))
                    {
                        base.SelPawn.guest.interactionMode = item;
                        if (item == PrisonerInteractionModeDefOf.Execution && base.SelPawn.MapHeld != null && !ColonyHasAnyWardenCapableOfViolence(base.SelPawn.MapHeld))
                        {
                            Messages.Message("MessageCantDoExecutionBecauseNoWardenCapableOfViolence".Translate(), base.SelPawn, MessageTypeDefOf.CautionInput, historical: false);
                        }
                    }
                    rect7.y += 28f;
                }
                GUI.EndGroup();
            }
            listing_Standard.End();
            size = new Vector2(280f, listing_Standard.CurHeight + 10f + 24f);
        }
コード例 #5
0
        private static float DrawOverviewTab(Rect leftRect, Pawn pawn, float curY)
        {
            curY       += 4f;
            Text.Font   = GameFont.Tiny;
            Text.Anchor = TextAnchor.UpperLeft;
            GUI.color   = new Color(0.9f, 0.9f, 0.9f);
            string str  = ((pawn.gender == Gender.None) ? ((string)"PawnSummary".Translate(pawn.Named("PAWN"))) : ((string)"PawnSummaryWithGender".Translate(pawn.Named("PAWN"))));
            Rect   rect = new Rect(0f, curY, leftRect.width, 34f);

            Widgets.Label(rect, str.CapitalizeFirst());
            if (Mouse.IsOver(rect))
            {
                TooltipHandler.TipRegion(rect, () => pawn.ageTracker.AgeTooltipString, 73412);
                Widgets.DrawHighlight(rect);
            }
            GUI.color = Color.white;
            curY     += 34f;
            bool flag = pawn.RaceProps.IsFlesh && (pawn.Faction == Faction.OfPlayer || pawn.HostFaction == Faction.OfPlayer || (pawn.NonHumanlikeOrWildMan() && pawn.InBed() && pawn.CurrentBed().Faction == Faction.OfPlayer));

            if (pawn.foodRestriction != null && pawn.foodRestriction.Configurable)
            {
                Rect rect2 = new Rect(0f, curY, leftRect.width * 0.42f, 23f);
                Text.Anchor = TextAnchor.MiddleLeft;
                Widgets.Label(rect2, "FoodRestriction".Translate());
                GenUI.ResetLabelAlign();
                if (Widgets.ButtonText(new Rect(rect2.width, curY, leftRect.width - rect2.width, 23f), pawn.foodRestriction.CurrentFoodRestriction.label))
                {
                    List <FloatMenuOption> list = new List <FloatMenuOption>();
                    List <FoodRestriction> allFoodRestrictions = Current.Game.foodRestrictionDatabase.AllFoodRestrictions;
                    for (int i = 0; i < allFoodRestrictions.Count; i++)
                    {
                        FoodRestriction localRestriction = allFoodRestrictions[i];
                        list.Add(new FloatMenuOption(localRestriction.label, delegate
                        {
                            pawn.foodRestriction.CurrentFoodRestriction = localRestriction;
                        }));
                    }
                    list.Add(new FloatMenuOption("ManageFoodRestrictions".Translate(), delegate
                    {
                        Find.WindowStack.Add(new Dialog_ManageFoodRestrictions(null));
                    }));
                    Find.WindowStack.Add(new FloatMenu(list));
                }
                curY += 23f;
            }
            if (pawn.IsColonist && !pawn.Dead)
            {
                bool selfTend = pawn.playerSettings.selfTend;
                Rect rect3    = new Rect(0f, curY, leftRect.width, 24f);
                Widgets.CheckboxLabeled(rect3, "SelfTend".Translate(), ref pawn.playerSettings.selfTend);
                if (pawn.playerSettings.selfTend && !selfTend)
                {
                    if (pawn.WorkTypeIsDisabled(WorkTypeDefOf.Doctor))
                    {
                        pawn.playerSettings.selfTend = false;
                        Messages.Message("MessageCannotSelfTendEver".Translate(pawn.LabelShort, pawn), MessageTypeDefOf.RejectInput, historical: false);
                    }
                    else if (pawn.workSettings.GetPriority(WorkTypeDefOf.Doctor) == 0)
                    {
                        Messages.Message("MessageSelfTendUnsatisfied".Translate(pawn.LabelShort, pawn), MessageTypeDefOf.CautionInput, historical: false);
                    }
                }
                if (Mouse.IsOver(rect3))
                {
                    TooltipHandler.TipRegion(rect3, "SelfTendTip".Translate(Faction.OfPlayer.def.pawnsPlural, 0.7f.ToStringPercent()).CapitalizeFirst());
                }
                curY += 28f;
            }
            if (flag && pawn.playerSettings != null && !pawn.Dead && Current.ProgramState == ProgramState.Playing)
            {
                MedicalCareUtility.MedicalCareSetter(new Rect(0f, curY, 140f, 28f), ref pawn.playerSettings.medCare);
                if (Widgets.ButtonText(new Rect(leftRect.width - 70f, curY, 70f, 28f), "MedGroupDefaults".Translate()))
                {
                    Find.WindowStack.Add(new Dialog_MedicalDefaults());
                }
                curY += 32f;
            }
            Text.Font = GameFont.Small;
            if (pawn.def.race.IsFlesh)
            {
                Pair <string, Color> painLabel = GetPainLabel(pawn);
                string painTip = GetPainTip(pawn);
                curY = DrawLeftRow(leftRect, curY, "PainLevel".Translate(), painLabel.First, painLabel.Second, painTip);
            }
            if (!pawn.Dead)
            {
                IEnumerable <PawnCapacityDef> source = (pawn.def.race.Humanlike ? DefDatabase <PawnCapacityDef> .AllDefs.Where((PawnCapacityDef x) => x.showOnHumanlikes) : ((!pawn.def.race.Animal) ? DefDatabase <PawnCapacityDef> .AllDefs.Where((PawnCapacityDef x) => x.showOnMechanoids) : DefDatabase <PawnCapacityDef> .AllDefs.Where((PawnCapacityDef x) => x.showOnAnimals)));
                {
                    foreach (PawnCapacityDef item in source.OrderBy((PawnCapacityDef act) => act.listOrder))
                    {
                        if (PawnCapacityUtility.BodyCanEverDoCapacity(pawn.RaceProps.body, item))
                        {
                            PawnCapacityDef      activityLocal   = item;
                            Pair <string, Color> efficiencyLabel = GetEfficiencyLabel(pawn, item);
                            Func <string>        textGetter      = () => (!pawn.Dead) ? GetPawnCapacityTip(pawn, activityLocal) : "";
                            curY = DrawLeftRow(leftRect, curY, item.GetLabelFor(pawn.RaceProps.IsFlesh, pawn.RaceProps.Humanlike).CapitalizeFirst(), efficiencyLabel.First, efficiencyLabel.Second, new TipSignal(textGetter, pawn.thingIDNumber ^ item.index));
                        }
                    }
                    return(curY);
                }
            }
            return(curY);
        }
コード例 #6
0
        private static float DrawOverviewTab(Rect leftRect, Pawn pawn, float curY)
        {
            curY        = (float)(curY + 4.0);
            Text.Font   = GameFont.Tiny;
            Text.Anchor = TextAnchor.UpperLeft;
            GUI.color   = new Color(0.9f, 0.9f, 0.9f);
            string str = string.Empty;

            if (pawn.gender != 0)
            {
                str = pawn.gender.GetLabel() + " ";
            }
            str = str + pawn.def.label + ", " + "AgeIndicator".Translate(pawn.ageTracker.AgeNumberString);
            Rect rect = new Rect(0f, curY, leftRect.width, 34f);

            Widgets.Label(rect, str.CapitalizeFirst());
            TooltipHandler.TipRegion(rect, () => pawn.ageTracker.AgeTooltipString, 73412);
            if (Mouse.IsOver(rect))
            {
                Widgets.DrawHighlight(rect);
            }
            GUI.color = Color.white;
            curY      = (float)(curY + 34.0);
            GUI.color = Color.white;
            if (pawn.IsColonist && !pawn.Dead)
            {
                bool selfTend = pawn.playerSettings.selfTend;
                Rect rect2    = new Rect(0f, curY, leftRect.width, 24f);
                Widgets.CheckboxLabeled(rect2, "SelfTend".Translate(), ref pawn.playerSettings.selfTend, false);
                if (pawn.playerSettings.selfTend && !selfTend)
                {
                    if (pawn.story.WorkTypeIsDisabled(WorkTypeDefOf.Doctor))
                    {
                        pawn.playerSettings.selfTend = false;
                        Messages.Message("MessageCannotSelfTendEver".Translate(pawn.LabelShort), MessageTypeDefOf.RejectInput);
                    }
                    else if (pawn.workSettings.GetPriority(WorkTypeDefOf.Doctor) == 0)
                    {
                        Messages.Message("MessageSelfTendUnsatisfied".Translate(pawn.LabelShort), MessageTypeDefOf.CautionInput);
                    }
                }
                TooltipHandler.TipRegion(rect2, "SelfTendTip".Translate(Faction.OfPlayer.def.pawnsPlural, 0.7f.ToStringPercent()).CapitalizeFirst());
                curY = (float)(curY + 28.0);
            }
            if (pawn.playerSettings != null && !pawn.Dead && Current.ProgramState == ProgramState.Playing)
            {
                Rect rect3 = new Rect(0f, curY, 140f, 28f);
                MedicalCareUtility.MedicalCareSetter(rect3, ref pawn.playerSettings.medCare);
                if (Widgets.ButtonText(new Rect((float)(leftRect.width - 70.0), curY, 70f, 28f), "MedGroupDefaults".Translate(), true, false, true))
                {
                    Find.WindowStack.Add(new Dialog_MedicalDefaults());
                }
                curY = (float)(curY + 32.0);
            }
            Text.Font = GameFont.Small;
            if (pawn.def.race.IsFlesh)
            {
                Pair <string, Color> painLabel = HealthCardUtility.GetPainLabel(pawn);
                string painTip = HealthCardUtility.GetPainTip(pawn);
                curY = HealthCardUtility.DrawLeftRow(leftRect, curY, "PainLevel".Translate(), painLabel.First, painLabel.Second, painTip);
            }
            if (!pawn.Dead)
            {
                IEnumerable <PawnCapacityDef> source = (!pawn.def.race.Humanlike) ? ((!pawn.def.race.Animal) ? (from x in DefDatabase <PawnCapacityDef> .AllDefs
                                                                                                                where x.showOnMechanoids
                                                                                                                select x) : DefDatabase <PawnCapacityDef> .AllDefs.Where((PawnCapacityDef x) => x.showOnAnimals)) : (from x in DefDatabase <PawnCapacityDef> .AllDefs
                                                                                                                                                                                                                     where x.showOnHumanlikes
                                                                                                                                                                                                                     select x);
                {
                    foreach (PawnCapacityDef item in from act in source
                             orderby act.listOrder
                             select act)
                    {
                        if (PawnCapacityUtility.BodyCanEverDoCapacity(pawn.RaceProps.body, item))
                        {
                            PawnCapacityDef      activityLocal   = item;
                            Pair <string, Color> efficiencyLabel = HealthCardUtility.GetEfficiencyLabel(pawn, item);
                            Func <string>        textGetter      = () => (!pawn.Dead) ? HealthCardUtility.GetPawnCapacityTip(pawn, activityLocal) : string.Empty;
                            curY = HealthCardUtility.DrawLeftRow(leftRect, curY, item.GetLabelFor(pawn.RaceProps.IsFlesh, pawn.RaceProps.Humanlike).CapitalizeFirst(), efficiencyLabel.First, efficiencyLabel.Second, new TipSignal(textGetter, pawn.thingIDNumber ^ item.index));
                        }
                    }
                    return(curY);
                }
            }
            return(curY);
        }
コード例 #7
0
 public override void DoCell(Rect rect, Pawn pawn, PawnTable table)
 {
     MedicalCareUtility.MedicalCareSelectButton(rect, pawn);
 }