Esempio n. 1
0
 public void UpdateCollabToolbarState()
 {
     if (Collab.instance.GetCollabInfo().whitelisted)
     {
         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;
             bool       flag2      = instance.JobRunning(0);
             CollabInfo collabInfo = instance.collabInfo;
             if (!collabInfo.ready)
             {
                 collabToolbarState = Toolbar.CollabToolbarState.InProgress;
             }
             else if (collabInfo.error)
             {
                 collabToolbarState    = Toolbar.CollabToolbarState.OperationError;
                 this.m_DynamicTooltip = "Last operation failed. " + collabInfo.lastErrorMsg;
             }
             else if (flag2)
             {
                 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();
         }
     }
 }
Esempio n. 2
0
        public void UpdateCollabToolbarState()
        {
            Toolbar.CollabToolbarState collabToolbarState = Toolbar.CollabToolbarState.UpToDate;
            Collab     instance   = Collab.instance;
            bool       flag       = instance.JobRunning(0);
            CollabInfo collabInfo = instance.collabInfo;

            this.m_DynamicTooltip = string.Empty;
            if (!Collab.instance.collabInfo.whitelisted)
            {
                this.m_DynamicTooltip = "Please check that this project is part of an organization that has been accepted into the collaborate beta.\r\n\r\nGo to Services > Settings > Organization and change your project Organization to the one that has been accepted into the Collaborate beta.";
                collabToolbarState    = Toolbar.CollabToolbarState.Disabled;
            }
            else if (!collabInfo.ready)
            {
                collabToolbarState = Toolbar.CollabToolbarState.InProgress;
            }
            else if (collabInfo.error)
            {
                collabToolbarState    = Toolbar.CollabToolbarState.OperationError;
                this.m_DynamicTooltip = "Last operation failed. " + collabInfo.lastErrorMsg;
            }
            else if (flag)
            {
                collabToolbarState = Toolbar.CollabToolbarState.InProgress;
            }
            else
            {
                bool flag2 = CollabAccess.Instance.IsServiceEnabled();
                if (!UnityConnect.instance.projectInfo.projectBound || !flag2)
                {
                    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;
                }
            }
            if (collabToolbarState != this.m_CollabToolbarState || CollabToolbarWindow.s_ToolbarIsVisible == Toolbar.m_ShowCollabTooltip)
            {
                this.m_CollabToolbarState   = collabToolbarState;
                Toolbar.m_ShowCollabTooltip = !CollabToolbarWindow.s_ToolbarIsVisible;
                Toolbar.RepaintToolbar();
            }
        }
Esempio n. 3
0
        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();
            }
        }