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); } } }
protected override void FillTab() { if (this.rightClicked != null && this.infoFloatMenu != null && Find.WindowStack.Top() != this.infoFloatMenu) { this.rightClicked = null; this.infoFloatMenu = null; } Text.Font = GameFont.Small; IPlantToGrowSettable plantToGrowSettable = (IPlantToGrowSettable)Find.Selector.SelectedObjects.First <object>(); Rect position = new Rect(ITab_Growing_Alternate.PaddingSize.x, ITab_Growing_Alternate.PaddingSize.y, ITab_Growing_Alternate.ContentSize.x, ITab_Growing_Alternate.ContentSize.y); GUI.BeginGroup(position); Rect viewRect = new Rect(0f, 0f, position.width, position.height); this.scrollView.Begin(viewRect); float num = 0f; int num2 = 0; foreach (ThingDef current in GenPlant.ValidPlantTypesForGrower(Find.Selector.SingleSelectedObject)) { float num3 = Text.CalcHeight(current.LabelCap, ITab_Growing_Alternate.ContentSize.x - 32f); if (num3 < 30f) { num3 = 30f; } GUI.color = Color.white; Rect rect = new Rect(0f, num + 1f, ITab_Growing_Alternate.ContentSize.x - 28f, num3); Rect position2 = new Rect(0f, rect.y - 1f, rect.width, rect.height + 2f); Vector2 mousePosition = Event.current.mousePosition; if (position2.Contains(mousePosition) && mousePosition.y > this.scrollView.Position.y && mousePosition.y < this.scrollView.Position.y + this.scrollView.ViewHeight) { GUI.DrawTexture(position2, TexUI.HighlightTex); } else if (num2 % 2 == 0) { GUI.DrawTexture(position2, TabDrawer.AlternateRowTexture); } rect.x += 6f; rect.y += 3f; rect.width -= 4f; Widgets.InfoCardButton(rect.x, rect.y, current); rect.x += 34f; rect.width -= 34f; if ((Widgets.InvisibleButton(new Rect(rect.x, rect.y, rect.width - 36f, rect.height)) || WidgetDrawer.DrawLabeledRadioButton(rect, current.LabelCap, current == plantToGrowSettable.GetPlantDefToGrow(), false)) && plantToGrowSettable.GetPlantDefToGrow() != current) { plantToGrowSettable.SetPlantDefToGrow(current); SoundDefOf.RadioButtonClicked.PlayOneShotOnCamera(); ConceptDatabase.KnowledgeDemonstrated(ConceptDefOf.SetGrowingZonePlant, KnowledgeAmount.Total); } num += num3; num += 2f; num2++; } this.scrollView.End(num); TutorUIHighlighter.HighlightOpportunity("GrowingZoneSetPlant", new Rect(0f, 0f, ITab_Growing_Alternate.ContentSize.x, num)); GUI.EndGroup(); }