private void SetupUI()
        {
            InitStyles();

            HandleInputEvents();

            UCL_LogEntries.SetFlag(UCL_ConsoleFlags.LogLevelLog, true);
            UCL_LogEntries.SetFlag(UCL_ConsoleFlags.LogLevelWarning, true);
            UCL_LogEntries.SetFlag(UCL_ConsoleFlags.LogLevelError, true);

            if (!EditorGUIUtility.isProSkin)
            {
                GUI.DrawTexture(new Rect(0, 0, position.width, position.height), SA_IconManager.GetIconFromHtmlColorString("#DFDFDFFF"));
            }
        }
        private void DrawToolbar()
        {
            GUILayout.BeginHorizontal(EditorStyles.toolbar);
            {
                bool clear = GUILayout.Button("Clear", EditorStyles.toolbarButton);
                if (clear)
                {
                    UCL_LogEntries.Clear();
                }

                GUILayout.Space(6);


                bool val = false;
                if (m_state.DisplayCollapse)
                {
                    val = UCL_LogEntries.HasFlag(UCL_ConsoleFlags.Collapse);
                    val = GUILayout.Toggle(val, "Collapse", EditorStyles.toolbarButton);
                    UCL_LogEntries.SetFlag(UCL_ConsoleFlags.Collapse, val);
                }

                if (m_state.DisplayClearOnPlay)
                {
                    val = UCL_LogEntries.HasFlag(UCL_ConsoleFlags.ClearOnPlay);
                    val = GUILayout.Toggle(val, "Clear on Play", EditorStyles.toolbarButton);
                    UCL_LogEntries.SetFlag(UCL_ConsoleFlags.ClearOnPlay, val);
                }

                if (m_state.DisplayPauseOnError)
                {
                    val = UCL_LogEntries.HasFlag(UCL_ConsoleFlags.ErrorPause);
                    val = GUILayout.Toggle(val, "Error Pause", EditorStyles.toolbarButton);
                    UCL_LogEntries.SetFlag(UCL_ConsoleFlags.ErrorPause, val);
                }


                if (UnDockedUsedTagsCount > 0)
                {
                    if (GUILayout.Button("Tags (" + UnDockedUsedTagsCount + ")", EditorStyles.toolbarDropDown))
                    {
                        GenericMenu toolsMenu = new GenericMenu();

                        foreach (var pair in m_tagsMessagesCount)
                        {
                            var tag = UCL_Settings.Instance.GetTag(pair.Key);
                            if (m_state.IsTagDocked(tag))
                            {
                                continue;
                            }

                            bool enabled = m_state.IsTagEnabled(tag);
                            toolsMenu.AddItem(new GUIContent(tag.Name + " (" + pair.Value + ")"), enabled, () => {
                                enabled = !enabled;
                                m_state.SetTagEnabledState(tag, enabled);
                                UCL_Settings.SaveConsoleWindowState(m_state);
                            });
                        }
                        toolsMenu.ShowAsContext();
                    }
                }


                GUILayout.FlexibleSpace();
                if (m_state.DisplaySearchBar)
                {
                    GUILayout.BeginHorizontal(m_toolbarStyle);
                    {
                        GUI.SetNextControlName(SEARCH_BAR_CONTROL_NAME);
                        m_searchString = EditorGUILayout.TextField(m_searchString, m_toolbarSearchTextFieldStyle, GUILayout.MinWidth(200f));

                        if (GUILayout.Button("", m_toolbarSearchCancelButtonStyle))
                        {
                            m_searchString = "";
                            GUI.FocusControl(null);
                        }

                        m_logsView.SerSearthcString(m_searchString);
                    }
                    GUILayout.EndHorizontal();
                }


                for (int i = UCL_Settings.Instance.Tags.Count - 1; i >= 0; i--)
                {
                    var tag = UCL_Settings.Instance.Tags[i];
                    //just a stupid workaround we have to make
                    // since gui list plgun an add a null balue to the tags list just for a second
                    if (tag == null)
                    {
                        continue;
                    }
                    if (m_state.IsTagDocked(tag))
                    {
                        var content = new GUIContent(GetMessagesCountForTag(tag.Name).ToString(), tag.Icon);

                        EditorGUI.BeginChangeCheck();
                        bool enabled = GUILayout.Toggle(m_state.IsTagEnabled(tag), content, EditorStyles.toolbarButton);
                        if (EditorGUI.EndChangeCheck())
                        {
                            m_state.SetTagEnabledState(tag, enabled);
                            UCL_Settings.SaveConsoleWindowState(m_state);
                        }
                    }
                }
            }
            GUILayout.EndHorizontal();
        }