Exemple #1
0
        private void ResolveSelectedDownloadConflicts(DownloadResolution res)
        {
            int  num  = -1;
            bool flag = false;
            int  i    = 0;

            while (i < this.downloadConflicts.Length)
            {
                if (this.selectedLV1Items[i])
                {
                    string guid = this.downloadConflicts[i];
                    if (res == DownloadResolution.Merge && (AssetServer.AssetIsBinaryByGUID(guid) || AssetServer.IsItemDeleted(guid)))
                    {
                        flag = true;
                    }
                    else
                    {
                        if (res != DownloadResolution.Unresolved)
                        {
                            if (AssetServer.GetDownloadResolution(guid) == DownloadResolution.Unresolved)
                            {
                                this.downloadConflictsToResolve--;
                            }
                        }
                        else
                        {
                            this.downloadConflictsToResolve++;
                        }
                        this.downloadResolutions[i] = res;
                        AssetServer.SetDownloadResolution(guid, res);
                        num = ((num != -1) ? -2 : i);
                    }
                }
IL_9F:
                i++;
                continue;
                goto IL_9F;
            }
            this.enableContinueButton = (this.downloadConflictsToResolve == 0);
            if (num >= 0)
            {
                this.selectedLV1Items[num] = false;
                if (num < this.selectedLV1Items.Length - 1)
                {
                    this.selectedLV1Items[num + 1] = true;
                }
            }
            this.enableMergeButton = this.AtLeastOneSelectedAssetCanBeMerged();
            if (flag)
            {
                EditorUtility.DisplayDialog("Some conflicting changes cannot be merged", "Notice that not all selected changes where selected for merging. This happened because not all of them can be merged (e.g. assets are binary or deleted).", "OK");
            }
        }
        private void ResolveSelectedDownloadConflicts(DownloadResolution res)
        {
            int  index1 = -1;
            bool flag   = false;

            for (int index2 = 0; index2 < this.downloadConflicts.Length; ++index2)
            {
                if (this.selectedLV1Items[index2])
                {
                    string downloadConflict = this.downloadConflicts[index2];
                    if (res == DownloadResolution.Merge && (AssetServer.AssetIsBinaryByGUID(downloadConflict) || AssetServer.IsItemDeleted(downloadConflict)))
                    {
                        flag = true;
                    }
                    else
                    {
                        if (res != DownloadResolution.Unresolved)
                        {
                            if (AssetServer.GetDownloadResolution(downloadConflict) == DownloadResolution.Unresolved)
                            {
                                --this.downloadConflictsToResolve;
                            }
                        }
                        else
                        {
                            ++this.downloadConflictsToResolve;
                        }
                        this.downloadResolutions[index2] = res;
                        AssetServer.SetDownloadResolution(downloadConflict, res);
                        index1 = index1 != -1 ? -2 : index2;
                    }
                }
            }
            this.enableContinueButton = this.downloadConflictsToResolve == 0;
            if (index1 >= 0)
            {
                this.selectedLV1Items[index1] = false;
                if (index1 < this.selectedLV1Items.Length - 1)
                {
                    this.selectedLV1Items[index1 + 1] = true;
                }
            }
            this.enableMergeButton = this.AtLeastOneSelectedAssetCanBeMerged();
            if (!flag)
            {
                return;
            }
            EditorUtility.DisplayDialog("Some conflicting changes cannot be merged", "Notice that not all selected changes where selected for merging. This happened because not all of them can be merged (e.g. assets are binary or deleted).", "OK");
        }
		internal static extern bool UpdateSetResolutions(string[] guids, DownloadResolution[] resolutions);
		public static extern void SetDownloadResolution(string guid, DownloadResolution res);
Exemple #5
0
        public ASUpdateConflictResolveWindow(string[] conflicting)
        {
            this.downloadConflictsToResolve = 0;
            ArrayList arrayList  = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            ArrayList arrayList3 = new ArrayList();
            ArrayList arrayList4 = new ArrayList();

            for (int i = 0; i < conflicting.Length; i++)
            {
                AssetStatus statusGUID = AssetServer.GetStatusGUID(conflicting[i]);
                if (statusGUID == AssetStatus.Conflict)
                {
                    arrayList.Add(conflicting[i]);
                    DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[i]);
                    arrayList2.Add(downloadResolution);
                    if (downloadResolution == DownloadResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
                if (AssetServer.GetPathNameConflict(conflicting[i]) != null && statusGUID != AssetStatus.ServerOnly)
                {
                    arrayList4.Add(conflicting[i]);
                    NameConflictResolution nameConflictResolution = AssetServer.GetNameConflictResolution(conflicting[i]);
                    arrayList3.Add(nameConflictResolution);
                    if (nameConflictResolution == NameConflictResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
            }
            this.downloadConflicts    = (arrayList.ToArray(typeof(string)) as string[]);
            this.downloadResolutions  = (arrayList2.ToArray(typeof(DownloadResolution)) as DownloadResolution[]);
            this.namingResolutions    = (arrayList3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[]);
            this.nameConflicts        = (arrayList4.ToArray(typeof(string)) as string[]);
            this.enableContinueButton = (this.downloadConflictsToResolve == 0);
            this.dConflictPaths       = new string[this.downloadConflicts.Length];
            this.deletionConflict     = new bool[this.downloadConflicts.Length];
            for (int j = 0; j < this.downloadConflicts.Length; j++)
            {
                if (AssetServer.HasDeletionConflict(this.downloadConflicts[j]))
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = true;
                }
                else
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = false;
                }
            }
            this.dNamingPaths = new string[this.nameConflicts.Length];
            for (int k = 0; k < this.nameConflicts.Length; k++)
            {
                this.dNamingPaths[k] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[k]));
            }
            this.showDownloadConflicts = (this.downloadConflicts.Length > 0);
            this.showNamingConflicts   = (this.nameConflicts.Length > 0);
            this.lv1.totalRows         = this.downloadConflicts.Length;
            this.lv2.totalRows         = this.nameConflicts.Length;
            this.selectedLV1Items      = new bool[this.downloadConflicts.Length];
            this.selectedLV2Items      = new bool[this.nameConflicts.Length];
            this.DoSelectionChange();
        }
 private void ResolveSelectedDownloadConflicts(DownloadResolution res)
 {
   int index1 = -1;
   bool flag = false;
   for (int index2 = 0; index2 < this.downloadConflicts.Length; ++index2)
   {
     if (this.selectedLV1Items[index2])
     {
       string downloadConflict = this.downloadConflicts[index2];
       if (res == DownloadResolution.Merge && (AssetServer.AssetIsBinaryByGUID(downloadConflict) || AssetServer.IsItemDeleted(downloadConflict)))
       {
         flag = true;
       }
       else
       {
         if (res != DownloadResolution.Unresolved)
         {
           if (AssetServer.GetDownloadResolution(downloadConflict) == DownloadResolution.Unresolved)
             --this.downloadConflictsToResolve;
         }
         else
           ++this.downloadConflictsToResolve;
         this.downloadResolutions[index2] = res;
         AssetServer.SetDownloadResolution(downloadConflict, res);
         index1 = index1 != -1 ? -2 : index2;
       }
     }
   }
   this.enableContinueButton = this.downloadConflictsToResolve == 0;
   if (index1 >= 0)
   {
     this.selectedLV1Items[index1] = false;
     if (index1 < this.selectedLV1Items.Length - 1)
       this.selectedLV1Items[index1 + 1] = true;
   }
   this.enableMergeButton = this.AtLeastOneSelectedAssetCanBeMerged();
   if (!flag)
     return;
   EditorUtility.DisplayDialog("Some conflicting changes cannot be merged", "Notice that not all selected changes where selected for merging. This happened because not all of them can be merged (e.g. assets are binary or deleted).", "OK");
 }
Exemple #7
0
 public static extern void SetDownloadResolution(string guid, DownloadResolution res);
 private void ResolveSelectedDownloadConflicts(DownloadResolution res)
 {
     int index = -1;
     bool flag = false;
     for (int i = 0; i < this.downloadConflicts.Length; i++)
     {
         if (this.selectedLV1Items[i])
         {
             string guid = this.downloadConflicts[i];
             if ((res == DownloadResolution.Merge) && (AssetServer.AssetIsBinaryByGUID(guid) || AssetServer.IsItemDeleted(guid)))
             {
                 flag = true;
             }
             else
             {
                 if (res != DownloadResolution.Unresolved)
                 {
                     if (AssetServer.GetDownloadResolution(guid) == DownloadResolution.Unresolved)
                     {
                         this.downloadConflictsToResolve--;
                     }
                 }
                 else
                 {
                     this.downloadConflictsToResolve++;
                 }
                 this.downloadResolutions[i] = res;
                 AssetServer.SetDownloadResolution(guid, res);
                 index = (index != -1) ? -2 : i;
             }
         }
     }
     this.enableContinueButton = this.downloadConflictsToResolve == 0;
     if (index >= 0)
     {
         this.selectedLV1Items[index] = false;
         if (index < (this.selectedLV1Items.Length - 1))
         {
             this.selectedLV1Items[index + 1] = true;
         }
     }
     this.enableMergeButton = this.AtLeastOneSelectedAssetCanBeMerged();
     if (flag)
     {
         EditorUtility.DisplayDialog("Some conflicting changes cannot be merged", "Notice that not all selected changes where selected for merging. This happened because not all of them can be merged (e.g. assets are binary or deleted).", "OK");
     }
 }
Exemple #9
0
        public ASUpdateConflictResolveWindow(string[] conflicting)
        {
            float[] relativeSizes = new float[] { 20f, 80f };
            int[]   minSizes      = new int[] { 100, 100 };
            this.lvHeaderSplit1 = new SplitterState(relativeSizes, minSizes, null);
            float[] singleArray2 = new float[] { 20f, 80f };
            int[]   numArray2    = new int[] { 100, 100 };
            this.lvHeaderSplit2             = new SplitterState(singleArray2, numArray2, null);
            this.dropDownMenuItems          = new string[] { "Compare", "Compare Binary" };
            this.downloadConflicts          = new string[0];
            this.nameConflicts              = new string[0];
            this.dConflictPaths             = new string[0];
            this.dNamingPaths               = new string[0];
            this.downloadResolutions        = new DownloadResolution[0];
            this.namingResolutions          = new NameConflictResolution[0];
            this.enableMergeButton          = true;
            this.iconSize                   = new Vector2(16f, 16f);
            this.downloadResolutionString   = new string[] { "Unresolved", "Skip Asset", "Discard My Changes", "Ignore Server Changes", "Merge" };
            this.namingResolutionString     = new string[] { "Unresolved", "Rename Local Asset", "Rename Server Asset" };
            this.downloadConflictsToResolve = 0;
            ArrayList list  = new ArrayList();
            ArrayList list2 = new ArrayList();
            ArrayList list3 = new ArrayList();
            ArrayList list4 = new ArrayList();

            for (int i = 0; i < conflicting.Length; i++)
            {
                AssetStatus statusGUID = AssetServer.GetStatusGUID(conflicting[i]);
                if (statusGUID == AssetStatus.Conflict)
                {
                    list.Add(conflicting[i]);
                    DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[i]);
                    list2.Add(downloadResolution);
                    if (downloadResolution == DownloadResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
                if ((AssetServer.GetPathNameConflict(conflicting[i]) != null) && (statusGUID != AssetStatus.ServerOnly))
                {
                    list4.Add(conflicting[i]);
                    NameConflictResolution nameConflictResolution = AssetServer.GetNameConflictResolution(conflicting[i]);
                    list3.Add(nameConflictResolution);
                    if (nameConflictResolution == NameConflictResolution.Unresolved)
                    {
                        this.downloadConflictsToResolve++;
                    }
                }
            }
            this.downloadConflicts    = list.ToArray(typeof(string)) as string[];
            this.downloadResolutions  = list2.ToArray(typeof(DownloadResolution)) as DownloadResolution[];
            this.namingResolutions    = list3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[];
            this.nameConflicts        = list4.ToArray(typeof(string)) as string[];
            this.enableContinueButton = this.downloadConflictsToResolve == 0;
            this.dConflictPaths       = new string[this.downloadConflicts.Length];
            this.deletionConflict     = new bool[this.downloadConflicts.Length];
            for (int j = 0; j < this.downloadConflicts.Length; j++)
            {
                if (AssetServer.HasDeletionConflict(this.downloadConflicts[j]))
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = true;
                }
                else
                {
                    this.dConflictPaths[j]   = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[j]));
                    this.deletionConflict[j] = false;
                }
            }
            this.dNamingPaths = new string[this.nameConflicts.Length];
            for (int k = 0; k < this.nameConflicts.Length; k++)
            {
                this.dNamingPaths[k] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[k]));
            }
            this.showDownloadConflicts = this.downloadConflicts.Length > 0;
            this.showNamingConflicts   = this.nameConflicts.Length > 0;
            this.lv1.totalRows         = this.downloadConflicts.Length;
            this.lv2.totalRows         = this.nameConflicts.Length;
            this.selectedLV1Items      = new bool[this.downloadConflicts.Length];
            this.selectedLV2Items      = new bool[this.nameConflicts.Length];
            this.DoSelectionChange();
        }
        public ASUpdateConflictResolveWindow(string[] conflicting)
        {
            this.downloadConflictsToResolve = 0;
            ArrayList arrayList1 = new ArrayList();
            ArrayList arrayList2 = new ArrayList();
            ArrayList arrayList3 = new ArrayList();
            ArrayList arrayList4 = new ArrayList();

            for (int index = 0; index < conflicting.Length; ++index)
            {
                AssetStatus statusGuid = AssetServer.GetStatusGUID(conflicting[index]);
                if (statusGuid == AssetStatus.Conflict)
                {
                    arrayList1.Add((object)conflicting[index]);
                    DownloadResolution downloadResolution = AssetServer.GetDownloadResolution(conflicting[index]);
                    arrayList2.Add((object)downloadResolution);
                    if (downloadResolution == DownloadResolution.Unresolved)
                    {
                        ++this.downloadConflictsToResolve;
                    }
                }
                if (AssetServer.GetPathNameConflict(conflicting[index]) != null && statusGuid != AssetStatus.ServerOnly)
                {
                    arrayList4.Add((object)conflicting[index]);
                    NameConflictResolution conflictResolution = AssetServer.GetNameConflictResolution(conflicting[index]);
                    arrayList3.Add((object)conflictResolution);
                    if (conflictResolution == NameConflictResolution.Unresolved)
                    {
                        ++this.downloadConflictsToResolve;
                    }
                }
            }
            this.downloadConflicts    = arrayList1.ToArray(typeof(string)) as string[];
            this.downloadResolutions  = arrayList2.ToArray(typeof(DownloadResolution)) as DownloadResolution[];
            this.namingResolutions    = arrayList3.ToArray(typeof(NameConflictResolution)) as NameConflictResolution[];
            this.nameConflicts        = arrayList4.ToArray(typeof(string)) as string[];
            this.enableContinueButton = this.downloadConflictsToResolve == 0;
            this.dConflictPaths       = new string[this.downloadConflicts.Length];
            this.deletionConflict     = new bool[this.downloadConflicts.Length];
            for (int index = 0; index < this.downloadConflicts.Length; ++index)
            {
                if (AssetServer.HasDeletionConflict(this.downloadConflicts[index]))
                {
                    this.dConflictPaths[index]   = ParentViewFolder.MakeNiceName(AssetServer.GetDeletedItemPathAndName(this.downloadConflicts[index]));
                    this.deletionConflict[index] = true;
                }
                else
                {
                    this.dConflictPaths[index]   = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.downloadConflicts[index]));
                    this.deletionConflict[index] = false;
                }
            }
            this.dNamingPaths = new string[this.nameConflicts.Length];
            for (int index = 0; index < this.nameConflicts.Length; ++index)
            {
                this.dNamingPaths[index] = ParentViewFolder.MakeNiceName(AssetServer.GetAssetPathName(this.nameConflicts[index]));
            }
            this.showDownloadConflicts = this.downloadConflicts.Length > 0;
            this.showNamingConflicts   = this.nameConflicts.Length > 0;
            this.lv1.totalRows         = this.downloadConflicts.Length;
            this.lv2.totalRows         = this.nameConflicts.Length;
            this.selectedLV1Items      = new bool[this.downloadConflicts.Length];
            this.selectedLV2Items      = new bool[this.nameConflicts.Length];
            this.DoSelectionChange();
        }