Esempio n. 1
0
        public override void DoWindowContents(Rect inRect)
        {
            Text.Font = GameFont.Tiny;
            WidgetRow widgetRow = new WidgetRow(0f, 0f, UIDirection.RightThenUp, 99999f, 4f);

            if (widgetRow.ButtonText("Clear", "Clear all log messages.", true, false))
            {
                Log.Clear();
                EditWindow_Log.ClearAll();
            }
            if (widgetRow.ButtonText("Trace big", "Set the stack trace to be large on screen.", true, false))
            {
                EditWindow_Log.detailsPaneHeight = 700f;
            }
            if (widgetRow.ButtonText("Trace medium", "Set the stack trace to be medium-sized on screen.", true, false))
            {
                EditWindow_Log.detailsPaneHeight = 300f;
            }
            if (widgetRow.ButtonText("Trace small", "Set the stack trace to be small on screen.", true, false))
            {
                EditWindow_Log.detailsPaneHeight = 100f;
            }
            if (EditWindow_Log.canAutoOpen)
            {
                if (widgetRow.ButtonText("Auto-open is ON", string.Empty, true, false))
                {
                    EditWindow_Log.canAutoOpen = false;
                }
            }
            else if (widgetRow.ButtonText("Auto-open is OFF", string.Empty, true, false))
            {
                EditWindow_Log.canAutoOpen = true;
            }
            if (widgetRow.ButtonText("Copy to clipboard", "Copy all messages to the clipboard.", true, false))
            {
                this.CopyAllMessagesToClipboard();
            }
            Text.Font = GameFont.Small;
            Rect rect = new Rect(inRect);

            rect.yMin += 26f;
            rect.yMax  = inRect.height;
            if (EditWindow_Log.selectedMessage != null)
            {
                rect.yMax -= EditWindow_Log.detailsPaneHeight;
            }
            Rect detailsRect = new Rect(inRect);

            detailsRect.yMin = rect.yMax;
            this.DoMessagesListing(rect);
            this.DoMessageDetails(detailsRect, inRect);
            if (Event.current.type == EventType.MouseDown && Event.current.button == 0 && Mouse.IsOver(rect))
            {
                EditWindow_Log.ClearSelectedMessage();
            }
            EditWindow_Log.detailsPaneHeight = Mathf.Max(EditWindow_Log.detailsPaneHeight, 10f);
            EditWindow_Log.detailsPaneHeight = Mathf.Min(EditWindow_Log.detailsPaneHeight, inRect.height - 80f);
        }
Esempio n. 2
0
 public static void SelectLastMessage(bool expandDetailsPane = false)
 {
     EditWindow_Log.ClearSelectedMessage();
     EditWindow_Log.SelectedMessage          = Log.Messages.LastOrDefault <LogMessage>();
     EditWindow_Log.messagesScrollPosition.y = (float)Log.Messages.Count <LogMessage>() * 30f;
     if (expandDetailsPane)
     {
         EditWindow_Log.detailsPaneHeight = 9999f;
     }
 }
Esempio n. 3
0
        private void DoMessagesListing(Rect listingRect)
        {
            Rect viewRect = new Rect(0f, 0f, listingRect.width - 16f, this.listingViewHeight + 100f);

            Widgets.BeginScrollView(listingRect, ref EditWindow_Log.messagesScrollPosition, viewRect, true);
            float width = viewRect.width - 28f;

            Text.Font = GameFont.Tiny;
            float num  = 0f;
            bool  flag = false;

            foreach (LogMessage current in Log.Messages)
            {
                float num2 = Text.CalcHeight(current.text, width);
                if (num2 > 30f)
                {
                    num2 = 30f;
                }
                GUI.color = new Color(1f, 1f, 1f, 0.7f);
                Rect rect = new Rect(4f, num, 28f, num2);
                Widgets.Label(rect, current.repeats.ToStringCached());
                Rect rect2 = new Rect(28f, num, width, num2);
                if (EditWindow_Log.selectedMessage == current)
                {
                    GUI.DrawTexture(rect2, EditWindow_Log.SelectedMessageTex);
                }
                else if (flag)
                {
                    GUI.DrawTexture(rect2, EditWindow_Log.AltMessageTex);
                }
                if (Widgets.ButtonInvisible(rect2, false))
                {
                    EditWindow_Log.ClearSelectedMessage();
                    EditWindow_Log.SelectedMessage = current;
                }
                GUI.color = current.Color;
                Widgets.Label(rect2, current.text);
                num += num2;
                flag = !flag;
            }
            if (Event.current.type == EventType.Layout)
            {
                this.listingViewHeight = num;
            }
            Widgets.EndScrollView();
            GUI.color = Color.white;
        }
Esempio n. 4
0
 public static void Clear()
 {
     EditWindow_Log.ClearSelectedMessage();
     Log.messageQueue.Clear();
     Log.ResetMessageCount();
 }
Esempio n. 5
0
 public static void ClearAll()
 {
     EditWindow_Log.ClearSelectedMessage();
     EditWindow_Log.messagesScrollPosition = Vector2.zero;
 }
Esempio n. 6
0
 internal static void Clear()
 {
     EditWindow_Log.ClearSelectedMessage();
     Log.messageQueue.Clear();
 }