private void DoDownloadConflictsGUI()
{
bool enabled = GUI.enabled;
bool shift = Event.current.shift;
bool actionKey = EditorGUI.actionKey;
GUILayout.BeginVertical(new GUILayoutOption[0]);
GUILayout.Label("The following assets have been changed both on the server and in the local project.\nPlease select a conflict resolution for each before continuing the update.", new GUILayoutOption[0]);
GUILayout.Space(10f);
GUILayout.BeginHorizontal(new GUILayoutOption[0]);
GUILayout.FlexibleSpace();
GUI.enabled = this.lv1HasSelection && enabled;
if (GUILayout.Button(conflictButtonTexts[0], this.constants.ButtonLeft, new GUILayoutOption[0]))
{
this.ResolveSelectedDownloadConflicts(DownloadResolution.SkipAsset);
}
if (GUILayout.Button(conflictButtonTexts[1], this.constants.ButtonMiddle, new GUILayoutOption[0]))
{
this.ResolveSelectedDownloadConflicts(DownloadResolution.TrashMyChanges);
}
if (GUILayout.Button(conflictButtonTexts[2], this.constants.ButtonMiddle, new GUILayoutOption[0]))
{
this.ResolveSelectedDownloadConflicts(DownloadResolution.TrashServerChanges);
}
if (!this.enableMergeButton)
{
GUI.enabled = false;
}
if (GUILayout.Button(conflictButtonTexts[3], this.constants.ButtonRight, new GUILayoutOption[0]))
{
this.ResolveSelectedDownloadConflicts(DownloadResolution.Merge);
}
GUI.enabled = enabled;
GUILayout.EndHorizontal();
GUILayout.Space(5f);
SplitterGUILayout.BeginHorizontalSplit(this.lvHeaderSplit1, new GUILayoutOption[0]);
GUILayout.Box("Action", this.constants.lvHeader, new GUILayoutOption[0]);
GUILayout.Box("Asset", this.constants.lvHeader, new GUILayoutOption[0]);
SplitterGUILayout.EndHorizontalSplit();
int row = this.lv1.row;
bool flag4 = false;
IEnumerator enumerator = ListViewGUILayout.ListView(this.lv1, this.constants.background, new GUILayoutOption[0]).GetEnumerator();
try
{
while (enumerator.MoveNext())
{
ListViewElement current = (ListViewElement) enumerator.Current;
if (((GUIUtility.keyboardControl == this.lv1.ID) && (Event.current.type == EventType.KeyDown)) && actionKey)
{
Event.current.Use();
}
if (this.selectedLV1Items[current.row] && (Event.current.type == EventType.Repaint))
{
this.constants.selected.Draw(current.position, false, false, false, false);
}
if (ListViewGUILayout.HasMouseUp(current.position))
{
if (!shift && !actionKey)
{
flag4 |= ListViewGUILayout.MultiSelection(row, this.lv1.row, ref this.initialSelectedLV1Item, ref this.selectedLV1Items);
}
}
else if (ListViewGUILayout.HasMouseDown(current.position))
{
if ((Event.current.clickCount == 2) && !AssetServer.AssetIsDir(this.downloadConflicts[current.row]))
{
this.DoShowDiff(false);
GUIUtility.ExitGUI();
}
else
{
if ((!this.selectedLV1Items[current.row] || shift) || actionKey)
{
flag4 |= ListViewGUILayout.MultiSelection(row, current.row, ref this.initialSelectedLV1Item, ref this.selectedLV1Items);
}
this.lv1.row = current.row;
}
}
else if (ListViewGUILayout.HasMouseDown(current.position, 1))
{
if (!this.selectedLV1Items[current.row])
{
flag4 = true;
for (int i = 0; i < this.selectedLV1Items.Length; i++)
{
this.selectedLV1Items[i] = false;
}
this.lv1.selectionChanged = true;
this.selectedLV1Items[current.row] = true;
this.lv1.row = current.row;
}
GUIUtility.hotControl = 0;
Rect position = new Rect(Event.current.mousePosition.x, Event.current.mousePosition.y, 1f, 1f);
EditorUtility.DisplayCustomMenu(position, this.dropDownMenuItems, null, new EditorUtility.SelectMenuItemFunction(this.ContextMenuClick), null);
Event.current.Use();
}
GUILayoutOption[] options = new GUILayoutOption[] { GUILayout.Width((float) this.lvHeaderSplit1.realSizes[0]), GUILayout.Height(18f) };
GUILayout.Label(this.downloadResolutionString[(int) this.downloadResolutions[current.row]], options);
if (this.deletionConflict[current.row] && (Event.current.type == EventType.Repaint))
{
GUIContent badgeDelete = ASMainWindow.constants.badgeDelete;
Rect rect2 = new Rect(((current.position.x + this.lvHeaderSplit1.realSizes[0]) - badgeDelete.image.width) - 5f, (current.position.y + (current.position.height / 2f)) - (badgeDelete.image.height / 2), (float) badgeDelete.image.width, (float) badgeDelete.image.height);
EditorGUIUtility.SetIconSize(Vector2.zero);
GUIStyle.none.Draw(rect2, badgeDelete, false, false, false, false);
EditorGUIUtility.SetIconSize(this.iconSize);
}
GUILayoutOption[] optionArray2 = new GUILayoutOption[] { GUILayout.Width((float) this.lvHeaderSplit1.realSizes[1]), GUILayout.Height(18f) };
GUILayout.Label(new GUIContent(this.dConflictPaths[current.row], !AssetServer.AssetIsDir(this.downloadConflicts[current.row]) ? InternalEditorUtility.GetIconForFile(this.dConflictPaths[current.row]) : EditorGUIUtility.FindTexture(EditorResourcesUtility.folderIconName)), optionArray2);
}
}
finally
{
IDisposable disposable = enumerator as IDisposable;
if (disposable != null)
{
disposable.Dispose();
}
}
GUILayout.EndVertical();
if (GUIUtility.keyboardControl == this.lv1.ID)
{
if ((Event.current.type == EventType.ValidateCommand) && (Event.current.commandName == "SelectAll"))
{
Event.current.Use();
}
else if ((Event.current.type == EventType.ExecuteCommand) && (Event.current.commandName == "SelectAll"))
{
for (int j = 0; j < this.selectedLV1Items.Length; j++)
{
this.selectedLV1Items[j] = true;
}
flag4 = true;
Event.current.Use();
}
if (this.lv1.selectionChanged && !actionKey)
{
flag4 |= ListViewGUILayout.MultiSelection(row, this.lv1.row, ref this.initialSelectedLV1Item, ref this.selectedLV1Items);
}
else if (((GUIUtility.keyboardControl == this.lv1.ID) && (Event.current.type == EventType.KeyDown)) && ((Event.current.keyCode == KeyCode.Return) && !AssetServer.AssetIsDir(this.downloadConflicts[this.lv1.row])))
{
this.DoShowDiff(false);
GUIUtility.ExitGUI();
}
}
if (this.lv1.selectionChanged || flag4)
{
this.mySelection = true;
AssetServer.SetSelectionFromGUIDs(this.GetSelectedGUIDs());
this.lv1HasSelection = this.HasTrue(ref this.selectedLV1Items);
this.enableMergeButton = this.AtLeastOneSelectedAssetCanBeMerged();
}
}