public ASUpdateWindow(ASMainWindow parentWin, Changeset[] changesets) { this.changesets = changesets; this.parentWin = parentWin; this.lv = new ListViewState(changesets.Length, 5); this.pv.lv = new ListViewState(0, 5); this.messageFirstLines = new string[changesets.Length]; for (int index = 0; index < changesets.Length; ++index) this.messageFirstLines[index] = changesets[index].message.Split('\n')[0]; this.totalUpdates = changesets.Length.ToString() + (changesets.Length != 1 ? " Updates" : " Update"); }
public ASUpdateWindow(ASMainWindow parentWin, Changeset[] changesets) { this.changesets = changesets; this.parentWin = parentWin; this.lv = new ListViewState(changesets.Length, 5); this.pv.lv = new ListViewState(0, 5); this.messageFirstLines = new string[changesets.Length]; for (int i = 0; i < changesets.Length; i++) { this.messageFirstLines[i] = changesets[i].message.Split(new char[] { '\n' })[0]; } this.totalUpdates = changesets.Length.ToString() + ((changesets.Length != 1) ? " Updates" : " Update"); }
public ASUpdateWindow(ASMainWindow parentWin, Changeset[] changesets) { float[] relativeSizes = new float[] { 50f, 50f }; int[] minSizes = new int[] { 50, 50 }; this.horSplit = new SplitterState(relativeSizes, minSizes, null); float[] singleArray2 = new float[] { 60f, 30f }; int[] numArray2 = new int[] { 0x20, 0x20 }; this.vertSplit = new SplitterState(singleArray2, numArray2, null); this.changesets = changesets; this.parentWin = parentWin; this.lv = new ListViewState(changesets.Length, 5); this.pv.lv = new ListViewState(0, 5); this.messageFirstLines = new string[changesets.Length]; for (int i = 0; i < changesets.Length; i++) { char[] separator = new char[] { '\n' }; this.messageFirstLines[i] = changesets[i].message.Split(separator)[0]; } this.totalUpdates = changesets.Length.ToString() + ((changesets.Length != 1) ? " Updates" : " Update"); }
public void InitOverviewPage(bool lastActionsResult) { if (!lastActionsResult) { this.needsSetup = true; this.sharedChangesets = (Changeset[]) null; this.sharedCommits = (AssetsItem[]) null; this.sharedDeletedItems = (AssetsItem[]) null; } else { PListConfig plistConfig = new PListConfig("Library/ServerPreferences.plist"); this.connectionString = plistConfig["Maint UserName"] + " @ " + plistConfig["Maint Server"] + " : " + plistConfig["Maint project name"]; if (this.UpdateNeedsRefresh()) this.GetUpdates(); this.needsSetup = this.sharedChangesets == null || AssetServer.HasConnectionError(); this.InitCommits(); this.DisplayedItemsChanged(); } }
private void GetUpdates() { AssetServer.ClearAssetServerError(); this.sharedChangesets = AssetServer.GetNewItems(); Array.Reverse((Array) this.sharedChangesets); this.changesetContents = (GUIContent[]) null; this.maxNickLength = 1; AssetServer.ClearRefreshUpdate(); if (!(AssetServer.GetAssetServerError() != string.Empty)) return; this.sharedChangesets = (Changeset[]) null; }
private void SelectedPageChanged() { AssetServer.ClearAssetServerError(); if (this.committing) this.CancelCommit(); switch (this.selectedPage) { case ASMainWindow.Page.Overview: if (ASEditorBackend.SettingsAreValid()) { AssetServer.CheckForServerUpdates(); if (this.UpdateNeedsRefresh()) { this.InitiateUpdateStatusWithCallback("CBInitOverviewPage"); break; } this.InitOverviewPage(true); break; } this.connectionString = "Asset Server connection for current project is not set up"; this.sharedChangesets = new Changeset[0]; this.changesetContents = new GUIContent[0]; this.needsSetup = true; break; case ASMainWindow.Page.Update: this.InitUpdatePage(true); break; case ASMainWindow.Page.Commit: this.asCommitWin = new ASCommitWindow(this, !this.pvHasSelection ? (string[]) null : ASCommitWindow.GetParentViewSelectedItems(this.pv, true, false).ToArray()); this.asCommitWin.InitiateReinit(); break; case ASMainWindow.Page.History: this.pageTitles[3] = "History"; this.InitHistoryPage(true); break; case ASMainWindow.Page.ServerConfig: this.pageTitles[3] = "Connection"; this.asConfigWin = new ASConfigWindow(this); break; case ASMainWindow.Page.Admin: this.pageTitles[3] = "Administration"; this.asAdminWin = new ASServerAdminWindow(this); if (!this.error) break; break; } }
private void OnDestroy() { this.sharedCommits = (AssetsItem[]) null; this.sharedDeletedItems = (AssetsItem[]) null; this.sharedChangesets = (Changeset[]) null; this.changesetContents = (GUIContent[]) null; if (this.selectedPage != ASMainWindow.Page.Commit) return; this.NotifyClosingCommit(); }
private void WebLikeHistory(bool hasFocus) { if (this.m_Changesets == null) { this.m_Changesets = new Changeset[0]; } if (this.m_GUIItems != null) { this.m_HistoryControlID = GUIUtility.GetControlID(ms_HistoryControlHash, FocusType.Native); this.HandleWebLikeKeyboard(); Event current = Event.current; if (current.GetTypeForControl(this.m_HistoryControlID) == EventType.ValidateCommand) { current.Use(); } else { GUILayout.Space(1f); this.m_ScrollPos = GUILayout.BeginScrollView(this.m_ScrollPos, new GUILayoutOption[0]); int num = 0; GUILayoutUtility.GetRect(1f, (float) (this.m_TotalHeight - 1)); if ((((current.type == EventType.Repaint) || (current.type == EventType.MouseDown)) || (current.type == EventType.MouseUp)) && (this.m_GUIItems != null)) { for (int i = 0; i < this.m_Changesets.Length; i++) { if (this.m_GUIItems[i].inFilter) { if (((num + this.m_GUIItems[i].height) > GUIClip.visibleRect.y) && (num < GUIClip.visibleRect.yMax)) { Rect rect; float num3 = ms_Style.descriptionLabel.CalcHeight(this.m_GUIItems[i].colDescription, float.MaxValue); if (current.type == EventType.Repaint) { if ((this.ChangeLogSelectionRev == this.m_Changesets[i].changeset) && (Event.current.type == EventType.Repaint)) { rect = new Rect(0f, (float) num, GUIClip.visibleRect.width, (float) (this.m_GUIItems[i].height - 10)); ms_Style.selected.Draw(rect, false, false, false, false); } rect = new Rect(0f, (float) (num + 3), GUIClip.visibleRect.width, (float) this.m_GUIItems[i].height); GUI.Label(rect, this.m_GUIItems[i].colAuthor, ms_Style.boldLabel); rect = new Rect(GUIClip.visibleRect.width - 160f, (float) (num + 3), 60f, (float) this.m_GUIItems[i].height); GUI.Label(rect, this.m_GUIItems[i].colRevision, ms_Style.boldLabel); rect.x += 60f; rect.width = 100f; GUI.Label(rect, this.m_GUIItems[i].colDate, ms_Style.boldLabel); rect.x = ms_Style.boldLabel.margin.left; rect.y += this.m_RowHeight; rect.width = GUIClip.visibleRect.width; rect.height = num3; GUI.Label(rect, this.m_GUIItems[i].colDescription, ms_Style.descriptionLabel); rect.y += num3; } rect = new Rect(0f, (num + num3) + this.m_RowHeight, GUIClip.visibleRect.width, (this.m_GUIItems[i].height - num3) - this.m_RowHeight); this.DrawParentView(rect, ref this.m_GUIItems[i], i, hasFocus); if (current.type == EventType.MouseDown) { rect = new Rect(0f, (float) num, GUIClip.visibleRect.width, (float) (this.m_GUIItems[i].height - 10)); if (rect.Contains(current.mousePosition)) { this.ChangeLogSelectionRev = this.m_Changesets[i].changeset; this.m_ChangesetSelectionIndex = i; GUIUtility.keyboardControl = this.m_HistoryControlID; ((ASMainWindow) this.m_ParentWindow).m_SearchToShow = ASMainWindow.ShowSearchField.HistoryList; if (current.button == 1) { GUIUtility.hotControl = 0; rect = new Rect(current.mousePosition.x, current.mousePosition.y, 1f, 1f); EditorUtility.DisplayCustomMenu(rect, this.m_DropDownChangesetMenuItems, -1, new EditorUtility.SelectMenuItemFunction(this.ChangesetContextMenuClick), null); Event.current.Use(); } this.DoScroll(); current.Use(); } } } num += this.m_GUIItems[i].height; } } } else if (this.m_GUIItems == null) { GUILayout.Label(EditorGUIUtility.TextContent("This item is not yet committed to the Asset Server"), new GUILayoutOption[0]); } if (Event.current.type == EventType.Repaint) { this.m_ScrollViewHeight = (int) GUIClip.visibleRect.height; } GUILayout.EndScrollView(); } } }
public void DoLocalSelectionChange() { if (this.m_NextSelectionMine) { this.m_NextSelectionMine = false; } else { UnityEngine.Object[] filtered = Selection.GetFiltered(typeof(UnityEngine.Object), UnityEditor.SelectionMode.Assets); string[] guids = new string[0]; switch (this.m_FileViewWin.SelType) { case ASHistoryFileView.SelectionType.All: if (Selection.objects.Length != 0) { Selection.objects = new UnityEngine.Object[0]; this.m_NextSelectionMine = true; } this.m_SelectedPath = string.Empty; this.m_SelectedGUID = string.Empty; this.ClearLV(); break; case ASHistoryFileView.SelectionType.Items: if (filtered.Length >= 1) { this.m_SelectedPath = AssetDatabase.GetAssetPath(filtered[0]); this.m_SelectedGUID = AssetDatabase.AssetPathToGUID(this.m_SelectedPath); guids = this.m_FileViewWin.GetImplicitProjectViewSelection(); break; } this.m_SelectedPath = string.Empty; this.m_SelectedGUID = string.Empty; this.ClearLV(); return; case ASHistoryFileView.SelectionType.DeletedItemsRoot: if (Selection.objects.Length != 0) { Selection.objects = new UnityEngine.Object[0]; this.m_NextSelectionMine = true; } guids = this.m_FileViewWin.GetAllDeletedItemGUIDs(); if (guids.Length != 0) { break; } this.ClearLV(); return; case ASHistoryFileView.SelectionType.DeletedItems: if (Selection.objects.Length != 0) { Selection.objects = new UnityEngine.Object[0]; this.m_NextSelectionMine = true; } guids = this.m_FileViewWin.GetSelectedDeletedItemGUIDs(); break; } this.m_Changesets = AssetServer.GetHistorySelected(guids); if (this.m_Changesets != null) { this.FilterItems(true); } else { this.ClearLV(); } if (((guids != null) && (this.m_GUIItems != null)) && (guids.Length == 1)) { this.MarkBoldItemsByGUID(this.m_SelectedGUID); } this.m_ParentWindow.Repaint(); } }
private void ClearLV() { this.m_Changesets = new Changeset[0]; this.m_TotalHeight = 5; }
private void OnDestroy() { this.sharedCommits = null; this.sharedDeletedItems = null; this.sharedChangesets = null; this.changesetContents = null; if (this.selectedPage == Page.Commit) { this.NotifyClosingCommit(); } }
public void InitOverviewPage(bool lastActionsResult) { if (!lastActionsResult) { this.needsSetup = true; this.sharedChangesets = null; this.sharedCommits = null; this.sharedDeletedItems = null; } else { PListConfig config = new PListConfig("Library/ServerPreferences.plist"); string[] textArray1 = new string[] { config["Maint UserName"], " @ ", config["Maint Server"], " : ", config["Maint project name"] }; this.connectionString = string.Concat(textArray1); if (this.UpdateNeedsRefresh()) { this.GetUpdates(); } this.needsSetup = (this.sharedChangesets == null) || AssetServer.HasConnectionError(); this.InitCommits(); this.DisplayedItemsChanged(); } }
private void GetUpdates() { AssetServer.ClearAssetServerError(); this.sharedChangesets = AssetServer.GetNewItems(); Array.Reverse(this.sharedChangesets); this.changesetContents = null; this.maxNickLength = 1; AssetServer.ClearRefreshUpdate(); if (AssetServer.GetAssetServerError() != string.Empty) { this.sharedChangesets = null; } }
private void WebLikeHistory(bool hasFocus) { if (this.m_Changesets == null) this.m_Changesets = new Changeset[0]; if (this.m_GUIItems == null) return; this.m_HistoryControlID = GUIUtility.GetControlID(ASHistoryWindow.ms_HistoryControlHash, FocusType.Native); this.HandleWebLikeKeyboard(); Event current = Event.current; if (current.GetTypeForControl(this.m_HistoryControlID) == EventType.ValidateCommand) { current.Use(); } else { GUILayout.Space(1f); this.m_ScrollPos = GUILayout.BeginScrollView(this.m_ScrollPos); int num1 = 0; GUILayoutUtility.GetRect(1f, (float) (this.m_TotalHeight - 1)); if ((current.type == EventType.Repaint || current.type == EventType.MouseDown || current.type == EventType.MouseUp) && this.m_GUIItems != null) { for (int changesetIndex = 0; changesetIndex < this.m_Changesets.Length; ++changesetIndex) { if (this.m_GUIItems[changesetIndex].inFilter) { if ((double) (num1 + this.m_GUIItems[changesetIndex].height) > (double) GUIClip.visibleRect.y && (double) num1 < (double) GUIClip.visibleRect.yMax) { float num2 = ASHistoryWindow.ms_Style.descriptionLabel.CalcHeight(this.m_GUIItems[changesetIndex].colDescription, float.MaxValue); Rect rect; if (current.type == EventType.Repaint) { if (this.ChangeLogSelectionRev == this.m_Changesets[changesetIndex].changeset && Event.current.type == EventType.Repaint) { rect = new Rect(0.0f, (float) num1, GUIClip.visibleRect.width, (float) (this.m_GUIItems[changesetIndex].height - 10)); ASHistoryWindow.ms_Style.selected.Draw(rect, false, false, false, false); } rect = new Rect(0.0f, (float) (num1 + 3), GUIClip.visibleRect.width, (float) this.m_GUIItems[changesetIndex].height); GUI.Label(rect, this.m_GUIItems[changesetIndex].colAuthor, ASHistoryWindow.ms_Style.boldLabel); rect = new Rect(GUIClip.visibleRect.width - 160f, (float) (num1 + 3), 60f, (float) this.m_GUIItems[changesetIndex].height); GUI.Label(rect, this.m_GUIItems[changesetIndex].colRevision, ASHistoryWindow.ms_Style.boldLabel); rect.x += 60f; rect.width = 100f; GUI.Label(rect, this.m_GUIItems[changesetIndex].colDate, ASHistoryWindow.ms_Style.boldLabel); rect.x = (float) ASHistoryWindow.ms_Style.boldLabel.margin.left; rect.y += (float) this.m_RowHeight; rect.width = GUIClip.visibleRect.width; rect.height = num2; GUI.Label(rect, this.m_GUIItems[changesetIndex].colDescription, ASHistoryWindow.ms_Style.descriptionLabel); rect.y += num2; } rect = new Rect(0.0f, (float) num1 + num2 + (float) this.m_RowHeight, GUIClip.visibleRect.width, (float) this.m_GUIItems[changesetIndex].height - num2 - (float) this.m_RowHeight); this.DrawParentView(rect, ref this.m_GUIItems[changesetIndex], changesetIndex, hasFocus); if (current.type == EventType.MouseDown) { rect = new Rect(0.0f, (float) num1, GUIClip.visibleRect.width, (float) (this.m_GUIItems[changesetIndex].height - 10)); if (rect.Contains(current.mousePosition)) { this.ChangeLogSelectionRev = this.m_Changesets[changesetIndex].changeset; this.m_ChangesetSelectionIndex = changesetIndex; GUIUtility.keyboardControl = this.m_HistoryControlID; ((ASMainWindow) this.m_ParentWindow).m_SearchToShow = ASMainWindow.ShowSearchField.HistoryList; if (current.button == 1) { GUIUtility.hotControl = 0; rect = new Rect(current.mousePosition.x, current.mousePosition.y, 1f, 1f); EditorUtility.DisplayCustomMenu(rect, this.m_DropDownChangesetMenuItems, -1, new EditorUtility.SelectMenuItemFunction(this.ChangesetContextMenuClick), (object) null); Event.current.Use(); } this.DoScroll(); current.Use(); } } } num1 += this.m_GUIItems[changesetIndex].height; } } } else if (this.m_GUIItems == null) GUILayout.Label(EditorGUIUtility.TextContent("This item is not yet committed to the Asset Server")); if (Event.current.type == EventType.Repaint) this.m_ScrollViewHeight = (int) GUIClip.visibleRect.height; GUILayout.EndScrollView(); } }