示例#1
0
        protected override void FillTab()
        {
            Rect position = new Rect(0f, 0f, this.size.x, this.size.y).ContractedBy(1f);

            try
            {
                GUI.BeginGroup(position);
                Rect  rect = new Rect(0f, 0f, position.width / 2f, this.size.y);
                float num  = this.DoNeeds(rect);
                num += 10f;
                if (base.SelPawn.needs.mood != null)
                {
                    Rect rect2 = new Rect(0f, num, position.width, position.height - num);
                    this.DoMoodAndThoughts(rect2);
                }
            }
            finally
            {
                GUI.EndGroup();
                GUI.color = Color.white;
            }
            if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
            {
                Pawn selPawn = base.SelPawn;
                if (selPawn != null)
                {
                    BrowseButtonDrawer.DrawBrowseButtons(this.size, selPawn);
                }
            }
        }
        protected override void FillTab()
        {
            ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.PrisonerTab, KnowledgeAmount.GuiFrame);
            Text.Font = GameFont.Small;
            Rect position           = new Rect(0f, 0f, this.size.x, this.size.y).ContractedBy(20f);
            bool isPrisonerOfColony = base.SelPawn.IsPrisonerOfColony;

            try
            {
                GUI.BeginGroup(position);
                float num  = 10f;
                Rect  rect = new Rect(10f, num, position.width - 20f, 32f);
                MedicalCareUtility.MedicalCareSetter(rect, ref base.SelPawn.playerSettings.medCare);
                num += 32f;
                num += 18f;
                Rect rect2    = new Rect(10f, num, position.width - 28f, position.height - num);
                bool getsFood = base.SelPawn.guest.GetsFood;
                num += WidgetDrawer.DrawLabeledCheckbox(rect2, "GetsFood".Translate(), ref getsFood);
                base.SelPawn.guest.GetsFood = getsFood;
                if (isPrisonerOfColony)
                {
                    num += 6f;
                    int   length = Enum.GetValues(typeof(PrisonerInteractionMode)).Length;
                    float height = (float)(length * 28 + 20);
                    Rect  rect3  = new Rect(0f, num, position.width, height);
                    TabDrawer.DrawBox(rect3);
                    Rect rect4 = rect3.ContractedBy(10f);
                    rect4.height = 28f;
                    IEnumerator enumerator = Enum.GetValues(typeof(PrisonerInteractionMode)).GetEnumerator();
                    while (enumerator.MoveNext())
                    {
                        PrisonerInteractionMode prisonerInteractionMode = (PrisonerInteractionMode)((byte)enumerator.Current);
                        if (WidgetDrawer.DrawLabeledRadioButton(rect4, prisonerInteractionMode.GetLabel(), base.SelPawn.guest.interactionMode == prisonerInteractionMode, true))
                        {
                            base.SelPawn.guest.interactionMode = prisonerInteractionMode;
                        }
                        rect4.y += 28f;
                    }
                    Rect rect5 = new Rect(rect3.x, rect3.y + rect3.height + 5f, rect3.width - 4f, 28f);
                    Text.Anchor = TextAnchor.UpperRight;
                    Widgets.Label(rect5, "RecruitmentDifficulty".Translate() + ": " + base.SelPawn.guest.RecruitDifficulty.ToString("##0"));
                    Text.Anchor = TextAnchor.UpperLeft;
                }
            }
            finally
            {
                GUI.EndGroup();
                GUI.color   = Color.white;
                Text.Anchor = TextAnchor.UpperLeft;
            }
            if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
            {
                Pawn selPawn = base.SelPawn;
                if (selPawn != null)
                {
                    BrowseButtonDrawer.DrawBrowseButtons(this.size, selPawn);
                }
            }
        }
示例#3
0
 public void ResetTextures()
 {
     BrowseButtonDrawer.ResetTextures();
     ITab_Pawn_Health_Alternate.ResetTextures();
     MedicalCareUtility.Reset();
     BillDrawer.ResetTextures();
     TabDrawer.ResetTextures();
 }
        public static void DrawBrowseButtons(Vector2 tabSize, Pawn currentPawn)
        {
            float num     = 14f;
            float padding = 30f;
            float num2    = BrowseButtonDrawer.ButtonSize.y + num * 2f;

            BrowseButtonDrawer.DrawBrowseButtons(tabSize.y - num2 + num, tabSize.x, padding, currentPawn);
        }
示例#5
0
 protected override void FillTab()
 {
     base.FillTab();
     if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
     {
         Pawn selPawn = base.SelPawn;
         if (selPawn != null)
         {
             BrowseButtonDrawer.DrawBrowseButtons(this.size, selPawn);
         }
     }
 }
示例#6
0
 protected override void FillTab()
 {
     base.FillTab();
     if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
     {
         Pawn pawnToShowInfoAbout = this.PawnToShowInfoAbout;
         if (pawnToShowInfoAbout != null)
         {
             BrowseButtonDrawer.DrawBrowseButtons(this.size, pawnToShowInfoAbout);
         }
     }
 }
示例#7
0
        protected override void FillTab()
        {
            Rect rect = new Rect(0f, 0f, this.size.x, this.size.y).ContractedBy(20f);

            TrainingCardUtility.DrawTrainingCard(rect, base.SelPawn);
            if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
            {
                Pawn selPawn = base.SelPawn;
                if (selPawn != null)
                {
                    BrowseButtonDrawer.DrawBrowseButtons(this.size, selPawn);
                }
            }
        }
 protected override void FillTab()
 {
     base.FillTab();
     if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
     {
         Pawn pawn = null;
         if (base.SelPawn != null)
         {
             pawn = base.SelPawn;
         }
         else
         {
             Corpse corpse = base.SelThing as Corpse;
             if (corpse != null)
             {
                 pawn = corpse.innerPawn;
             }
         }
         if (pawn != null)
         {
             BrowseButtonDrawer.DrawBrowseButtons(this.size, pawn);
         }
     }
 }
示例#9
0
        protected override void FillTab()
        {
            Pawn pawnToShowInfoAbout = this.PawnToShowInfoAbout;

            try
            {
                GUI.BeginGroup(new Rect(ITab_Pawn_Character_Alternate.PaddingSize.x, ITab_Pawn_Character_Alternate.PaddingSize.y, ITab_Pawn_Character_Alternate.ContentSize.x, ITab_Pawn_Character_Alternate.ContentSize.y));
                float num         = 0f;
                float num2        = 12f;
                bool  allowRename = !pawnToShowInfoAbout.Dead && !pawnToShowInfoAbout.Destroyed;
                num      += TabDrawer.DrawNameAndBasicInfo(0f, num, this.PawnToShowInfoAbout, ITab_Pawn_Character_Alternate.ContentSize.x, allowRename);
                num      += num2;
                num      += TabDrawer.DrawHeader(0f, num, ITab_Pawn_Character_Alternate.ContentSize.x, "Backstory".Translate(), true, TextAnchor.UpperLeft);
                num      += 2f;
                Text.Font = GameFont.Small;
                GUI.color = TabDrawer.TextColor;
                Vector2     vector     = new Vector2(ITab_Pawn_Character_Alternate.ContentSize.x, 24f);
                Vector2     vector2    = new Vector2(90f, 24f);
                Vector2     vector3    = new Vector2(3f, 2f);
                int         num3       = 0;
                IEnumerator enumerator = Enum.GetValues(typeof(BackstorySlot)).GetEnumerator();
                try
                {
                    while (enumerator.MoveNext())
                    {
                        BackstorySlot backstorySlot = (BackstorySlot)enumerator.Current;
                        Rect          rect          = new Rect(0f, num, vector.x, vector.y);
                        if (rect.Contains(Event.current.mousePosition))
                        {
                            Widgets.DrawHighlight(rect);
                        }
                        TooltipHandler.TipRegion(rect, pawnToShowInfoAbout.story.GetBackstory(backstorySlot).FullDescriptionFor(pawnToShowInfoAbout));
                        rect.x     += vector3.x;
                        rect.width -= vector3.x * 2f;
                        rect.y     += vector3.y;
                        GUI.skin.label.alignment = TextAnchor.MiddleLeft;
                        string str = (backstorySlot == BackstorySlot.Adulthood) ? "Adulthood".Translate() : "Childhood".Translate();
                        Widgets.Label(rect, str + ":");
                        GUI.skin.label.alignment = TextAnchor.UpperLeft;
                        Rect   rect2 = new Rect(rect.x + vector2.x, rect.y, vector.x - vector2.x, vector.y);
                        string title = pawnToShowInfoAbout.story.GetBackstory(backstorySlot).title;
                        Widgets.Label(rect2, title);
                        num += vector.y + 2f;
                        num3++;
                    }
                }
                finally
                {
                    IDisposable disposable;
                    if ((disposable = (enumerator as IDisposable)) != null)
                    {
                        disposable.Dispose();
                    }
                }
                num -= 6f;
                num += num2;
                num += TabDrawer.DrawHeader(0f, num, ITab_Pawn_Character_Alternate.ContentSize.x, "Skills".Translate(), true, TextAnchor.UpperLeft);
                num += 6f;
                float height = (float)DefDatabase <SkillDef> .AllDefs.Count <SkillDef>() * 24f;

                Rect position = new Rect(0f, num, 390f, height);
                GUI.color = TabDrawer.TextColor;
                GUI.BeginGroup(position);
                this.skillDrawer.DrawSkillsOf(pawnToShowInfoAbout, new Vector2(0f, 0f));
                GUI.EndGroup();
                num += position.height;
                num += num2;
                float num4 = num;
                float num5 = ITab_Pawn_Character_Alternate.ContentSize.x * 0.4f - ITab_Pawn_Character_Alternate.PaddingSize.x / 2f;
                float num6 = ITab_Pawn_Character_Alternate.ContentSize.x * 0.6f - ITab_Pawn_Character_Alternate.PaddingSize.x / 2f;
                float left = num5 + ITab_Pawn_Character_Alternate.PaddingSize.x;
                num += TabDrawer.DrawHeader(0f, num, num5, "IncapableOf".Translate(), true, TextAnchor.UpperLeft);
                num += 4f;
                Vector2 vector4 = new Vector2(num5, 22f);
                Text.Font = GameFont.Small;
                GUI.color = TabDrawer.TextColor;
                List <WorkTags> list = pawnToShowInfoAbout.story.DisabledWorkTags.ToList <WorkTags>();
                GUI.skin.label.alignment = TextAnchor.UpperLeft;
                if (list.Count == 0)
                {
                    Rect rect3 = new Rect(0f, num, num5, vector4.y);
                    GUI.color = TabDrawer.SeparatorColor;
                    Widgets.Label(rect3, "NoneLower".Translate());
                    GUI.color = TabDrawer.TextColor;
                    num      += rect3.height - 1f;
                }
                else
                {
                    foreach (WorkTags current in list)
                    {
                        Rect rect4 = new Rect(0f, num, num5, vector4.y);
                        Widgets.Label(rect4, current.LabelTranslated());
                        num += vector4.y - 1f;
                    }
                }
                num  = num4;
                num += TabDrawer.DrawHeader(left, num, num6, "Traits".Translate(), true, TextAnchor.UpperLeft);
                num += 4f;
                Vector2 vector5 = new Vector2(num6, 22f);
                Text.Font = GameFont.Small;
                GUI.color = TabDrawer.TextColor;
                float num7 = 0f;
                foreach (Trait current2 in pawnToShowInfoAbout.story.traits.allTraits)
                {
                    num7 += vector5.y + 2f;
                    Rect rect5 = new Rect(left, num, num6, vector5.y);
                    if (rect5.Contains(Event.current.mousePosition))
                    {
                        Widgets.DrawHighlight(rect5);
                    }
                    rect5.x += 2f;
                    Widgets.Label(rect5, current2.LabelCap);
                    TooltipHandler.TipRegion(rect5, current2.TipString(pawnToShowInfoAbout));
                    num += vector5.y - 1f;
                }
            }
            finally
            {
                GUI.EndGroup();
            }
            if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value && pawnToShowInfoAbout != null)
            {
                BrowseButtonDrawer.DrawBrowseButtons(this.size, pawnToShowInfoAbout);
            }
            GUI.color = Color.white;
        }
        protected override void FillTab()
        {
            Pawn pawn = null;

            if (base.SelPawn != null)
            {
                pawn = base.SelPawn;
            }
            else
            {
                Corpse corpse = base.SelThing as Corpse;
                if (corpse != null)
                {
                    pawn = corpse.innerPawn;
                }
            }
            if (pawn == null)
            {
                Log.Error("Health tab found no selected pawn to display.");
                return;
            }
            Corpse     corpse2       = base.SelThing as Corpse;
            bool       showBloodLoss = corpse2 == null || corpse2.Age < 60000;
            bool       flag          = !pawn.RaceProps.Humanlike && pawn.Downed;
            bool       flag2         = base.SelThing.def.AllRecipes.Any <RecipeDef>();
            bool       flag3         = flag2 && !pawn.Dead && (pawn.IsColonist || pawn.IsPrisonerOfColony || flag);
            TextAnchor anchor        = Text.Anchor;
            Rect       rect          = new Rect(20f, 51f, ITab_Pawn_Health_Alternate.PanelSize.x - 40f, 345f);
            float      height        = this.size.y - rect.height - 109f;
            Rect       position      = new Rect(rect.x, rect.y + rect.height + 16f, rect.width, height);

            if (!flag3)
            {
                this.operationsTabSelected = false;
            }
            List <TabRecord> list = new List <TabRecord>();

            list.Add(new TabRecord("HealthOverview".Translate(), delegate
            {
                this.operationsTabSelected = false;
            }, !this.operationsTabSelected));
            if (flag3)
            {
                string label;
                if (pawn.RaceProps.mechanoid)
                {
                    label = "MedicalOperationsMechanoidsShort".Translate(new object[]
                    {
                        pawn.BillStack.Count
                    });
                }
                else
                {
                    label = "MedicalOperationsShort".Translate(new object[]
                    {
                        pawn.BillStack.Count
                    });
                }
                list.Add(new TabRecord(label, delegate
                {
                    this.operationsTabSelected = true;
                }, this.operationsTabSelected));
            }
            GUI.color = TabDrawer.BoxColor;
            GUI.DrawTexture(rect, TabDrawer.WhiteTexture);
            GUI.color = TabDrawer.BoxBorderColor;
            Widgets.DrawBox(rect, 1);
            GUI.color = Color.white;
            TabDrawer.DrawTabs(new Rect(rect.x, rect.y, rect.width - 90f, rect.height), list, ITab_Pawn_Health_Alternate.TabAtlasTex);
            float num = 0f;

            GUI.color   = Color.white;
            Text.Anchor = TextAnchor.UpperLeft;
            if (!this.operationsTabSelected)
            {
                Rect position2 = rect.ContractedBy(12f);
                if (pawn.playerSettings != null && !pawn.Dead)
                {
                    Rect rect2 = new Rect(position2.x + 4f, position2.y + 8f, position2.width, 32f);
                    MedicalCareUtility.MedicalCareSetter(rect2, ref pawn.playerSettings.medCare);
                    position2.y      += 50f;
                    position2.height -= 50f;
                }
                try
                {
                    GUI.BeginGroup(position2);
                    Rect leftRect = new Rect(0f, num, position2.width, position2.height - num);
                    num = this.healthCardUtility.DrawStatus(leftRect, pawn, num, showBloodLoss);
                }
                finally
                {
                    GUI.EndGroup();
                }
            }
            else
            {
                Rect position3 = rect.ContractedBy(12f);
                try
                {
                    GUI.BeginGroup(position3);
                    Rect rect3 = new Rect(0f, 0f, position3.width, position3.height);
                    this.operationsScrollView.Begin(rect3);
                    ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.MedicalOperations, KnowledgeAmount.GuiFrame);
                    num = this.healthCardUtility.DrawMedOperationsTab(rect3, pawn, base.SelThing, num);
                    this.operationsScrollView.End(num);
                }
                finally
                {
                    GUI.EndGroup();
                }
            }
            Text.Font   = GameFont.Small;
            GUI.color   = Color.white;
            Text.Anchor = TextAnchor.UpperLeft;
            GUI.BeginGroup(position);
            Rect leftRect2 = new Rect(0f, 0f, position.width, position.height);

            this.healthCardUtility.DrawInjuries(leftRect2, pawn, showBloodLoss);
            GUI.EndGroup();
            GUI.color   = Color.white;
            Text.Anchor = TextAnchor.UpperLeft;
            if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
            {
                Pawn pawn2 = null;
                if (base.SelPawn != null)
                {
                    pawn2 = base.SelPawn;
                }
                else
                {
                    Corpse corpse3 = base.SelThing as Corpse;
                    if (corpse3 != null)
                    {
                        pawn2 = corpse3.innerPawn;
                    }
                }
                if (pawn2 != null)
                {
                    BrowseButtonDrawer.DrawBrowseButtons(this.size, pawn2);
                }
            }
            GUI.color   = Color.white;
            Text.Anchor = anchor;
            Rect rect4 = new Rect(0f, 0f, this.size.x, this.size.y);

            if (Event.current.type == EventType.ScrollWheel && Mouse.IsOver(rect4))
            {
                Event.current.Use();
            }
        }
示例#11
0
        protected override void FillTab()
        {
            Text.Font = GameFont.Small;
            Rect rect     = new Rect(0f, 8f, this.size.x, this.size.y - 8f);
            Rect rect2    = rect.ContractedBy(24f);
            Rect position = new Rect(rect2.x, rect2.y, rect2.width, rect2.height - 24f);

            try
            {
                GUI.BeginGroup(position);
                Text.Font = GameFont.Small;
                GUI.color = Color.white;
                Rect outRect  = new Rect(0f, 0f, position.width, position.height);
                Rect viewRect = new Rect(0f, 0f, position.width - 16f, this.scrollViewHeight);
                Widgets.BeginScrollView(outRect, ref this.scrollPosition, viewRect);
                float num  = 0f;
                bool  flag = false;
                if (this.SelPawnForGear.equipment != null)
                {
                    num += TabDrawer.DrawHeader(0f, num, viewRect.width, "Equipment".Translate(), true, TextAnchor.UpperLeft);
                    foreach (ThingWithComps current in this.SelPawnForGear.equipment.AllEquipment)
                    {
                        this.DrawThingRow(ref num, viewRect.width, current);
                        flag = true;
                    }
                    if (!flag)
                    {
                        num += 4f;
                        Rect rect3 = new Rect(0f, num, viewRect.width, 24f);
                        GUI.color = TabDrawer.SeparatorColor;
                        Widgets.Label(rect3, "NoneLower".Translate());
                        GUI.color = TabDrawer.TextColor;
                        num      += ITab_Pawn_Gear_Alternate.LineHeight;
                    }
                }
                flag = false;
                if (this.SelPawnForGear.apparel != null)
                {
                    num += 10f;
                    num += TabDrawer.DrawHeader(0f, num, viewRect.width, "Apparel".Translate(), true, TextAnchor.UpperLeft);
                    num += 4f;
                    foreach (Apparel current2 in from ap in this.SelPawnForGear.apparel.WornApparel
                             orderby ap.def.apparel.bodyPartGroups[0].listOrder descending
                             select ap)
                    {
                        this.DrawThingRow(ref num, viewRect.width, current2);
                        flag = true;
                    }
                    if (!flag)
                    {
                        num += 4f;
                        Rect rect4 = new Rect(0f, num, viewRect.width, 24f);
                        GUI.color = TabDrawer.SeparatorColor;
                        Widgets.Label(rect4, "NoneLower".Translate());
                        GUI.color = TabDrawer.TextColor;
                        num      += ITab_Pawn_Gear_Alternate.LineHeight;
                    }
                }
                flag = false;
                if (this.SelPawnForGear.inventory != null)
                {
                    num += 10f;
                    num += TabDrawer.DrawHeader(0f, num, viewRect.width, "Inventory".Translate(), true, TextAnchor.UpperLeft);
                    foreach (Thing current3 in this.SelPawnForGear.inventory.container)
                    {
                        this.DrawThingRow(ref num, viewRect.width, current3);
                        flag = true;
                    }
                    if (!flag)
                    {
                        num += 4f;
                        Rect rect5 = new Rect(0f, num, viewRect.width, 24f);
                        GUI.color = TabDrawer.SeparatorColor;
                        Widgets.Label(rect5, "NoneLower".Translate());
                        GUI.color = TabDrawer.TextColor;
                        num      += ITab_Pawn_Gear_Alternate.LineHeight;
                    }
                }
                if (Event.current.type == EventType.Layout)
                {
                    this.scrollViewHeight = num + 8f;
                }
                Widgets.EndScrollView();
            }
            finally
            {
                GUI.EndGroup();
            }
            if (this.PreferenceTabBrowseButtons != null && this.PreferenceTabBrowseButtons.Value)
            {
                Pawn selPawnForGear = this.SelPawnForGear;
                if (selPawnForGear != null)
                {
                    BrowseButtonDrawer.DrawBrowseButtons(this.size, selPawnForGear);
                }
            }
            GUI.color   = Color.white;
            Text.Anchor = TextAnchor.UpperLeft;
        }