Beispiel #1
0
 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, 99999f, 4f);
             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;
         }
         Rect rect2 = rect.AtZero();
         rect2.yMin = num;
         InspectPaneFiller.DrawInspectStringFor(sel, rect2);
     }
     catch (Exception ex)
     {
         Log.ErrorOnce(string.Concat(new object[]
         {
             "Error in DoPaneContentsFor ",
             Find.Selector.FirstSelectedObject,
             ": ",
             ex.ToString()
         }), 754672);
     }
     finally
     {
         GUI.EndGroup();
     }
 }
Beispiel #2
0
        public static void DrawInspectStringFor(ISelectable sel, Rect rect)
        {
            string text;

            try
            {
                text = sel.GetInspectString();
                Thing thing = sel as Thing;
                if (thing != null)
                {
                    string inspectStringLowPriority = thing.GetInspectStringLowPriority();
                    if (!inspectStringLowPriority.NullOrEmpty())
                    {
                        if (!text.NullOrEmpty())
                        {
                            text = text.TrimEndNewlines() + "\n";
                        }
                        text += inspectStringLowPriority;
                    }
                }
            }
            catch (Exception ex)
            {
                text = "GetInspectString exception on " + sel.ToString() + ":\n" + ex.ToString();
                if (!InspectPaneFiller.debug_inspectStringExceptionErrored)
                {
                    Log.Error(text);
                    InspectPaneFiller.debug_inspectStringExceptionErrored = true;
                }
            }
            if (!text.NullOrEmpty() && GenText.ContainsEmptyLines(text))
            {
                Log.ErrorOnce(string.Format("Inspect string for {0} contains empty lines.\n\nSTART\n{1}\nEND", sel, text), 837163521);
            }
            InspectPaneFiller.DrawInspectString(text, rect);
        }
Beispiel #3
0
 public void DoPaneContents(Rect rect)
 {
     InspectPaneFiller.DoPaneContentsFor((ISelectable)Find.Selector.FirstSelectedObject, rect);
 }