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); }