Esempio n. 1
0
    public void OnGUI()
    {
        HandleInputFocusAndStateForEditor();

        EditorGUILayoutToolbar.Begin();
        showVars = GUILayout.Toggle(showVars, "Locals", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false));

        EditorGUILayoutToolbar.FlexibleSpace();

        showHelp = GUILayout.Toggle(showHelp, "?", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false));

        EditorGUILayoutToolbar.End();

        if (showHelp)
        {
            ShowHelp();
        }
        else
        {
            ShowEditor();

            if (showVars)
            {
                ShowVars();
            }
        }
    }
Esempio n. 2
0
    public void OnGUI()
    {
        HandleInputFocusAndStateForEditor();

        EditorGUILayoutToolbar.Begin();
        if (GUILayout.Button("Clear Log", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false)))
        {
            logEntries.Clear();
        }

        EditorGUILayoutToolbar.Space();

        showVars = GUILayout.Toggle(showVars, "Locals", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false));
        showLog  = GUILayout.Toggle(showLog, "Log", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false));

        if (showLog)
        {
            EditorGUILayoutToolbar.Space();

            filterTraces = GUILayout.Toggle(filterTraces, "Filter", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false));
        }

        EditorGUILayoutToolbar.FlexibleSpace();

        showHelp = GUILayout.Toggle(showHelp, "?", EditorStyles.toolbarButton, GUILayout.ExpandWidth(false));

        EditorGUILayoutToolbar.End();

        if (showHelp)
        {
            ShowHelp();
        }
        else
        {
            ShowEditor();

            if (showVars && showLog)
            {
                EditorGUILayoutVerticalPanes.Begin(paneConfiguration);
                ShowVars();
                EditorGUILayoutVerticalPanes.Splitter();
                ShowLog();
                EditorGUILayoutVerticalPanes.End();
            }
            else
            {
                if (showVars)
                {
                    ShowVars();
                }
                else if (showLog)
                {
                    ShowLog();
                }
            }
        }
    }
Esempio n. 3
0
    public void OnGUI()
    {
        GitPanel panel = panels[panelIndex];

        EditorGUILayoutToolbar.Begin();
        if (GUILayout.Button(refreshButton, EditorStyles.toolbarButton, GUIHelper.NoExpandWidth))
        {
            forceRefresh = true;
        }

        if (forceRefresh && panel != null)
        {
            forceRefresh = false;
            panel.OnRefresh();
        }

        EditorGUILayoutToolbar.Space();
        bool hasShownToolbar = false;

        for (int i = 0; i < panelLabels.Length; i++)
        {
            if (panelLabels[i] == null)
            {
                if (!hasShownToolbar)
                {
                    hasShownToolbar = true;
                    EditorGUILayoutToolbar.Space();
                    if (panel != null && !panel.IsDisabledForError)
                    {
                        panel.OnToolbarGUI();
                    }
                    EditorGUILayoutToolbar.FlexibleSpace();
                }
            }
            else
            {
                if (GUILayout.Toggle((panelIndex == i), panelLabels[i], EditorStyles.toolbarButton, GUIHelper.NoExpandWidth))
                {
                    panelIndex = i;
                }
            }
        }
        EditorGUILayoutToolbar.End();
        GUILayout.BeginVertical(GitStyles.Indented);
        panel = panels[panelIndex];
        if (panel != null)
        {
            if (!panel.IsDisabledForError)
            {
                panel.OnGUI();
            }
            else
            {
                Color c = GUI.color;
                GUI.color = GitStyles.ErrorColor;
                GUILayout.Label("Whoops!  Encountered an error in git.  Please see the About tab to ensure git is set up properly!", GitStyles.WhiteBoldLabel);
                GUI.color = c;
            }
        }
        else
        {
            GUILayout.Label("Not implemented yet.");
        }
        GUILayout.EndVertical();
    }