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...", EditorStyles.foldout))
{
GUIUtility.keyboardControl = this.m_HistoryControlID;
this.UncollapseListItem(ref item);
}
}
}