public static void DoPaneContentsFor(ISelectable sel, Rect rect)
 {
     try
     {
         GUI.BeginGroup(rect);
         float num   = 0f;
         Thing thing = sel as Thing;
         Pawn  pawn  = sel as Pawn;
         if (thing != null)
         {
             num += 3f;
             WidgetRow row = new WidgetRow(0f, num, UIDirection.RightThenUp, 2000f, 29f);
             InspectPaneFiller.DrawHealth(row, thing);
             if (pawn != null)
             {
                 InspectPaneFiller.DrawMood(row, pawn);
                 if (pawn.timetable != null)
                 {
                     InspectPaneFiller.DrawTimetableSetting(row, pawn);
                 }
                 InspectPaneFiller.DrawAreaAllowed(row, pawn);
             }
             num += 18f;
         }
         InspectPaneFiller.DrawInspectStringFor(sel, ref num);
     }
     catch (Exception ex)
     {
         Log.ErrorOnce(string.Concat(new object[]
         {
             "Error in DoPaneContentsFor ",
             Find.Selector.FirstSelectedObject,
             ": ",
             ex.ToString()
         }), 754672);
     }
     finally
     {
         GUI.EndGroup();
     }
 }
示例#2
0
 public override void DoWindowContents(Rect inRect)
 {
     if (this.Anchor == MainTabWindowAnchor.Left)
     {
         this.currentWindowRect.x = 0f;
     }
     else
     {
         this.currentWindowRect.x = (float)Screen.width - this.currentWindowRect.width;
     }
     this.currentWindowRect.y = (float)(Screen.height - 35) - this.currentWindowRect.height;
     if (this.def.concept != null)
     {
         ConceptDatabase.KnowledgeDemonstrated(this.def.concept, KnowledgeAmount.GuiFrame);
     }
     this.RecentHeight = RimWorld.MainTabWindow_Inspect.PaneSize.y;
     if (this.NumSelected > 0)
     {
         try
         {
             Rect rect = inRect.ContractedBy(12f);
             rect.yMin -= 4f;
             GUI.BeginGroup(rect);
             bool flag = true;
             if (this.NumSelected > 1)
             {
                 flag = !(from t in this.Selected
                          where !InspectPaneUtility.CanInspectTogether(this.Selected.First <object>(), t)
                          select t).Any <object>();
             }
             else
             {
                 Rect rect2 = new Rect(rect.width - 30f, 0f, 30f, 30f);
                 if (Find.Selector.SelectedZone == null || Find.Selector.SelectedZone.ContainsCell(MainTabWindow_Inspect.lastSelectCell))
                 {
                     if (Widgets.ImageButton(rect2, TexButton.SelectOverlappingNext))
                     {
                         this.SelectNextInCell();
                     }
                     TooltipHandler.TipRegion(rect2, "SelectNextInSquareTip".Translate(new object[]
                     {
                         KeyBindingDefOf.SelectNextInCell.MainKeyLabel
                     }));
                 }
                 if (Find.Selector.SingleSelectedThing != null)
                 {
                     Widgets.InfoCardButton(rect.width - 60f, 0f, Find.Selector.SingleSelectedThing);
                 }
             }
             Rect   rect3 = new Rect(0f, 0f, rect.width - 60f, 50f);
             string label = InspectPaneUtility.AdjustedLabelFor(this.Selected, rect3);
             rect3.width += 300f;
             Text.Font    = GameFont.Medium;
             Text.Anchor  = TextAnchor.UpperLeft;
             Widgets.Label(rect3, label);
             if (flag && this.NumSelected == 1)
             {
                 Rect rect4 = rect.AtZero();
                 rect4.yMin += 26f;
                 InspectPaneFiller.DoPaneContentsFor((ISelectable)Find.Selector.FirstSelectedObject, rect4);
             }
         }
         catch (Exception ex)
         {
             Log.Error("Exception doing inspect pane: " + ex.ToString());
         }
         finally
         {
             GUI.EndGroup();
         }
     }
 }