Exemplo n.º 1
0
 public void OnOkBtnClick()
 {
     if (this._resourceList.Count > 0)
     {
         bool flag = false;
         foreach (StorageDataItemBase base2 in this._resourceList)
         {
             if (((base2 is WeaponDataItem) || (base2 is StigmataDataItem)) && (base2.rarity >= 3))
             {
                 flag = true;
                 break;
             }
         }
         if (flag)
         {
             GeneralDialogContext dialogContext = new GeneralDialogContext {
                 type           = GeneralDialogContext.ButtonType.DoubleButton,
                 title          = LocalizationGeneralLogic.GetText("Menu_Tips", new object[0]),
                 desc           = LocalizationGeneralLogic.GetText("Menu_Desc_WillConsume3StarItemHint", new object[0]),
                 buttonCallBack = delegate(bool confirmed) {
                     if (confirmed)
                     {
                         this.DoStartPowerup();
                     }
                 }
             };
             Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
         }
         else
         {
             this.DoStartPowerup();
         }
     }
 }
Exemplo n.º 2
0
        private bool OnSkillPointExchangeRsp(SkillPointExchangeRsp rsp)
        {
            GeneralDialogContext context;

            base.view.transform.Find("SkillTab").GetComponent <MonoAvatarDetailSkillTab>().SetupSkillPoint();
            if (rsp.get_retcode() == null)
            {
                context = new GeneralDialogContext {
                    type  = GeneralDialogContext.ButtonType.SingleButton,
                    title = LocalizationGeneralLogic.GetText("Menu_Title_ExchangeSucc", new object[0])
                };
                object[] replaceParams = new object[] { rsp.get_hcoin_cost(), rsp.get_skill_point_get() };
                context.desc = LocalizationGeneralLogic.GetText("Menu_Desc_SkillPtExchangeRes", replaceParams);
                Singleton <MainUIManager> .Instance.ShowDialog(context, UIType.Any);
            }
            else if (rsp.get_retcode() == 2)
            {
                context = new GeneralDialogContext {
                    type          = GeneralDialogContext.ButtonType.DoubleButton,
                    title         = LocalizationGeneralLogic.GetText("Menu_GoToRecharge", new object[0]),
                    desc          = LocalizationGeneralLogic.GetText("Menu_GoToRechargeDesc", new object[0]),
                    okBtnText     = LocalizationGeneralLogic.GetText("Menu_GoToRecharge", new object[0]),
                    cancelBtnText = LocalizationGeneralLogic.GetText("Menu_GiveUpRecharge", new object[0])
                };
                if (< > f__am$cache9 == null)
                {
Exemplo n.º 3
0
        public void OnOkButtonCallBack()
        {
            if ((this.levelData.LevelType == 1) && (this.levelData.UnlockChanllengeNum > Singleton <LevelModule> .Instance.GetChapterById(this.levelData.ChapterID).GetTotalFinishedChanllengeNum(this.levelData.Diffculty)))
            {
                object[] replaceParams = new object[] { this.levelData.UnlockChanllengeNum };
                Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_ChallengeLackLock", replaceParams), 2f), UIType.Any);
            }
            else if (this.levelData.isDropActivityOpen && (this.levelData.dropActivityEndTime <= TimeUtil.Now))
            {
                GeneralDialogContext dialogContext = new GeneralDialogContext {
                    type           = GeneralDialogContext.ButtonType.DoubleButton,
                    desc           = LocalizationGeneralLogic.GetText("Menu_Desc_LevelDropActivityEndHint", new object[0]),
                    buttonCallBack = delegate(bool confirmed) {
                        if (confirmed)
                        {
                            this.EnterPreparePage();
                        }
                    }
                };
                Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);

                this.SetupView();
            }
            else
            {
                this.EnterPreparePage();
            }
        }
Exemplo n.º 4
0
 public void OnBuyBtnClick()
 {
     if (Singleton <AccountManager> .Instance.manager.IsAccountBind() || Singleton <NetworkManager> .Instance.DispatchSeverData.isReview)
     {
         this.DoBuyHcoin();
     }
     else
     {
         GeneralDialogContext dialogContext = new GeneralDialogContext {
             type                   = GeneralDialogContext.ButtonType.DoubleButton,
             title                  = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]),
             desc                   = LocalizationGeneralLogic.GetText("Menu_Action_TouristeCharge", new object[0]),
             okBtnText              = LocalizationGeneralLogic.GetText("Menu_Action_DoBindAccount", new object[0]),
             cancelBtnText          = LocalizationGeneralLogic.GetText("Menu_Action_ContinueRecharge", new object[0]),
             notDestroyAfterTouchBG = true,
             buttonCallBack         = delegate(bool confirmed) {
                 if (confirmed)
                 {
                     Singleton <MainUIManager> .Instance.ShowPage(new PlayerProfilePageContext(PlayerProfilePageContext.TabType.AccountTab), UIType.Page);
                 }
                 else
                 {
                     this.DoBuyHcoin();
                 }
             }
         };
         Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
     }
 }
Exemplo n.º 5
0
 public void OnOkBtnClick()
 {
     if (this._selectedItem != null)
     {
         if (this._selectedItem.rarity > 3)
         {
             GeneralDialogContext dialogContext = new GeneralDialogContext {
                 type           = GeneralDialogContext.ButtonType.DoubleButton,
                 title          = LocalizationGeneralLogic.GetText("Menu_Tips", new object[0]),
                 desc           = LocalizationGeneralLogic.GetText("Menu_Desc_WillConsume3StarItemHint", new object[0]),
                 buttonCallBack = delegate(bool confirmed) {
                     if (confirmed)
                     {
                         Singleton <NetworkManager> .Instance.RequestFeedStigmataAffix(this.stigmata.uid, this._selectedItem.uid);
                     }
                 }
             };
             Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
         }
         else
         {
             Singleton <NetworkManager> .Instance.RequestFeedStigmataAffix(this.stigmata.uid, this._selectedItem.uid);
         }
     }
 }
Exemplo n.º 6
0
        public void OnGalTouchInfoChanged(int oldGoodFeel, int oldHeartLevel, int newGoodFeel, int newHeartLevel, GoodFeelLimitType limitType)
        {
            if (this._galTouchView != null)
            {
                this.UpdateHint(limitType);
                int   num        = GalTouchData.QueryLevelUpFeelNeed(oldHeartLevel);
                float sliderFrom = 0f;
                if (num != 0)
                {
                    sliderFrom = ((float)oldGoodFeel) / ((float)num);
                }
                sliderFrom += oldHeartLevel;
                int   num3     = GalTouchData.QueryLevelUpFeelNeed(newHeartLevel);
                float sliderTo = 0f;
                if (num3 != 0)
                {
                    sliderTo = ((float)newGoodFeel) / ((float)num3);
                }
                sliderTo += newHeartLevel;
                string additionalText       = string.Empty;
                int    avatarGalTouchBuffId = Singleton <GalTouchModule> .Instance.GetAvatarGalTouchBuffId(Singleton <GalTouchModule> .Instance.GetCurrentTouchAvatarID());

                if (avatarGalTouchBuffId != 0)
                {
                    TouchBuffItem touchBuffItem = GalTouchData.GetTouchBuffItem(avatarGalTouchBuffId);
                    if (touchBuffItem != null)
                    {
                        object[] replaceParams = new object[] { GalTouchBuffData.GetCalculatedParam(touchBuffItem.param1, touchBuffItem.param1Add, newHeartLevel).ToString(), GalTouchBuffData.GetCalculatedParam(touchBuffItem.param2, touchBuffItem.param2Add, newHeartLevel).ToString(), GalTouchBuffData.GetCalculatedParam(touchBuffItem.param3, touchBuffItem.param3Add, newHeartLevel).ToString() };
                        additionalText = LocalizationGeneralLogic.GetText(touchBuffItem.detail, replaceParams);
                    }
                }
                this._galTouchView.Show(sliderFrom, sliderTo, newGoodFeel, additionalText);
            }
        }
Exemplo n.º 7
0
        public void OnOKButtonCallBack()
        {
            string str = base.view.transform.Find("Dialog/Content/InputField").GetComponent <InputField>().text.Trim();

            if (!string.IsNullOrEmpty(str))
            {
                int result = 0;
                if (!int.TryParse(str, out result))
                {
                    this.ShowErrMsg(LocalizationGeneralLogic.GetText("Err_ChatRoomIdWrong", new object[0]));
                }
                else if ((result <= 0) || (result > MiscData.Config.ChatConfig.ChatRoomMaxNum))
                {
                    this.ShowErrMsg(LocalizationGeneralLogic.GetText("Err_ChatRoomIdWrong", new object[0]));
                }
                else if (result == Singleton <ChatModule> .Instance.chatRoomId)
                {
                    this.ShowErrMsg(LocalizationGeneralLogic.GetText("Err_ChatRoomIdTheSame", new object[0]));
                }
                else
                {
                    Singleton <NetworkManager> .Instance.RequestEnterWorldChatroom(result);
                }
            }
        }
Exemplo n.º 8
0
 public void HandleStageEndRspForRetry(StageEndRsp rsp)
 {
     if (MiscData.Config.BasicConfig.FeatureOnRetrySendLevelEndReq)
     {
         GeneralConfirmDialogContext context;
         this.ClearLevelEndReqInfo();
         if (rsp.get_retcode() == null)
         {
             context = new GeneralConfirmDialogContext {
                 type = GeneralConfirmDialogContext.ButtonType.SingleButton,
                 desc = LocalizationGeneralLogic.GetText("Menu_Desc_SuccRetrySendLevelEndReq", new object[0])
             };
             Singleton <MainUIManager> .Instance.ShowDialog(context, UIType.Any);
         }
         else
         {
             string networkErrCodeOutput = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0]);
             context = new GeneralConfirmDialogContext {
                 type = GeneralConfirmDialogContext.ButtonType.SingleButton
             };
             object[] replaceParams = new object[] { networkErrCodeOutput };
             context.desc = LocalizationGeneralLogic.GetText("Menu_Desc_FailRetrySendLevelEndReq", replaceParams);
             Singleton <MainUIManager> .Instance.ShowDialog(context, UIType.Any);
         }
     }
 }
Exemplo n.º 9
0
        private void DoSetupView()
        {
            base.view.transform.Find("GroupPanel").gameObject.SetActive(true);
            this.InitAnimationAndDialogManager();
            Transform transform = base.view.transform.Find("GroupPanel/GroupInfotPanel");

            transform.Find("GroupName").GetComponent <Text>().text = LocalizationGeneralLogic.GetText(EndlessGroupMetaDataReader.GetEndlessGroupMetaDataByKey(Singleton <EndlessModule> .Instance.currentGroupLevel).groupName, new object[0]);
            Color color  = Miscs.ParseColor(MiscData.Config.EndlessGroupUnSelectColor[Singleton <EndlessModule> .Instance.currentGroupLevel]);
            Color color2 = Miscs.ParseColor(MiscData.Config.EndlessGroupBGColor[Singleton <EndlessModule> .Instance.currentGroupLevel]);

            transform.Find("GroupName").GetComponent <Text>().color = color;
            base.view.transform.Find("BG/GroupColor").GetComponent <Image>().color = color2;
            int currentFinishProgress = Singleton <EndlessModule> .Instance.CurrentFinishProgress;

            transform.Find("FloorNum").GetComponent <Text>().text = (currentFinishProgress != 0) ? currentFinishProgress.ToString() : "-";
            base.view.transform.Find("GroupPanel/Result/Win").gameObject.SetActive(this.isSuccess);
            base.view.transform.Find("GroupPanel/Result/Lost").gameObject.SetActive(!this.isSuccess);
            if (!this.isSuccess)
            {
                base.view.transform.Find("BG/TriangleFill").GetComponent <Image>().material = Miscs.LoadResource <Material>("Material/ImageGrayscale", BundleType.RESOURCE_FILE);
                base.view.transform.Find("BG").GetComponent <Image>().material = Miscs.LoadResource <Material>("Material/ImageGrayscale", BundleType.RESOURCE_FILE);
            }
            else
            {
                base.view.transform.Find("BG/TriangleFill").GetComponent <Image>().material = null;
                base.view.transform.Find("BG").GetComponent <Image>().material = null;
            }
            this.SetupReward();
            this._dropItemAnimationManager.StartPlay(0f, true);
        }
Exemplo n.º 10
0
 private void SetupDetailItem(GameObject item, RewardUIData data)
 {
     if (data == null)
     {
         item.SetActive(false);
     }
     else
     {
         item.SetActive(true);
         Text component = item.transform.Find("Item").GetComponent <Text>();
         Text text2     = item.transform.Find("Number").GetComponent <Text>();
         if (data.rewardType == ResourceType.PlayerExp)
         {
             component.text = LocalizationGeneralLogic.GetText("Menu_Level", new object[0]);
         }
         else if (data.rewardType == ResourceType.Scoin)
         {
             component.text = LocalizationGeneralLogic.GetText("Menu_Scoin", new object[0]);
         }
         else if (data.rewardType == ResourceType.Hcoin)
         {
             component.text = LocalizationGeneralLogic.GetText("Menu_Hcoin", new object[0]);
         }
         else if (data.rewardType == ResourceType.FriendPoint)
         {
             component.text = LocalizationGeneralLogic.GetText("10119", new object[0]);
         }
         else if (data.rewardType == ResourceType.Item)
         {
             component.text = Singleton <StorageModule> .Instance.GetDummyStorageDataItem(data.itemID, 1).GetDisplayTitle();
         }
         text2.text = data.value.ToString();
     }
 }
Exemplo n.º 11
0
        public static int GetTimeSpanToShow(DateTime time, out string label)
        {
            TimeSpan span;
            DateTime now = TimeUtil.Now;

            if (now > time)
            {
                span = (TimeSpan)(now - time);
            }
            else
            {
                span = (TimeSpan)(time - now);
            }
            if (span.TotalMinutes < 60.0)
            {
                label = LocalizationGeneralLogic.GetText("Menu_Desc_Minute", new object[0]);
                return(span.Minutes);
            }
            if (span.TotalHours < 24.0)
            {
                label = LocalizationGeneralLogic.GetText("Menu_Desc_Hour", new object[0]);
                return(span.Hours);
            }
            if (span.TotalDays < 7.0)
            {
                label = LocalizationGeneralLogic.GetText("Menu_Desc_Day", new object[0]);
                return(span.Days);
            }
            label = string.Empty;
            return(0);
        }
        public bool OnAvatarReviveRsp(AvatarReviveRsp rsp)
        {
            if (rsp.get_retcode() == null)
            {
                if (rsp.get_revive_timesSpecified())
                {
                    int num = this._levelScoreManager.maxReviveNum - ((int)rsp.get_revive_times());
                    if (this._levelScoreManager.avaiableReviveNum > num)
                    {
                        this._levelScoreManager.avaiableReviveNum = num;
                        this._levelActor.ReviveAvatarByID(this._reviveContext.avatarRuntimeID, this._reviveContext.revivePosition);
                        this.Destroy();
                        Singleton <WwiseAudioManager> .Instance.Post("BGM_PauseMenu_Off", null, null, null);

                        this._reviveContext.OnReviveConfirm();
                    }
                }
            }
            else
            {
                GeneralDialogContext dialogContext = new GeneralDialogContext {
                    type  = GeneralDialogContext.ButtonType.SingleButton,
                    title = LocalizationGeneralLogic.GetText("Menu_Title_ExchangeFail", new object[0]),
                    desc  = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0])
                };
                Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
            }
            return(false);
        }
Exemplo n.º 13
0
        private bool OnBuyGoodsRsp(BuyGoodsRsp rsp)
        {
            if (rsp.get_retcode() == null)
            {
                this.SetupView();
                Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_ShopBuyGoodsSuccess", new object[0]), 2f), UIType.Any);

                base.view.transform.Find("ShopTab").gameObject.GetComponent <MonoShopStoreTab>().OnBuyGoodsRsp(rsp);
            }
            else
            {
                GeneralDialogContext dialogContext = new GeneralDialogContext {
                    type  = GeneralDialogContext.ButtonType.SingleButton,
                    title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0])
                };
                dialogContext.desc = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0]);
                if (!string.IsNullOrEmpty(dialogContext.desc))
                {
                    Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
                }
                if ((rsp.get_retcode() == 6) || (rsp.get_retcode() == 7))
                {
                    Singleton <NetworkManager> .Instance.RequestGetShopList();
                }
            }
            return(false);
        }
Exemplo n.º 14
0
        private bool OnGetAcceptFriendInviteRsp(AcceptFriendInviteRsp rsp)
        {
            if (MiscData.Config.BasicConfig.IsInviteFeatureEnable)
            {
                if (Singleton <NetworkManager> .Instance.DispatchSeverData.isReview)
                {
                    return(false);
                }
                if (!Singleton <AccountManager> .Instance.manager.IsAccountBind())
                {
                    return(false);
                }
                if (rsp.get_retcode() == null)
                {
                    Singleton <NetworkManager> .Instance.RequestGetInviteeFriend();

                    Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(LocalizationGeneralLogic.GetText("Menu_InviteInputSuccess", new object[0]), 2f), UIType.Any);
                }
                else
                {
                    GeneralDialogContext dialogContext = new GeneralDialogContext {
                        type  = GeneralDialogContext.ButtonType.SingleButton,
                        title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]),
                        desc  = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0]),
                        notDestroyAfterTouchBG = true
                    };
                    Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
                }
            }
            return(false);
        }
Exemplo n.º 15
0
 private bool OnStageEndRsp(StageEndRsp rsp)
 {
     this._stageEndRsp = rsp;
     if (rsp.get_retcode() == null)
     {
         if (this._levelSuccess)
         {
             LevelScoreManager instance = Singleton <LevelScoreManager> .Instance;
             if (rsp.get_stage_idSpecified())
             {
             }
             this._leftPanelAnimationManager.AddAnimation(base.view.transform.Find("Title").GetComponent <MonoAnimationinSequence>(), null);
             this.SetupRewardPanel(this._stageEndRsp);
             this.ShowRewardPanel();
         }
     }
     else
     {
         GeneralDialogContext dialogContext = new GeneralDialogContext {
             type  = GeneralDialogContext.ButtonType.SingleButton,
             title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]),
             desc  = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0])
         };
         Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
     }
     return(false);
 }
Exemplo n.º 16
0
        private void SetCollection(string tabName)
        {
            GameObject gameObject        = base.view.transform.Find("Collection").gameObject;
            Text       component         = base.view.transform.Find("Collection/Text").GetComponent <Text>();
            Text       text2             = base.view.transform.Find("Collection/Title").GetComponent <Text>();
            int        unlockCountWeapon = 0;
            int        allWeaponCount    = 0;

            if (tabName == "WeaponTab")
            {
                gameObject.SetActive(true);
                unlockCountWeapon = Singleton <ItempediaModule> .Instance.GetUnlockCountWeapon();

                allWeaponCount = Singleton <ItempediaModule> .Instance.GetAllWeaponCount();

                text2.text = LocalizationGeneralLogic.GetText("Menu_Desc_WeaponIndexCompleteness", new object[0]);
            }
            else if (tabName == "StigmataTab")
            {
                gameObject.SetActive(true);
                unlockCountWeapon = Singleton <ItempediaModule> .Instance.GetUnlockCountStigmata();

                allWeaponCount = Singleton <ItempediaModule> .Instance.GetAllStigmataCount();

                text2.text = LocalizationGeneralLogic.GetText("Menu_Desc_StigmataIndexCompleteness", new object[0]);
            }
            else if (tabName == "ItemTab")
            {
                gameObject.SetActive(false);
            }
            component.text = string.Format("{0}/{1}", unlockCountWeapon.ToString(), allWeaponCount.ToString());
        }
Exemplo n.º 17
0
        public void OnSkipBtnClicked()
        {
            if (this.SkipVideoClickedCallback != null)
            {
                this.SkipVideoClickedCallback();
            }
            GeneralDialogContext context = new GeneralDialogContext {
                type  = GeneralDialogContext.ButtonType.DoubleButton,
                title = LocalizationGeneralLogic.GetText("SkipCG_Confirm_Title", new object[0]),
                desc  = LocalizationGeneralLogic.GetText("SkipCG_Confirm_Content", new object[0]),
                notDestroyAfterTouchBG  = false,
                notDestroyAfterCallback = false,
                buttonCallBack          = delegate(bool confirmed) {
                    if (confirmed)
                    {
                        if (this.SkipVideoConfirmCallback != null)
                        {
                            base.view.transform.Find("SkipBtn").gameObject.SetActive(false);
                            this._skipBtnState = SkipButtonState.Close;
                            this.SkipVideoConfirmCallback();
                        }
                    }
                    else if (this.SkipVideoCancelCallback != null)
                    {
                        this.SkipVideoCancelCallback();
                    }
                }
            };

            this._currentGeneralDialog = context;
            Singleton <MainUIManager> .Instance.ShowDialog(this._currentGeneralDialog, UIType.Any);
        }
Exemplo n.º 18
0
        public void OnLvUpBtnClick()
        {
            PlayerDataItem playerData = Singleton <PlayerModule> .Instance.playerData;
            bool           flag       = Singleton <StorageModule> .Instance.GetAllAvatarExpAddMaterial().Count > 0;

            bool flag2 = (this._avatarData.level < playerData.AvatarLevelLimit) || (this._avatarData.exp < this._avatarData.MaxExp);

            if (flag && flag2)
            {
                Singleton <MainUIManager> .Instance.ShowDialog(new MaterialUseDialogContext(this._avatarData), UIType.Any);
            }
            else
            {
                string text = LocalizationGeneralLogic.GetText("Err_Unknown", new object[0]);
                if (!flag)
                {
                    text = LocalizationGeneralLogic.GetText("Err_NoLvUpItem", new object[0]);
                }
                else if (!flag2)
                {
                    object[] replaceParams = new object[] { playerData.teamLevel, playerData.AvatarLevelLimit };
                    text = LocalizationGeneralLogic.GetText("Err_AvatarLevelLimit", replaceParams);
                }
                GeneralDialogContext dialogContext = new GeneralDialogContext {
                    type  = GeneralDialogContext.ButtonType.SingleButton,
                    title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]),
                    desc  = text
                };
                Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
            }
        }
Exemplo n.º 19
0
        private bool OnPlayerLoginRsp(PlayerLoginRsp rsp)
        {
            if (rsp.get_retcode() == null)
            {
                MonoTestUI sceneCanvas = Singleton <MainUIManager> .Instance.SceneCanvas as MonoTestUI;
                if (sceneCanvas.avatar3dModelContext != null)
                {
                    return(false);
                }
                sceneCanvas.MainCamera.SetActive(true);
                sceneCanvas.MainMenu_SpaceShip.SetActive(true);
                sceneCanvas.avatar3dModelContext = new Avatar3dModelContext(null);
                Singleton <MainUIManager> .Instance.ShowWidget(sceneCanvas.avatar3dModelContext, UIType.Root);

                GameObject            view         = GameObject.Find("MainMenu_SpaceShip");
                GameObject            uiMainCamera = GameObject.Find("MainCamera");
                SpaceShipModelContext widget       = new SpaceShipModelContext(view, uiMainCamera);
                Singleton <MainUIManager> .Instance.ShowWidget(widget, UIType.Any);

                GraphicsSettingData.ApplySettingConfig();
                AudioSettingData.ApplySettingConfig();
                this.TestCode(sceneCanvas);
            }
            else
            {
                GeneralDialogContext dialogContext = new GeneralDialogContext {
                    type  = GeneralDialogContext.ButtonType.SingleButton,
                    title = LocalizationGeneralLogic.GetText("Menu_Title_Tips", new object[0]),
                    desc  = LocalizationGeneralLogic.GetNetworkErrCodeOutput(rsp.get_retcode(), new object[0]),
                    notDestroyAfterTouchBG = true
                };
                Singleton <MainUIManager> .Instance.ShowDialog(dialogContext, UIType.Any);
            }
            return(false);
        }
Exemplo n.º 20
0
        public void OnOkButtonCallBack()
        {
            bool flag  = this._ventureData.StaminaCost <= Singleton <PlayerModule> .Instance.playerData.stamina;
            bool flag2 = Singleton <IslandModule> .Instance.GetVentureInProgressNum() < (Singleton <IslandModule> .Instance.GetCabinDataByType(5) as CabinVentureDataItem).GetMaxVentureNumInProgress();

            if ((this._isConditionMatch && flag) && flag2)
            {
                Singleton <NetworkManager> .Instance.RequestDispatchIslandVenture(this._ventureData.VentureID, this._ventureData.selectedAvatarList);
            }
            else
            {
                GeneralDialogContext context;
                if (!this._isConditionMatch)
                {
                    context = new GeneralDialogContext {
                        title = LocalizationGeneralLogic.GetText("Menu_Tips", new object[0]),
                        desc  = LocalizationGeneralLogic.GetText("Menu_Desc_ConditionNotMatchHint", new object[0])
                    };
                    Singleton <MainUIManager> .Instance.ShowDialog(context, UIType.Any);
                }
                else if (!flag2)
                {
                    context = new GeneralDialogContext {
                        title = LocalizationGeneralLogic.GetText("Menu_Tips", new object[0]),
                        desc  = LocalizationGeneralLogic.GetText("Menu_Desc_VentureInProgressExceedLimit", new object[0]),
                        type  = GeneralDialogContext.ButtonType.SingleButton
                    };
                    Singleton <MainUIManager> .Instance.ShowDialog(context, UIType.Any);
                }
                else if (!flag)
                {
                    Singleton <PlayerModule> .Instance.playerData._cacheDataUtil.CheckCacheValidAndGo <PlayerStaminaExchangeInfo>(ECacheData.Stamina, NotifyTypes.ShowStaminaExchangeInfo2);
                }
            }
        }
Exemplo n.º 21
0
        private void OnLoadingEventAssetBundleProgress(long current, long total, long delta, float speed)
        {
            float  num  = ((float)current) / ((float)total);
            string text = LocalizationGeneralLogic.GetText("Menu_DownloadEventAsset", new object[0]);

            Singleton <NotifyManager> .Instance.FireNotify(new Notify(NotifyTypes.SetLoadAssetText, new Tuple <bool, string, bool, float>(true, text, true, num)));
        }
Exemplo n.º 22
0
        private bool OnGachaRsp(GachaRsp rsp)
        {
            if (rsp.get_retcode() == null)
            {
                this._gachaGotList.Clear();
                this._gachaItemList             = rsp.get_item_list();
                this._dropItemShowDialogManager = new SequenceDialogManager(new Action(this.ShowGachaResultPage));
                this._unLockAvatarDialogManager = new SequenceDialogManager(new Action(this.ClearUnlockAvatarDialogManagerContent));
                foreach (GachaItem item in rsp.get_item_list())
                {
                    StorageDataItemBase dummyStorageDataItem = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_item_id(), (int)item.get_level());

                    if (dummyStorageDataItem != null)
                    {
                        dummyStorageDataItem.number = (int)item.get_num();
                        if (dummyStorageDataItem is AvatarCardDataItem)
                        {
                            if (item.get_split_fragment_numSpecified())
                            {
                                (dummyStorageDataItem as AvatarCardDataItem).SpliteToFragment((int)item.get_split_fragment_num());
                            }
                            else
                            {
                                AvatarCardDataItem        item2         = dummyStorageDataItem as AvatarCardDataItem;
                                AvatarUnlockDialogContext dialogContext = new AvatarUnlockDialogContext(AvatarMetaDataReaderExtend.GetAvatarIDsByKey(item2.ID).avatarID, true);
                                this._unLockAvatarDialogManager.AddDialog(dialogContext);
                            }
                        }
                        this._gachaGotList.Add(dummyStorageDataItem);
                        List <Tuple <StorageDataItemBase, bool> > itemDataList = new List <Tuple <StorageDataItemBase, bool> > {
                            new Tuple <StorageDataItemBase, bool>(dummyStorageDataItem, item.get_is_rare_drop())
                        };
                        if (item.get_gift_item_idSpecified())
                        {
                            StorageDataItemBase base3 = Singleton <StorageModule> .Instance.GetDummyStorageDataItem((int)item.get_gift_item_id(), (int)item.get_gift_level());

                            if (base3 != null)
                            {
                                base3.number = (int)item.get_gift_num();
                                itemDataList.Add(new Tuple <StorageDataItemBase, bool>(base3, false));
                                this._gachaGotList.Add(base3);
                            }
                        }
                        this._dropItemShowDialogManager.AddDialog(new DropNewItemDialogContextV2(itemDataList));
                    }
                }
                this._waitGachaRsp.End();
            }
            else if (rsp.get_retcode() == 3)
            {
                GeneralDialogContext context2 = new GeneralDialogContext {
                    type  = GeneralDialogContext.ButtonType.SingleButton,
                    title = LocalizationGeneralLogic.GetText("Menu_Return_GachaTitcketLack", new object[0]),
                    desc  = LocalizationGeneralLogic.GetText("Menu_Return_GachaTitcketLack", new object[0])
                };
                Singleton <MainUIManager> .Instance.ShowDialog(context2, UIType.Any);
            }
            this.UpdateView();
            return(false);
        }
Exemplo n.º 23
0
 public virtual string GetDisplayTarget(int stepIndex)
 {
     if ((stepIndex >= 0) && (stepIndex < this._maxStepCount))
     {
         return(LocalizationGeneralLogic.GetText(this._displayList[stepIndex], new object[0]));
     }
     return(string.Empty);
 }
Exemplo n.º 24
0
 public void SetupTextID(string textID, string textPattern)
 {
     this._label.text = LocalizationGeneralLogic.GetText(textID, new object[0]);
     if (!string.IsNullOrEmpty(textPattern))
     {
         this._label.text = textPattern.Replace("#1", this._label.text);
     }
 }
Exemplo n.º 25
0
 public override string GetResultShowText()
 {
     if (base.payRetCode == PayResult.PayRetcode.FAILED)
     {
         return(LocalizationGeneralLogic.GetText("IAPTransitionFailed", new object[0]));
     }
     return(base.GetResultShowText());
 }
Exemplo n.º 26
0
        private void SetupFriendView()
        {
            string text = LocalizationGeneralLogic.GetText("Chat_Content_FriendUnselected", new object[0]);

            base.view.transform.Find("Dialog/Content/Friend/ChangeBtn/Name").GetComponent <Text>().text = (this._talkingFriendUid != 0) ? Singleton <FriendModule> .Instance.TryGetPlayerNickName(this._talkingFriendUid) : text;

            this.SetInputLength(710f);
        }
Exemplo n.º 27
0
 private string GetDesc(string textID, int id)
 {
     if (textID == RewardUIData.ITEM_ICON_TEXT_ID)
     {
         return(Singleton <StorageModule> .Instance.GetDummyStorageDataItem(id, 1).GetDisplayTitle());
     }
     return(LocalizationGeneralLogic.GetText(textID, new object[0]));
 }
Exemplo n.º 28
0
        protected override bool SetupView()
        {
            base.view.transform.Find("Btn").gameObject.SetActive(false);
            this._animationManager = new SequenceAnimationManager(new Action(this.StartTimer), null);
            LevelScoreManager instance = Singleton <LevelScoreManager> .Instance;
            int level                = (instance == null) ? this._levelBefore_no_scoremanager : instance.playerLevelBefore;
            int teamLevel            = Singleton <PlayerModule> .Instance.playerData.teamLevel;
            PlayerLevelMetaData data = PlayerLevelMetaDataReader.TryGetPlayerLevelMetaDataByKey(level);

            SuperDebug.VeryImportantAssert(data != null, string.Format("Cannot get player level data for player level:{0}", level));
            if (data == null)
            {
                data = PlayerLevelMetaDataReader.TryGetPlayerLevelMetaDataByKey(1);
            }
            base.view.transform.Find("Dialog/Content/LevelInfo/LvBefore/Lv").GetComponent <Text>().text = level.ToString();
            base.view.transform.Find("Dialog/Content/LevelInfo/LvAfter/Lv").GetComponent <Text>().text  = teamLevel.ToString();
            int       maxStamina = Singleton <PlayerModule> .Instance.playerData.MaxStamina;
            int       stamina    = data.stamina;
            Transform transform  = base.view.transform.Find("Dialog/Content/MaxStamina");

            if (maxStamina > stamina)
            {
                transform.gameObject.SetActive(true);
                transform.Find("Num").GetComponent <Text>().text    = maxStamina.ToString();
                transform.Find("AddNum").GetComponent <Text>().text = "+" + ((maxStamina - stamina)).ToString();
            }
            else
            {
                transform.gameObject.SetActive(false);
            }
            int       avatarLevelLimit = Singleton <PlayerModule> .Instance.playerData.AvatarLevelLimit;
            int       num6             = data.avatarLevelLimit;
            Transform transform2       = base.view.transform.Find("Dialog/Content/MaxAvatarLevel");

            if (avatarLevelLimit > num6)
            {
                transform2.gameObject.SetActive(true);
                transform2.Find("Num").GetComponent <Text>().text    = avatarLevelLimit.ToString();
                transform2.Find("AddNum").GetComponent <Text>().text = "+" + ((avatarLevelLimit - num6)).ToString();
            }
            else
            {
                transform2.gameObject.SetActive(false);
            }
            RectTransform component   = base.view.transform.Find("Dialog").GetComponent <RectTransform>();
            List <string> newFeatures = MiscData.GetNewFeatures(level, teamLevel);

            for (int i = 0; i < newFeatures.Count; i++)
            {
                string     text = LocalizationGeneralLogic.GetText(newFeatures[i], new object[0]);
                GameObject obj2 = UnityEngine.Object.Instantiate <GameObject>(Miscs.LoadResource <GameObject>("UI/Menus/Widget/Map/NewFeature", BundleType.RESOURCE_FILE));
                obj2.transform.SetParent(component.Find("Content"), false);
                obj2.transform.Find("FeatureName").GetComponent <Text>().text = text;
            }
            this._animationManager.AddAllChildrenInTransform(base.view.transform.Find("Dialog/Content"));
            base.view.transform.Find("Dialog").GetComponent <MonoDialogHeightGrow>().PlayGrow(new Action(this.OnDialogBGGrowEnd));
            return(false);
        }
Exemplo n.º 29
0
        private void ShowEndlessToolEffect(EndlessToolDataItem toolData, UseEndlessItemRsp rsp)
        {
            Singleton <MainUIManager> .Instance.ShowUIEffect(base.config.contextName, toolData.EffectPrefatPath);

            object[] replaceParams = new object[] { toolData.GetDisplayTitle() };
            string   text          = LocalizationGeneralLogic.GetText("Menu_Desc_EndlessUseSuccess", replaceParams);

            Singleton <MainUIManager> .Instance.ShowDialog(new GeneralHintDialogContext(text, 2f), UIType.Any);
        }
Exemplo n.º 30
0
 public static string GetPlayerNickname(PlayerFriendBriefData briefData)
 {
     if (briefData.get_nicknameSpecified() && !string.IsNullOrEmpty(briefData.get_nickname()))
     {
         return(briefData.get_nickname());
     }
     object[] replaceParams = new object[] { briefData.get_uid() };
     return(LocalizationGeneralLogic.GetText("Menu_DefaultNickname", replaceParams));
 }