Ejemplo n.º 1
0
        void DrawInput(ref Rect rect)
        {
            rect.width = CalculateInputWidth(rect.height);
            if (focus && GUI.enabled)
            {
                GUI.FocusControl(name);
                focus = false;
            }
            offsetX = rect.x;
            GUIUtils.DrawBox(rect, color);
            Color cursorColor = GUI.skin.settings.cursorColor;

            GUI.skin.settings.cursorColor = this.cursorColor;
            rect.x     += 2;
            rect.width -= 4;
            bool wasEmpty = string.IsNullOrEmpty(text.Trim());

            GUI.SetNextControlName(name);
            text = GUI.TextField(rect, text, GUIUtils.inputStyle);
            if (DevConsole.settings.autoCompleteBehaviour == Settings.AutoCompleteBehaviour.Auto && wasEmpty && !string.IsNullOrEmpty(text.Trim()))
            {
                DevConsole.singleton.autoComplete.Open();
                DevConsole.singleton.history.Close();
            }
            rect.x     -= 2;
            rect.width += 4;
            GUI.skin.settings.cursorColor = cursorColor;
        }
Ejemplo n.º 2
0
        public void Draw(float positionY)
        {
            Rect rect = new Rect(0, positionY, Screen.width / DevConsole.settings.scale, height - lineHeight);

            DrawLine(rect);
            rect.y += lineHeight;
            GUIUtils.DrawBox(rect, DevConsole.settings.mainColor);
            rect.x      += padding;
            rect.y      += padding;
            rect.width  -= padding * 2;
            rect.height -= padding * 2;
            if (DevConsole.settings.autoCompleteBehaviour != Settings.AutoCompleteBehaviour.Disabled)
            {
                DrawGenericButton(ref rect, autoCompleteContent, DevConsole.singleton.ToggleAutoComplete);
                rect.x += rect.width;
                rect.x += spacing;
            }
            DrawInput(ref rect);
            rect.x += rect.width;
            rect.x += spacing;
            DrawGenericButton(ref rect, submitContent, DevConsole.singleton.SubmitInputText);
            rect.x += rect.width;
            rect.x += spacing;
            DrawGenericButton(ref rect, deleteContent, Clear);
            rect.x += rect.width;
            rect.x += spacing;
            if (DevConsole.settings.enableHistory)
            {
                DrawGenericButton(ref rect, historyContent, DevConsole.singleton.ToggleHistory);
            }
        }
Ejemplo n.º 3
0
 public void Draw(float positionY, float height)
 {
     CalculateCurrentFilter();
     viewRect     = new Rect(0, positionY, Screen.width / DevConsole.settings.scale, height);
     contentsRect = new Rect(viewRect.x, viewRect.y, viewRect.width, lastContentHeight);
     if (buffer.Count > 0)
     {
         AddNewEntries();
     }
     else if (lastGroupEntries != DevConsole.settings.groupIdenticalEntries)
     {
         SelectDrawingEntries();
     }
     lastGroupEntries = DevConsole.settings.groupIdenticalEntries;
     GUIUtils.DrawBox(viewRect, DevConsole.settings.mainColor);
     entryJustRemoved = false;
     scrollView.Draw(viewRect, contentsRect, DrawOnlyVisibleEntries);
     if (!scrollView.isScrollbarVisible && lastScrollbarVisible)
     {
         scrollView.ScrollToTop();
     }
     else if (scrollView.isScrollbarVisible && !lastScrollbarVisible)
     {
         scrollView.ScrollToBottom();
     }
     lastScrollbarVisible = scrollView.isScrollbarVisible;
 }
Ejemplo n.º 4
0
        public void Draw()
        {
            Rect rect = new Rect(0, 0, Screen.width / DevConsole.settings.scale, height - lineHeight);

            GUIUtils.DrawBox(rect, DevConsole.settings.mainColor);
            DrawLine(rect);
            rect.y      += padding;
            rect.height -= padding * 2;
            DrawButtonsPanel(ref rect);
            DrawTabs(ref rect);
        }
Ejemplo n.º 5
0
        public void Draw(float positionY, float height)
        {
            Rect viewRect     = new Rect(0, positionY, Screen.width / DevConsole.settings.scale, height);
            Rect contentsRect = new Rect(viewRect.x, viewRect.y, viewRect.width, panelHeight);

            GUIUtils.DrawBox(viewRect, DevConsole.settings.mainColor);
            scrollView.Draw(viewRect, contentsRect, DrawContents);
            if (!scrollView.isScrollbarVisible)
            {
                scrollView.ScrollToTop();
            }
        }
Ejemplo n.º 6
0
        void DrawWindow(int id)
        {
            if (Event.current.type == EventType.Layout)
            {
                return;
            }
            rect.x = rect.y = 0;
            GUIUtils.DrawBox(rect, backgroundColor);
            DrawTitle();
            rect.y      += titleHeight;
            rect.height -= titleHeight;
            ConstructColors();
            Rect contentsRect = new Rect(rect.x, rect.y, rect.width, contentsHeight);

            scrollView.Draw(rect, contentsRect, DrawOnlyVisibleEntries);
        }
Ejemplo n.º 7
0
        public void Draw(float positionY, float entryWidth, bool isVisible)
        {
            DoLayout(entryWidth);
            if (!isVisible)
            {
                return;
            }

            GUIUtils.DrawBox(new Rect(0, positionY, entryWidth, height), backgroundColor);
            Rect rect = new Rect(0, positionY + DevConsole.settings.entriesSpacing, 0, 0);

            DrawFoldoutToggle(ref rect);
            rect.x += rect.width;
            if (DevConsole.settings.showTimeStamp)
            {
                DrawTimeStamp(ref rect);
                rect.x += rect.width;
                rect.x += spacing;
            }
            if (data.icon != null)
            {
                DrawIcon(ref rect);
                rect.x += rect.width;
                rect.x += spacing;
            }
            DrawText(ref rect, textSize.x);
            rect.x += rect.width;
            if (DevConsole.settings.groupIdenticalEntries)
            {
                DrawGroupContent(ref rect);
                rect.x += rect.width;
            }
            DrawStackTraceToggle(ref rect);
            rect.x += rect.width;
            DrawRemoveButton(ref rect);
        }
Ejemplo n.º 8
0
 void DrawLine(Rect rect)
 {
     rect.y     += rect.height;
     rect.height = lineHeight;
     GUIUtils.DrawBox(rect, GUIUtils.blackColor);
 }
Ejemplo n.º 9
0
 void DrawTitle(ref Rect rect)
 {
     rect.height = 20;
     GUIUtils.DrawBox(rect, GUIUtils.darkerGrayColor);
     GUI.Label(rect, titleContent, GUIUtils.centeredTextStyle);
 }