public void UpdateCollabToolbarState() { Toolbar.CollabToolbarState collabToolbarState = Toolbar.CollabToolbarState.UpToDate; bool flag = UnityConnect.instance.connectInfo.online && UnityConnect.instance.connectInfo.loggedIn; this.m_DynamicTooltip = ""; if (flag) { Collab instance = Collab.instance; CollabInfo collabInfo = instance.collabInfo; int num = 0; int num2 = 4; int num3 = 2; string text = ""; string dynamicTooltip = ""; bool flag2 = false; if (instance.GetError(5, out num, out num2, out num3, out text, out dynamicTooltip)) { flag2 = (num2 <= 1); this.m_DynamicTooltip = dynamicTooltip; } if (!collabInfo.ready) { collabToolbarState = Toolbar.CollabToolbarState.InProgress; } else if (flag2) { collabToolbarState = Toolbar.CollabToolbarState.OperationError; } else if (collabInfo.inProgress) { collabToolbarState = Toolbar.CollabToolbarState.InProgress; } else { bool flag3 = CollabAccess.Instance.IsServiceEnabled(); if (!UnityConnect.instance.projectInfo.projectBound || !flag3) { collabToolbarState = Toolbar.CollabToolbarState.NeedToEnableCollab; } else if (collabInfo.update) { collabToolbarState = Toolbar.CollabToolbarState.ServerHasChanges; } else if (collabInfo.conflict) { collabToolbarState = Toolbar.CollabToolbarState.Conflict; } else if (collabInfo.publish) { collabToolbarState = Toolbar.CollabToolbarState.FilesToPush; } } } else { collabToolbarState = Toolbar.CollabToolbarState.Offline; } if (collabToolbarState != this.m_CollabToolbarState || CollabToolbarWindow.s_ToolbarIsVisible == Toolbar.m_ShowCollabTooltip) { this.m_CollabToolbarState = collabToolbarState; Toolbar.m_ShowCollabTooltip = !CollabToolbarWindow.s_ToolbarIsVisible; Toolbar.RepaintToolbar(); } }
public void UpdateCollabToolbarState() { var currentCollabState = CollabToolbarState.UpToDate; bool networkAvailable = UnityConnect.instance.connectInfo.online && UnityConnect.instance.connectInfo.loggedIn; m_DynamicTooltip = ""; if (UnityConnect.instance.isDisableCollabWindow) { currentCollabState = CollabToolbarState.Disabled; } else if (networkAvailable) { Collab collab = Collab.instance; CollabInfo currentInfo = collab.collabInfo; UnityErrorInfo errInfo; bool error = false; if (collab.GetError(UnityConnect.UnityErrorFilter.ByContext | UnityConnect.UnityErrorFilter.ByChild, out errInfo)) { error = errInfo.priority <= (int)UnityConnect.UnityErrorPriority.Error; m_DynamicTooltip = errInfo.shortMsg; } if (!currentInfo.ready) { currentCollabState = CollabToolbarState.InProgress; } else if (error) { currentCollabState = CollabToolbarState.OperationError; } else if (currentInfo.inProgress) { currentCollabState = CollabToolbarState.InProgress; } else if (m_IsGettingChanges) { currentCollabState = CollabToolbarState.InProgress; } else { bool collabEnable = Collab.instance.IsCollabEnabledForCurrentProject(); if (UnityConnect.instance.projectInfo.projectBound == false || !collabEnable) { currentCollabState = CollabToolbarState.NeedToEnableCollab; } else if (currentInfo.update) { currentCollabState = CollabToolbarState.ServerHasChanges; } else if (currentInfo.conflict) { currentCollabState = CollabToolbarState.Conflict; } else if (currentInfo.publish) { currentCollabState = CollabToolbarState.FilesToPush; } } } else { currentCollabState = CollabToolbarState.Offline; } if (Collab.IsToolbarVisible == null || currentCollabState == m_CollabToolbarState && Collab.IsToolbarVisible() != m_ShowCollabTooltip) { return; } m_CollabToolbarState = currentCollabState; m_ShowCollabTooltip = !Collab.IsToolbarVisible(); Toolbar.RepaintToolbar(); }
public void UpdateCollabToolbarState() { var currentCollabState = CollabToolbarState.UpToDate; bool networkAvailable = UnityConnect.instance.connectInfo.online && UnityConnect.instance.connectInfo.loggedIn; m_DynamicTooltip = ""; if (networkAvailable) { Collab collab = Collab.instance; CollabInfo currentInfo = collab.collabInfo; int errorCode = 0; int errorPriority = (int)UnityConnect.UnityErrorPriority.None; int errorBehaviour = (int)UnityConnect.UnityErrorBehaviour.Hidden; string errorMsg = ""; string errorShortMsg = ""; bool error = false; if (collab.GetError((int)(UnityConnect.UnityErrorFilter.ByContext | UnityConnect.UnityErrorFilter.ByChild), out errorCode, out errorPriority, out errorBehaviour, out errorMsg, out errorShortMsg)) { error = (errorPriority <= (int)UnityConnect.UnityErrorPriority.Error); m_DynamicTooltip = errorShortMsg; } if (!currentInfo.ready) { currentCollabState = CollabToolbarState.InProgress; } else if (error) { currentCollabState = CollabToolbarState.OperationError; } else if (currentInfo.inProgress) { currentCollabState = CollabToolbarState.InProgress; } else { bool collabEnable = Collab.instance.IsCollabEnabledForCurrentProject(); if (UnityConnect.instance.projectInfo.projectBound == false || !collabEnable) { currentCollabState = CollabToolbarState.NeedToEnableCollab; } else if (currentInfo.update) { currentCollabState = CollabToolbarState.ServerHasChanges; } else if (currentInfo.conflict) { currentCollabState = CollabToolbarState.Conflict; } else if (currentInfo.publish) { currentCollabState = CollabToolbarState.FilesToPush; } } } else { currentCollabState = CollabToolbarState.Offline; } if (currentCollabState != m_CollabToolbarState || CollabToolbarWindow.s_ToolbarIsVisible == m_ShowCollabTooltip) { m_CollabToolbarState = currentCollabState; m_ShowCollabTooltip = !CollabToolbarWindow.s_ToolbarIsVisible; RepaintToolbar(); } }