Пример #1
0
        protected override void FillTab()
        {
            Rect rect = new Rect(0f, 0f, this.size.x, this.size.y).ContractedBy(20f);
            Pawn pawn = base.SelPawn;

            string str = (pawn.gender == Gender.None ? "PawnSummary" : "PawnSummaryWithGender").Translate(pawn.Named("PAWN"));

            Text.Font = GameFont.Small;
            Widgets.Label(new Rect(15f, 15f, rect.width * 0.9f, 30f), "AG.GeneticsOf".Translate() + ":  " + pawn.Label);
            Text.Font = GameFont.Tiny;
            Widgets.Label(new Rect(15f, 35f, rect.width * 0.9f, 30f), str);
            Text.Font = GameFont.Small;

            float headerY = 55f;
            float curY    = headerY;

            Text.Anchor = TextAnchor.MiddleCenter;

            Rect rectValue = new Rect(rect.x + rect.width * 0.4f, curY, rect.width * 0.2f, 20f);

            Widgets.Label(rectValue, "AG.Value".Translate());
            TooltipHandler.TipRegion(rectValue, "AG.ValueTooltop".Translate());

            curY += 20;

            var stats = Constants.affectedStats.Where((StatDef stat) => stat != AnimalGenetics.GatherYield || Genes.Gatherable(pawn));

            foreach (var stat in stats)
            {
                Rect rect2 = new Rect(rect.x, curY, rect.width, 20f);
                TooltipHandler.TipRegion(rect2, Genes.GetTooltip(stat));
                if (Mouse.IsOver(rect2))
                {
                    GUI.color = new Color(0.5f, 0.5f, 0.5f, 1f);
                    GUI.DrawTexture(rect2, TexUI.HighlightTex);
                    GUI.color = Color.white;
                }

                Text.Anchor = TextAnchor.MiddleLeft;

                Widgets.Label(new Rect(20f, curY, (rect.x + rect.width * 0.4f) - 20f, 20f), Constants.GetLabel(stat));

                Utility.GUI.DrawGeneValueLabel(new Rect(rect.x + rect.width * 0.4f, curY, rect.width * 0.2f, 20f), pawn.AnimalGenetics().GeneRecords[stat].Value);

                curY += 20;
            }

            if (Settings.UI.showBothParentsInPawnTab)
            {
                curY += DrawBothParentData(rect, headerY, pawn);
            }
            else
            {
                curY += DrawSingleParentData(rect, headerY, pawn);
            }

            Text.Anchor = TextAnchor.UpperLeft;
        }
Пример #2
0
        protected override void FillTab()
        {
            Rect rect = new Rect(0f, 0f, this.size.x, this.size.y).ContractedBy(17f);

            rect.yMin += 10f;
            Pawn   pawn = base.SelPawn;
            string str;

            if (pawn.gender != Gender.None)
            {
                str = "PawnSummaryWithGender".Translate(pawn.Named("PAWN"));
            }
            else
            {
                str = "PawnSummary".Translate(pawn.Named("PAWN"));
            }
            Text.Font = GameFont.Small;
            Widgets.Label(new Rect(15f, 15f, rect.width * 0.9f, 30f), "AG.GeneticsOf".Translate() + ":  " + pawn.Label);
            Text.Font = GameFont.Tiny;
            Widgets.Label(new Rect(15f, 35f, rect.width * 0.9f, 30f), str);

            float curY          = 55f;
            var   affectedStats = Constants.affectedStats;

            Text.Anchor = TextAnchor.MiddleCenter;
            Rect rectValue = new Rect(rect.width * 0.6f, curY, rect.width * 0.2f, 20f);

            Widgets.Label(rectValue, "AG.Value".Translate());
            TooltipHandler.TipRegion(rectValue, "AG.ValueTooltop".Translate());
            Rect rectParent = new Rect(rect.width * 0.8f, curY, rect.width * 0.2f, 20f);

            Widgets.Label(rectParent, "AG.Parent".Translate());
            TooltipHandler.TipRegion(rectParent, "AG.ParentTooltop".Translate());
            curY += 21;
            foreach (var stat in affectedStats)
            {
                if (stat != AnimalGenetics.GatherYield || Genes.Gatherable(pawn))
                {
                    curY += DrawRow(rect, curY, Constants.GetLabel(stat), Genes.GetGene(pawn, stat), Genes.GetInheritString(pawn, stat), Genes.GetInheritValue(pawn, stat), Genes.GetTooltip(stat));
                }
            }
        }