Example #1
0
        private void SetupElement(int openGroup)
        {
            bool flag = this.CurrentElementRoot == null;

            if (this.CurrentElementRoot != null && this.CurrentElementRoot.Item1 != openGroup)
            {
                this.FadeOutRoot(this.CurrentElementRoot);
                this.CurrentElementRoot = (Tuple <int, CanvasGroup, IDisposable>)null;
            }
            List <TutorialUIElement> tutorialUiElementList;

            if (!this.ElementTable.TryGetValue(openGroup, out tutorialUiElementList))
            {
                this.SetActive((Component)this._rightButton, false);
                this.SetActive((Component)this._leftButton, false);
                this.SetActive((Component)this._closeButton, !this.OpenGroupEnabled);
            }
            else
            {
                this.ElementRootTable.TryGetValue(openGroup, out this.CurrentElementRoot);
                if (this.CurrentElementRoot != null)
                {
                    if (flag)
                    {
                        this.CurrentElementRoot.Item3?.Dispose();
                        this.CurrentElementRoot.Item2.set_alpha(1f);
                    }
                    else
                    {
                        this.FadeInRoot(this.CurrentElementRoot);
                    }
                    ((Component)this.CurrentElementRoot.Item2)?.get_transform()?.SetAsLastSibling();
                }
                this._currentElementList = tutorialUiElementList;
                if (!this._currentElementList.IsNullOrEmpty <TutorialUIElement>())
                {
                    for (int index = 0; index < this._currentElementList.Count; ++index)
                    {
                        TutorialUIElement element = this._currentElementList.GetElement <TutorialUIElement>(index);
                        if (!Object.op_Equality((Object)element, (Object)null))
                        {
                            element.CanvasAlpha = index != 0 || flag ? 0.0f : 1f;
                            if (Object.op_Inequality((Object)element.BackImage, (Object)null))
                            {
                                Color color = ((Graphic)element.BackImage).get_color();
                                color.a = (__Null)((double)this._elementBackImageAlpha / (double)byte.MaxValue);
                                ((Graphic)element.BackImage).set_color(color);
                            }
                        }
                    }
                }
                this.PageMove(0);
            }
        }
Example #2
0
 private void AllClose()
 {
     this.CloseAllRoot();
     foreach (KeyValuePair <int, List <TutorialUIElement> > keyValuePair in this.ElementTable)
     {
         if (!keyValuePair.Value.IsNullOrEmpty <TutorialUIElement>())
         {
             foreach (TutorialUIElement tutorialUiElement in keyValuePair.Value)
             {
                 tutorialUiElement.CloseForced();
             }
         }
     }
     this._currentElement = (TutorialUIElement)null;
 }
Example #3
0
        private void PageMove(int moveIndex)
        {
            int openIndex = this.OpenIndex;
            int idx       = this.OpenIndex + moveIndex;
            List <TutorialUIElement> currentElementList = this._currentElementList;

            if (!this.ListRange <TutorialUIElement>(currentElementList, idx))
            {
                return;
            }
            this.OpenIndex = idx;
            if (openIndex == this.OpenIndex)
            {
                if (this._currentElement != null)
                {
                    this._currentElement.Close(this._pageFadeTime, 0.0f);
                }
                this._currentElement = currentElementList.GetElement <TutorialUIElement>(this.OpenIndex);
                if (this._currentElement != null)
                {
                    this._currentElement.Open(this._pageFadeTime, 0.0f);
                }
            }
            else
            {
                this.PlaySE(SoundPack.SystemSE.Page);
                float moveX = this._pageMoveX * Mathf.Sign((float)moveIndex);
                if (this._currentElement != null)
                {
                    this._currentElement.Close(this._pageFadeTime, moveX);
                }
                this._currentElement = currentElementList.GetElement <TutorialUIElement>(this.OpenIndex);
                if (this._currentElement != null)
                {
                    this._currentElement.Open(this._pageFadeTime, moveX);
                }
            }
            bool flag1 = this.ListRange <TutorialUIElement>(currentElementList, this.OpenIndex - 1);
            bool flag2 = this.ListRange <TutorialUIElement>(currentElementList, this.OpenIndex + 1);

            if (!flag1 && !flag2)
            {
                this.SetActive((Component)this._rightButton, false);
                this.SetActive((Component)this._leftButton, false);
                this.SetActive((Component)this._closeButton, !this.OpenGroupEnabled);
            }
            else if (flag1 && flag2)
            {
                this.SetActive((Component)this._rightButton, true);
                this.SetActive((Component)this._leftButton, true);
                this.SetActive((Component)this._closeButton, false);
            }
            else if (flag2)
            {
                this.SetActive((Component)this._rightButton, true);
                this.SetActive((Component)this._leftButton, false);
                this.SetActive((Component)this._closeButton, false);
            }
            else
            {
                if (!flag1)
                {
                    return;
                }
                this.SetActive((Component)this._rightButton, false);
                this.SetActive((Component)this._leftButton, true);
                this.SetActive((Component)this._closeButton, !this.OpenGroupEnabled);
            }
        }