UnityEditor.ASHistoryWindow.DoGUI C# (CSharp) Method

DoGUI() public method

public DoGUI ( bool hasFocus ) : bool
hasFocus bool
return bool
        public bool DoGUI(bool hasFocus)
        {
            bool enabled = GUI.enabled;
            if (ms_Style == null)
            {
                ms_Style = new Constants();
                ms_Style.entryEven = new GUIStyle(ms_Style.entryEven);
                ms_Style.entryEven.padding.left = 3;
                ms_Style.entryOdd = new GUIStyle(ms_Style.entryOdd);
                ms_Style.entryOdd.padding.left = 3;
                ms_Style.label = new GUIStyle(ms_Style.label);
                ms_Style.boldLabel = new GUIStyle(ms_Style.boldLabel);
                ms_Style.label.padding.left = 3;
                ms_Style.boldLabel.padding.left = 3;
                ms_Style.boldLabel.padding.top = 0;
                ms_Style.boldLabel.padding.bottom = 0;
                this.DoLocalSelectionChange();
            }
            EditorGUIUtility.SetIconSize(ms_IconSize);
            if ((Event.current.type == EventType.KeyDown) && (Event.current.keyCode == KeyCode.Escape))
            {
                this.CancelShowCustomDiff();
                Event.current.Use();
            }
            SplitterGUILayout.BeginHorizontalSplit(this.m_HorSplit, new GUILayoutOption[0]);
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.ExpandWidth(true), GUILayout.ExpandHeight(true) };
            Rect theRect = GUILayoutUtility.GetRect((float) 0f, (float) 0f, options);
            this.m_FileViewWin.DoGUI(this, theRect, hasFocus);
            GUILayout.EndVertical();
            GUILayout.BeginVertical(new GUILayoutOption[0]);
            this.WebLikeHistory(hasFocus);
            GUILayout.EndVertical();
            SplitterGUILayout.EndHorizontalSplit();
            if (Event.current.type == EventType.Repaint)
            {
                Handles.color = Color.black;
                Handles.DrawLine(new Vector3((float) (this.m_HorSplit.realSizes[0] - 1), theRect.y, 0f), new Vector3((float) (this.m_HorSplit.realSizes[0] - 1), theRect.yMax, 0f));
                Handles.DrawLine(new Vector3(0f, theRect.yMax, 0f), new Vector3((float) Screen.width, theRect.yMax, 0f));
            }
            GUILayout.BeginHorizontal(new GUILayoutOption[0]);
            GUI.enabled = (this.m_FileViewWin.SelType == ASHistoryFileView.SelectionType.DeletedItems) && enabled;
            if (GUILayout.Button(EditorGUIUtility.TextContent("Recover"), ms_Style.button, new GUILayoutOption[0]))
            {
                this.m_FileViewWin.DoRecover();
            }
            GUILayout.FlexibleSpace();
            if (this.m_InRevisionSelectMode)
            {
                GUI.enabled = enabled;
                GUILayout.Label(EditorGUIUtility.TextContent("Select revision to compare to"), ms_Style.boldLabel, new GUILayoutOption[0]);
            }
            GUILayout.Space(10f);
            GUI.enabled = this.IsComparableAssetSelected() && enabled;
            if (GUILayout.Button(EditorGUIUtility.TextContent("Compare to Local Version"), ms_Style.button, new GUILayoutOption[0]))
            {
                this.DoShowDiff(false, this.ChangeLogSelectionRev, -1);
                GUIUtility.ExitGUI();
            }
            GUI.enabled = ((this.ChangeLogSelectionRev > 0) && (this.m_ChangeLogSelectionGUID != string.Empty)) && enabled;
            if (GUILayout.Button(EditorGUIUtility.TextContent("Download Selected File"), ms_Style.button, new GUILayoutOption[0]))
            {
                this.DownloadFile();
            }
            GUILayout.Space(10f);
            GUI.enabled = (this.ChangeLogSelectionRev > 0) && enabled;
            if (GUILayout.Button((this.ChangeLogSelectionRev <= 0) ? "Revert Entire Project" : ("Revert Entire Project to " + this.ChangeLogSelectionRev), ms_Style.button, new GUILayoutOption[0]))
            {
                this.DoRevertProject();
            }
            GUI.enabled = enabled;
            GUILayout.EndHorizontal();
            GUILayout.Space(10f);
            if (!this.m_SplittersOk && (Event.current.type == EventType.Repaint))
            {
                this.m_SplittersOk = true;
                HandleUtility.Repaint();
            }
            EditorGUIUtility.SetIconSize(Vector2.zero);
            return true;
        }