private int CheckParentViewInFilterAndMarkBoldItems(GUIHistoryListItem item, string text)
        {
            ParentViewState assets = item.assets;
            int             num    = -1;
            int             index  = 0;

            for (int i = 0; i < assets.folders.Length; i++)
            {
                ParentViewFolder folder = assets.folders[i];
                if (folder.name.IndexOf(text, StringComparison.InvariantCultureIgnoreCase) != -1)
                {
                    item.boldAssets[index] = true;
                    if (num == -1)
                    {
                        num = index;
                    }
                }
                index++;
                for (int j = 0; j < folder.files.Length; j++)
                {
                    if (folder.files[j].name.IndexOf(text, StringComparison.InvariantCultureIgnoreCase) != -1)
                    {
                        item.boldAssets[index] = true;
                        if (num == -1)
                        {
                            num = index;
                        }
                    }
                    index++;
                }
            }
            return(num);
        }
 private void MarkBoldItemsByGUID(string guid)
 {
     for (int i = 0; i < this.m_GUIItems.Length; i++)
     {
         GUIHistoryListItem item   = this.m_GUIItems[i];
         ParentViewState    assets = item.assets;
         int index = 0;
         item.boldAssets = new bool[assets.GetLineCount()];
         for (int j = 0; j < assets.folders.Length; j++)
         {
             ParentViewFolder folder = assets.folders[j];
             if (folder.guid == guid)
             {
                 item.boldAssets[index] = true;
             }
             index++;
             for (int k = 0; k < folder.files.Length; k++)
             {
                 if (folder.files[k].guid == guid)
                 {
                     item.boldAssets[index] = true;
                 }
                 index++;
             }
         }
     }
 }
Example #3
0
 private int CheckParentViewInFilterAndMarkBoldItems(GUIHistoryListItem item, string text)
 {
     ParentViewState assets = item.assets;
     int num = -1;
     int index = 0;
     for (int i = 0; i < assets.folders.Length; i++)
     {
         ParentViewFolder folder = assets.folders[i];
         if (folder.name.IndexOf(text, StringComparison.InvariantCultureIgnoreCase) != -1)
         {
             item.boldAssets[index] = true;
             if (num == -1)
             {
                 num = index;
             }
         }
         index++;
         for (int j = 0; j < folder.files.Length; j++)
         {
             if (folder.files[j].name.IndexOf(text, StringComparison.InvariantCultureIgnoreCase) != -1)
             {
                 item.boldAssets[index] = true;
                 if (num == -1)
                 {
                     num = index;
                 }
             }
             index++;
         }
     }
     return num;
 }
        private void UncollapseListItem(ref GUIHistoryListItem item)
        {
            int num = (item.collapsedItemCount - 1) * this.m_RowHeight;

            item.collapsedItemCount = 0;
            item.startShowingFrom   = 0;
            item.height            += num;
            this.m_TotalHeight     += num;
        }
        private int MarkBoldItemsBySelection(GUIHistoryListItem item)
        {
            List <string>   list   = new List <string>();
            ParentViewState assets = item.assets;
            int             num    = -1;
            int             index  = 0;

            if (Selection.instanceIDs.Length == 0)
            {
                return(0);
            }
            foreach (int num3 in Selection.instanceIDs)
            {
                list.Add(AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(num3)));
            }
            for (int i = 0; i < assets.folders.Length; i++)
            {
                ParentViewFolder folder = assets.folders[i];
                if (list.Contains(folder.guid))
                {
                    item.boldAssets[index] = true;
                    if (num == -1)
                    {
                        num = index;
                    }
                }
                index++;
                for (int j = 0; j < folder.files.Length; j++)
                {
                    if (list.Contains(folder.files[j].guid))
                    {
                        item.boldAssets[index] = true;
                        if (num == -1)
                        {
                            num = index;
                        }
                    }
                    index++;
                }
            }
            return(num);
        }
        private void DrawParentView(Rect r, ref GUIHistoryListItem item, int changesetIndex, bool hasFocus)
        {
            ParentViewState assets   = item.assets;
            GUIContent      content  = new GUIContent();
            Texture2D       textured = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
            Event           current  = Event.current;

            hasFocus &= this.m_HistoryControlID == GUIUtility.keyboardControl;
            r.height  = this.m_RowHeight;
            r.y      += 3f;
            int index = -1;
            int num2  = (item.collapsedItemCount == 0) ? item.totalLineCount : 4;

            num2 += item.startShowingFrom;
            for (int i = 0; i < assets.folders.Length; i++)
            {
                GUIStyle         label;
                ParentViewFolder folder = assets.folders[i];
                content.text  = folder.name;
                content.image = textured;
                index++;
                if (index == num2)
                {
                    break;
                }
                if (index >= item.startShowingFrom)
                {
                    label = ms_Style.label;
                    if ((current.type == EventType.MouseDown) && r.Contains(current.mousePosition))
                    {
                        if (((this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.guid)) && EditorGUI.actionKey)
                        {
                            this.ClearItemSelection();
                        }
                        else
                        {
                            this.ChangeLogSelectionRev         = this.m_Changesets[changesetIndex].changeset;
                            this.m_ChangeLogSelectionGUID      = folder.guid;
                            this.m_ChangeLogSelectionAssetName = folder.name;
                            this.m_FolderSelected      = true;
                            this.m_AssetSelectionIndex = index;
                        }
                        this.m_ChangesetSelectionIndex = changesetIndex;
                        GUIUtility.keyboardControl     = this.m_HistoryControlID;
                        ((ASMainWindow)this.m_ParentWindow).m_SearchToShow = ASMainWindow.ShowSearchField.HistoryList;
                        if (current.clickCount == 2)
                        {
                            this.ShowAssetsHistory();
                            GUIUtility.ExitGUI();
                        }
                        else if (current.button == 1)
                        {
                            GUIUtility.hotControl = 0;
                            r = new Rect(current.mousePosition.x, current.mousePosition.y, 1f, 1f);
                            EditorUtility.DisplayCustomMenu(r, this.m_DropDownMenuItems, -1, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null);
                        }
                        this.DoScroll();
                        current.Use();
                    }
                    bool on = (this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.guid);
                    if (item.boldAssets[index] && !on)
                    {
                        GUI.Label(r, string.Empty, ms_Style.ping);
                    }
                    if (Event.current.type == EventType.Repaint)
                    {
                        label.Draw(r, content, false, false, on, hasFocus);
                        this.DrawBadge(r, folder.changeFlags, label, content, GUIClip.visibleRect.width - 150f);
                    }
                    r.y += this.m_RowHeight;
                }
                RectOffset padding = ms_Style.label.padding;
                padding.left += 0x10;
                RectOffset offset2 = ms_Style.boldLabel.padding;
                offset2.left += 0x10;
                try
                {
                    for (int j = 0; j < folder.files.Length; j++)
                    {
                        index++;
                        if (index == num2)
                        {
                            break;
                        }
                        if (index >= item.startShowingFrom)
                        {
                            label = ms_Style.label;
                            if ((current.type == EventType.MouseDown) && r.Contains(current.mousePosition))
                            {
                                if (((this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.files[j].guid)) && EditorGUI.actionKey)
                                {
                                    this.ClearItemSelection();
                                }
                                else
                                {
                                    this.ChangeLogSelectionRev         = this.m_Changesets[changesetIndex].changeset;
                                    this.m_ChangeLogSelectionGUID      = folder.files[j].guid;
                                    this.m_ChangeLogSelectionAssetName = folder.files[j].name;
                                    this.m_FolderSelected      = false;
                                    this.m_AssetSelectionIndex = index;
                                }
                                this.m_ChangesetSelectionIndex = changesetIndex;
                                GUIUtility.keyboardControl     = this.m_HistoryControlID;
                                ((ASMainWindow)this.m_ParentWindow).m_SearchToShow = ASMainWindow.ShowSearchField.HistoryList;
                                if (current.clickCount == 2)
                                {
                                    if (this.IsComparableAssetSelected() && (this.m_SelectedGUID == this.m_ChangeLogSelectionGUID))
                                    {
                                        this.DoShowDiff(false, this.ChangeLogSelectionRev, -1);
                                    }
                                    else
                                    {
                                        this.ShowAssetsHistory();
                                        GUIUtility.ExitGUI();
                                    }
                                }
                                else if (current.button == 1)
                                {
                                    GUIUtility.hotControl = 0;
                                    r = new Rect(current.mousePosition.x, current.mousePosition.y, 1f, 1f);
                                    EditorUtility.DisplayCustomMenu(r, this.m_DropDownMenuItems, -1, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null);
                                }
                                this.DoScroll();
                                current.Use();
                            }
                            content.text  = folder.files[j].name;
                            content.image = InternalEditorUtility.GetIconForFile(folder.files[j].name);
                            bool flag2 = (this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.files[j].guid);
                            if (item.boldAssets[index] && !flag2)
                            {
                                GUI.Label(r, string.Empty, ms_Style.ping);
                            }
                            if (Event.current.type == EventType.Repaint)
                            {
                                label.Draw(r, content, false, false, flag2, hasFocus);
                                this.DrawBadge(r, folder.files[j].changeFlags, label, content, GUIClip.visibleRect.width - 150f);
                            }
                            r.y += this.m_RowHeight;
                        }
                    }
                    if (index == num2)
                    {
                        break;
                    }
                }
                finally
                {
                    RectOffset offset3 = ms_Style.label.padding;
                    offset3.left -= 0x10;
                    RectOffset offset4 = ms_Style.boldLabel.padding;
                    offset4.left -= 0x10;
                }
            }
            if (((index == num2) || (num2 >= item.totalLineCount)) && (item.collapsedItemCount != 0))
            {
                r.x += 19f;
                if (GUI.Button(r, item.collapsedItemCount.ToString() + " more...", ms_Style.foldout))
                {
                    GUIUtility.keyboardControl = this.m_HistoryControlID;
                    this.UncollapseListItem(ref item);
                }
            }
        }
Example #7
0
 private void UncollapseListItem(ref GUIHistoryListItem item)
 {
     int num = (item.collapsedItemCount - 1) * this.m_RowHeight;
     item.collapsedItemCount = 0;
     item.startShowingFrom = 0;
     item.height += num;
     this.m_TotalHeight += num;
 }
Example #8
0
 private int MarkBoldItemsBySelection(GUIHistoryListItem item)
 {
     List<string> list = new List<string>();
     ParentViewState assets = item.assets;
     int num = -1;
     int index = 0;
     if (Selection.instanceIDs.Length == 0)
     {
         return 0;
     }
     foreach (int num3 in Selection.instanceIDs)
     {
         list.Add(AssetDatabase.AssetPathToGUID(AssetDatabase.GetAssetPath(num3)));
     }
     for (int i = 0; i < assets.folders.Length; i++)
     {
         ParentViewFolder folder = assets.folders[i];
         if (list.Contains(folder.guid))
         {
             item.boldAssets[index] = true;
             if (num == -1)
             {
                 num = index;
             }
         }
         index++;
         for (int j = 0; j < folder.files.Length; j++)
         {
             if (list.Contains(folder.files[j].guid))
             {
                 item.boldAssets[index] = true;
                 if (num == -1)
                 {
                     num = index;
                 }
             }
             index++;
         }
     }
     return num;
 }
Example #9
0
 private void DrawParentView(Rect r, ref GUIHistoryListItem item, int changesetIndex, bool hasFocus)
 {
     ParentViewState assets = item.assets;
     GUIContent content = new GUIContent();
     Texture2D textured = EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName);
     Event current = Event.current;
     hasFocus &= this.m_HistoryControlID == GUIUtility.keyboardControl;
     r.height = this.m_RowHeight;
     r.y += 3f;
     int index = -1;
     int num2 = (item.collapsedItemCount == 0) ? item.totalLineCount : 4;
     num2 += item.startShowingFrom;
     for (int i = 0; i < assets.folders.Length; i++)
     {
         GUIStyle label;
         ParentViewFolder folder = assets.folders[i];
         content.text = folder.name;
         content.image = textured;
         index++;
         if (index == num2)
         {
             break;
         }
         if (index >= item.startShowingFrom)
         {
             label = ms_Style.label;
             if ((current.type == EventType.MouseDown) && r.Contains(current.mousePosition))
             {
                 if (((this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.guid)) && EditorGUI.actionKey)
                 {
                     this.ClearItemSelection();
                 }
                 else
                 {
                     this.ChangeLogSelectionRev = this.m_Changesets[changesetIndex].changeset;
                     this.m_ChangeLogSelectionGUID = folder.guid;
                     this.m_ChangeLogSelectionAssetName = folder.name;
                     this.m_FolderSelected = true;
                     this.m_AssetSelectionIndex = index;
                 }
                 this.m_ChangesetSelectionIndex = changesetIndex;
                 GUIUtility.keyboardControl = this.m_HistoryControlID;
                 ((ASMainWindow) this.m_ParentWindow).m_SearchToShow = ASMainWindow.ShowSearchField.HistoryList;
                 if (current.clickCount == 2)
                 {
                     this.ShowAssetsHistory();
                     GUIUtility.ExitGUI();
                 }
                 else if (current.button == 1)
                 {
                     GUIUtility.hotControl = 0;
                     r = new Rect(current.mousePosition.x, current.mousePosition.y, 1f, 1f);
                     EditorUtility.DisplayCustomMenu(r, this.m_DropDownMenuItems, -1, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null);
                 }
                 this.DoScroll();
                 current.Use();
             }
             bool on = (this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.guid);
             if (item.boldAssets[index] && !on)
             {
                 GUI.Label(r, string.Empty, ms_Style.ping);
             }
             if (Event.current.type == EventType.Repaint)
             {
                 label.Draw(r, content, false, false, on, hasFocus);
                 this.DrawBadge(r, folder.changeFlags, label, content, GUIClip.visibleRect.width - 150f);
             }
             r.y += this.m_RowHeight;
         }
         RectOffset padding = ms_Style.label.padding;
         padding.left += 0x10;
         RectOffset offset2 = ms_Style.boldLabel.padding;
         offset2.left += 0x10;
         try
         {
             for (int j = 0; j < folder.files.Length; j++)
             {
                 index++;
                 if (index == num2)
                 {
                     break;
                 }
                 if (index >= item.startShowingFrom)
                 {
                     label = ms_Style.label;
                     if ((current.type == EventType.MouseDown) && r.Contains(current.mousePosition))
                     {
                         if (((this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.files[j].guid)) && EditorGUI.actionKey)
                         {
                             this.ClearItemSelection();
                         }
                         else
                         {
                             this.ChangeLogSelectionRev = this.m_Changesets[changesetIndex].changeset;
                             this.m_ChangeLogSelectionGUID = folder.files[j].guid;
                             this.m_ChangeLogSelectionAssetName = folder.files[j].name;
                             this.m_FolderSelected = false;
                             this.m_AssetSelectionIndex = index;
                         }
                         this.m_ChangesetSelectionIndex = changesetIndex;
                         GUIUtility.keyboardControl = this.m_HistoryControlID;
                         ((ASMainWindow) this.m_ParentWindow).m_SearchToShow = ASMainWindow.ShowSearchField.HistoryList;
                         if (current.clickCount == 2)
                         {
                             if (this.IsComparableAssetSelected() && (this.m_SelectedGUID == this.m_ChangeLogSelectionGUID))
                             {
                                 this.DoShowDiff(false, this.ChangeLogSelectionRev, -1);
                             }
                             else
                             {
                                 this.ShowAssetsHistory();
                                 GUIUtility.ExitGUI();
                             }
                         }
                         else if (current.button == 1)
                         {
                             GUIUtility.hotControl = 0;
                             r = new Rect(current.mousePosition.x, current.mousePosition.y, 1f, 1f);
                             EditorUtility.DisplayCustomMenu(r, this.m_DropDownMenuItems, -1, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null);
                         }
                         this.DoScroll();
                         current.Use();
                     }
                     content.text = folder.files[j].name;
                     content.image = InternalEditorUtility.GetIconForFile(folder.files[j].name);
                     bool flag2 = (this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset) && (this.m_ChangeLogSelectionGUID == folder.files[j].guid);
                     if (item.boldAssets[index] && !flag2)
                     {
                         GUI.Label(r, string.Empty, ms_Style.ping);
                     }
                     if (Event.current.type == EventType.Repaint)
                     {
                         label.Draw(r, content, false, false, flag2, hasFocus);
                         this.DrawBadge(r, folder.files[j].changeFlags, label, content, GUIClip.visibleRect.width - 150f);
                     }
                     r.y += this.m_RowHeight;
                 }
             }
             if (index == num2)
             {
                 break;
             }
         }
         finally
         {
             RectOffset offset3 = ms_Style.label.padding;
             offset3.left -= 0x10;
             RectOffset offset4 = ms_Style.boldLabel.padding;
             offset4.left -= 0x10;
         }
     }
     if (((index == num2) || (num2 >= item.totalLineCount)) && (item.collapsedItemCount != 0))
     {
         r.x += 19f;
         if (GUI.Button(r, item.collapsedItemCount.ToString() + " more...", ms_Style.foldout))
         {
             GUIUtility.keyboardControl = this.m_HistoryControlID;
             this.UncollapseListItem(ref item);
         }
     }
 }