private void DoCommit()
 {
   if (this.commitMessage == string.Empty && !EditorUtility.DisplayDialog("Commit without description", "Are you sure you want to commit with empty commit description message?", "Commit", "Cancel"))
     GUIUtility.ExitGUI();
   bool refreshCommit = AssetServer.GetRefreshCommit();
   ASCommitWindow asCommitWindow = new ASCommitWindow(this, ASCommitWindow.GetParentViewSelectedItems(this.pv, true, false).ToArray());
   asCommitWindow.InitiateReinit();
   if ((refreshCommit || asCommitWindow.lastTransferMovedDependencies) && (!refreshCommit && !EditorUtility.DisplayDialog("Committing with dependencies", "Assets selected for committing have dependencies that will also be committed. Press Details to view full changeset", "Commit", "Details") || refreshCommit))
   {
     this.committing = false;
     this.selectedPage = ASMainWindow.Page.Commit;
     asCommitWindow.description = this.commitMessage;
     if (refreshCommit)
       asCommitWindow.showReinitedWarning = 1;
     this.asCommitWin = asCommitWindow;
     this.Repaint();
     GUIUtility.ExitGUI();
   }
   else
   {
     string[] itemsToCommit = asCommitWindow.GetItemsToCommit();
     AssetServer.SetAfterActionFinishedCallback("ASEditorBackend", "CBOverviewsCommitFinished");
     AssetServer.DoCommitOnNextTick(this.commitMessage, itemsToCommit);
     AssetServer.SetLastCommitMessage(this.commitMessage);
     asCommitWindow.AddToCommitMessageHistory(this.commitMessage);
     this.committing = false;
     GUIUtility.ExitGUI();
   }
 }
 private void SwitchSelectedPage(ASMainWindow.Page page)
 {
   ASMainWindow.Page selectedPage = this.selectedPage;
   this.selectedPage = page;
   this.SelectedPageChanged();
   if (!this.error)
     return;
   this.selectedPage = selectedPage;
   this.error = false;
 }
 private void ShortUpdateList()
 {
   GUILayout.BeginVertical(!this.showSmallWindow ? ASMainWindow.constants.groupBox : ASMainWindow.constants.groupBoxNoMargin, new GUILayoutOption[0]);
   GUILayout.Label("Updates on Server", ASMainWindow.constants.title, new GUILayoutOption[0]);
   if (this.sharedChangesets == null)
   {
     GUILayout.BeginVertical(ASMainWindow.constants.contentBox, GUILayout.ExpandHeight(true));
     GUILayout.Label("Could not retrieve changes");
     GUILayout.EndVertical();
   }
   else if (this.sharedChangesets.Length == 0)
   {
     GUILayout.BeginVertical(ASMainWindow.constants.contentBox, GUILayout.ExpandHeight(true));
     GUILayout.Label("You are up to date");
     GUILayout.EndVertical();
   }
   else
   {
     this.lv.totalRows = this.sharedChangesets.Length;
     int num = (int) ASMainWindow.constants.entryNormal.CalcHeight(new GUIContent("X"), 100f);
     ASMainWindow.constants.serverUpdateLog.alignment = TextAnchor.MiddleLeft;
     ASMainWindow.constants.serverUpdateInfo.alignment = TextAnchor.MiddleLeft;
     foreach (ListViewElement listViewElement in ListViewGUILayout.ListView(this.lv, ASMainWindow.constants.background))
     {
       Rect rect = GUILayoutUtility.GetRect(GUIClip.visibleRect.width, (float) num, new GUILayoutOption[1]{ GUILayout.MinHeight((float) num) });
       Rect position = rect;
       ++position.x;
       ++position.y;
       if (listViewElement.row % 2 == 0)
       {
         if (Event.current.type == EventType.Repaint)
           ASMainWindow.constants.entryEven.Draw(position, false, false, false, false);
         position.y += rect.height;
         if (Event.current.type == EventType.Repaint)
           ASMainWindow.constants.entryOdd.Draw(position, false, false, false, false);
       }
       position = rect;
       position.width -= (float) (this.maxNickLength + 25);
       position.x += 10f;
       GUI.Button(position, this.changesetContents[listViewElement.row], ASMainWindow.constants.serverUpdateLog);
       position = rect;
       position.x += (float) ((double) position.width - (double) this.maxNickLength - 5.0);
       GUI.Label(position, this.sharedChangesets[listViewElement.row].owner, ASMainWindow.constants.serverUpdateInfo);
     }
     ASMainWindow.constants.serverUpdateLog.alignment = TextAnchor.UpperLeft;
     ASMainWindow.constants.serverUpdateInfo.alignment = TextAnchor.UpperLeft;
     GUILayout.BeginHorizontal(ASMainWindow.constants.contentBox, new GUILayoutOption[0]);
     GUILayout.FlexibleSpace();
     if (GUILayout.Button("Update", ASMainWindow.constants.smallButton, new GUILayoutOption[0]))
     {
       this.selectedPage = ASMainWindow.Page.Update;
       this.InitUpdatePage(true);
       this.asUpdateWin.DoUpdate(false);
     }
     if (GUILayout.Button("Details", ASMainWindow.constants.smallButton, new GUILayoutOption[0]))
     {
       this.SwitchSelectedPage(ASMainWindow.Page.Update);
       this.Repaint();
       GUIUtility.ExitGUI();
     }
     GUILayout.EndHorizontal();
   }
   GUILayout.EndVertical();
 }
 public void RevertProject(int toRevision, Changeset[] changesets)
 {
   AssetServer.SetStickyChangeset(toRevision);
   this.asUpdateWin = new ASUpdateWindow(this, changesets);
   this.asUpdateWin.SetSelectedRevisionLine(0);
   this.asUpdateWin.DoUpdate(false);
   this.selectedPage = ASMainWindow.Page.Update;
 }
示例#5
0
		private void SwitchSelectedPage(ASMainWindow.Page page)
		{
			ASMainWindow.Page page2 = this.selectedPage;
			this.selectedPage = page;
			this.SelectedPageChanged();
			if (this.error)
			{
				this.selectedPage = page2;
				this.error = false;
			}
		}