예제 #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);
        }