Пример #1
0
        private void CreateSingleButtonTemplate()
        {
            GeneralDialogContext context2 = new GeneralDialogContext {
                type  = GeneralDialogContext.ButtonType.SingleButton,
                title = "TestUI",
                desc  = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0])
            };
            BaseDialogContext dialogContext = context2;

            Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
        }
Пример #2
0
        public InLevelGiveUpConfirmDialogContext(BaseDialogContext fromDialogContext, Action giveUpCallBack = null)
        {
            ContextPattern pattern = new ContextPattern {
                contextName    = "InLevelGiveUpConfirmDialogContext",
                viewPrefabPath = "UI/Menus/Dialog/InLevelGiveUpConfirmDialog"
            };

            base.config             = pattern;
            this._fromDialogContext = fromDialogContext;
            this._giveUpCallBack    = giveUpCallBack;
        }
Пример #3
0
        private void CheckAndSetNewbieDialogAvailable()
        {
            NewbieDialogContext context = null;

            if (this is NewbieDialogContext)
            {
                context = (NewbieDialogContext)this;
            }
            else if (this.pageContext != null)
            {
                context = this.pageContext.TryToGetNewbieDialogContext();
            }
            if ((context != null) && (context.view != null))
            {
                Transform transform = null;
                if (this.pageContext.dialogContextList.Count > 0)
                {
                    List <BaseDialogContext> list = new List <BaseDialogContext>();
                    list.AddRange(this.pageContext.dialogContextList);
                    list.Reverse();
                    foreach (BaseDialogContext context2 in list)
                    {
                        if (((context2 != null) && (context2.view != null)) && ((context2.view.transform != null) && (context2.view.transform.gameObject != null)))
                        {
                            transform = context2.view.transform;
                            break;
                        }
                    }
                }
                if (context.view.transform != transform)
                {
                    context.SetAvailable(false);
                }
                else if (!this.pageContext.CheckHasDialogExceptNewbie(false))
                {
                    context.SetAvailable(true);
                }
                else
                {
                    if (context.referredContext != null)
                    {
                        BaseDialogContext        context3 = null;
                        List <BaseDialogContext> list2    = new List <BaseDialogContext>();
                        list2.AddRange(this.pageContext.dialogContextList);
                        list2.Reverse();
                        foreach (BaseDialogContext context4 in list2)
                        {
                            if (!(context4 is NewbieDialogContext))
                            {
                                context3 = context4;
                                break;
                            }
                        }
                        if (context3 == context.referredContext)
                        {
                            context.SetAvailable(true);
                            return;
                        }
                    }
                    context.SetAvailable(false);
                }
            }
        }