Exemplo n.º 1
0
    public void OnLostFocus()
    {
        GitPanel panel = panels[panelIndex];

        if (panel != null)
        {
            panel.OnLostFocus();
        }
    }
Exemplo n.º 2
0
    public void OnFocus()
    {
        forceRefresh = true;
        GitPanel panel = panels[panelIndex];

        if (panel != null)
        {
            panel.OnFocus();
        }
    }
Exemplo n.º 3
0
        private void Awake()
        {
            m_DevLogEntries = AssetDatabase.LoadAssetAtPath(Settings.DevLogScriptableObjectPath, typeof(DevLogEntries)) as DevLogEntries;
            m_DevLogPanel   = new DevLogPanel(m_DevLogEntries);

            //TODO this needs to be done in OnEnable to avoid edge case bugs on an upgrade
            m_ScreenCaptures = AssetDatabase.LoadAssetAtPath(Settings.ScreenCaptureScriptableObjectPath, typeof(DevLogScreenCaptureCollection)) as DevLogScreenCaptureCollection;

            mediaPanel = new MediaPanel(m_ScreenCaptures);

            m_EntryPanel      = new EntryPanel(m_DevLogEntries);
            m_TwitterPanel    = new TwitterPanel();
            m_DiscordPanel    = new DiscordPanel();
            m_SchedulingPanel = new SchedulingPanel(m_DevLogEntries);
            m_GitPanel        = new GitPanel(m_EntryPanel);
        }
Exemplo n.º 4
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();
    }