Esempio n. 1
0
 protected virtual void DoClose()
 {
     RemoveMask();
     PopupManager.CloseWindow(this);
     WindowActionCallback?.Invoke(WindowEvent);
 }
Esempio n. 2
0
 private void OnDataLoadComplete()
 {
     PopupManager.ShowPhoneTipsWindow(() => { SendRedPoint(); });
 }
Esempio n. 3
0
        public override void OnMessage(Message message)                       //主菜单消息发送
        {
            string name = message.Name;

            object[] body = message.Params;
            bool     isStopPlayDubbing = true;

            switch (name)
            {
            case MessageConst.CMD_MAIN_ON_STAR_ACTIVITY_BTN:
                if (GlobalData.MissionModel.IsShowStarActivity())
                {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_STAR_ACTIVITY, false, true, GlobalData.MissionModel.GetOpenDay());
                }
                else
                {
                    view.HandleFunctionOpen();
                }
                break;

            case MessageConst.CMD_MAIN_CHANGE_DISPLAY:                                    //--主菜单显示状态 Star
                MainMenuDisplayState state = (MainMenuDisplayState)message.Body;

                PopupManager.StopHandleShowWindow();

                switch (state)
                {
                case MainMenuDisplayState.ShowAll:
                    view.ShowAll();
                    //CheckNeedToDownLoadExtend();

                    PopupManager.ShowPhoneTipsWindow(() => SendRedPoint());
                    break;

                case MainMenuDisplayState.ShowUserInfo:
                    view.ShowUserInfo();
                    break;

                case MainMenuDisplayState.ShowUserInfoAndTopBar:
                    view.ShowTopBarAndUserInfo();
                    break;

                case MainMenuDisplayState.ShowTopBar:
                    view.ShowTopBar();
                    break;

                case MainMenuDisplayState.ShowVisitTopBar:
                    view.ShowTopBar(MainMenuDisplayState.ShowVisitTopBar);
                    break;

                case MainMenuDisplayState.HideAll:

                    if (_window != null)
                    {
                        _window.Close();
                    }

                    view.ShowAll(false);

                    break;

                case MainMenuDisplayState.ShowRecollectionTopBar:
                    view.ShowTopBar(MainMenuDisplayState.ShowRecollectionTopBar);
                    break;

                case MainMenuDisplayState.ShowExchangeIntegralBar:
                    view.ExchangeIntegralBarSetData(GlobalData.TrainingRoomModel.GetCurIntegral());
                    view.ShowTopBar(MainMenuDisplayState.ShowExchangeIntegralBar);
                    break;

                default:
                    throw new ArgumentOutOfRangeException();
                }                                                                        //--主菜单显示状态 End
                break;

            case MessageConst.CMD_MAIN_ON_START_BTN:
                var isShowArrow = (bool)body[0];
                Debug.LogError("isShowArrow===>" + isShowArrow);
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_GAME_PLAY, false, true, isShowArrow);       //--模块消息发送 Start
                break;

            case MessageConst.CMD_MAIN_ON_CARD_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_CARD);
                break;

            case MessageConst.CMD_MAIN_ON_SUPPORTER_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SUPPORTER);
                break;

            case MessageConst.CMD_TASK_SHOW_DAILYTASK:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_MISSION);
                break;

            case MessageConst.CMD_GOTOACHIEVEMENT:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACHIEVEMENT);
                break;

            case MessageConst.CMD_APPOINTMENT_JUMPCHOOSEROLE:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_LOVE);
                //PopupManager.ShowWindow<LoveJumpWindow>("GameMain/Prefabs/LoveJumpWindow/LoveJumpWindow");
                break;

            case MessageConst.CMD_MAIN_ON_CHANGE_ROLE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_FAVORABILITYMAIN);
                break;

            case MessageConst.CMD_MAIN_ON_DRAWCARD_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_DRAWCARD);
                break;

            case MessageConst.CMD_MAIN_ON_PHONE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PHONE);
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITY_BTN:
                //SendActivityMsg();
                //进入活动模块
                var id = (string)message.Body;
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITY, false, true, id);
                break;

            case MessageConst.CMD_MAIN_ON_MAIL_BTN:

                PopupManager.StopHandleShowWindow();
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_MAIL);
                break;

            case MessageConst.CMD_MAIN_ON_ALBUM_BTN:
                FlowText.ShowMessage(I18NManager.Get("Common_Underdevelopment"));
                break;

            case MessageConst.CMD_MAIN_ON_STAGINGPOST_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SHOP, false, true, 0);
                break;

            case MessageConst.CMD_MAIN_SHOW_BUY_POWER:                               //买体力
                var _buyPowerUpperlimit = GlobalData.PlayerModel.BuyPowerUpperlimit; //10
                if (GlobalData.PlayerModel.PlayerVo.PowerNum >= _buyPowerUpperlimit)
                {
                    FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit"));    // ("今日兑换次数已达上限");
                    return;
                }
                else
                {
                    ShowBuyPowerWindow();
                }
                break;

            case MessageConst.CMD_MAIN_SHOW_BUY_GOLD:                              //买金币
                var _buyGlodUpperlimit = GlobalData.PlayerModel.BuyGoldUpperlimit; //10
                if (GlobalData.PlayerModel.PlayerVo.GoldNum >= _buyGlodUpperlimit)
                {
                    FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit"));
                    return;
                }
                else
                {
                    ShowBuyGlodWindow();
                }
                break;

            case MessageConst.CMD_SUPPORTERACTIVITY_BUYENCOURAGEPOWER:                                 //买应援行动力

                var _buyEncouragePowerUpperlimit = GlobalData.PlayerModel.BuyEncouragePowerUpperlimit; //5
                if (GlobalData.PlayerModel.PlayerVo.EncourageNum >= _buyEncouragePowerUpperlimit)
                {
                    FlowText.ShowMessage(I18NManager.Get("Common_TodaysBuyUpperlimit"));
                    return;
                }
                else
                {
                    BuyEncouragePower();
                }
                break;

            case MessageConst.CMD_MAIN_SHOW_BUY_GEM:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_SHOP, false, true, 5);
                //ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_BUYGEN);
//                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PAY,false);

//                    (SdkHelper.PayAgent as PayAgentGooglePlay)?.Test();
                break;

            case MessageConst.CMD_RECOLLECTION_SENDBUYEVENT:
                EventDispatcher.TriggerEvent(EventConst.SendBuyRecolletionPowerEvent);
                break;

            case MessageConst.CMD_MAIN_ON_LIVE2DCLICK:
                isStopPlayDubbing = false;
                SendNpcMainStageInteract();
                break;

            case MessageConst.CMD_MAIN_ON_FIRITSRECHARGE_BTN:
                //通过首冲进入活动模块
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYFIRSTRECHARGE, false, true);
                break;

            case MessageConst.CMD_MAIN_STORESCORECOMMENT:
                bool   commentType = (bool)body[0];
                string comment     = (string)body[1];
                int    star        = (int)body[2];
                Debug.LogError(comment.Length);
                if (commentType)
                {
                    SetCommentRes(true, comment, star);
                }
                else
                {
                    if (comment.Length < 20)
                    {
                        FlowText.ShowMessage(I18NManager.Get("GameMain_MinTextCount"));
                        return;
                    }
                    else if (comment.Length > 600)
                    {
                        FlowText.ShowMessage(I18NManager.Get("GameMain_MaxTextCount"));
                        return;
                    }
                    SetCommentRes(false, comment, star);
                }


                break;

            case MessageConst.CMD_MAIN_FIRESHDOWNLOADAWARD:
//                    Debug.LogError("has receiveDownload"+GlobalData.PlayerModel.PlayerVo.ExtInfo.DownloadReceive);
                //GuideManager.SetStatisticsRemoteGuideStep(GuideConst.MainLineStep_Extend_DowndLoad);

                if (GlobalData.PlayerModel.PlayerVo.ExtInfo.DownloadReceive == 0)
                {
                    NetWorkManager.Instance.Send <ReceiveDownloadAwardsRes>(CMD.DOWNLOAD_RECEIVEAWARD, null, OnDownloadReceiveAward);
                }
//                    else
//                    {
//                        Debug.LogError("另外奖励又重新删包,在下载");
//                        SendMessage(new Message(MessageConst.CMD_DOWNLOAD_OK));
//                    }



                break;

            case MessageConst.CMD_MAIN_ON_PLAYERBIRTHDAY:
                if (GlobalData.MissionModel.IsShowPlayerBirthday())
                {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_PLAYERBIRTHDAY, false, true, GlobalData.MissionModel.GetPlayerBirthdayOpenDay());
                }
                else
                {
                    view.HandleFunctionOpen();
                }
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITYTEMPLATE_BTN:
                if (GlobalData.ActivityModel.IsShowActivityTemplateBtn(ActivityTypePB.ActivityDrawTemplate))
                {
                    ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYTEMPLATE, false, true);
                }
                else
                {
                    view.HandleFunctionOpen();
                }
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITYCAPSULETEMPLATE_BTN:

                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYCAPSULETEMPLATE, false, true);
                break;

            case MessageConst.CMD_MAIN_ON_TOTALRECHARGE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITY, false, true, GlobalData.ActivityModel.GetActivityVo(ActivityType.ActivityAccumulativeRecharge).JumpId);
                break;

            case MessageConst.CMD_MAIN_ON_ACTIVITYMUSICTEMPLATE_BTN:
                ModuleManager.Instance.EnterModule(ModuleConfig.MODULE_ACTIVITYMUSICTEMPLATE, false, true);
                break;

            default:
                return;
            }

            if (isStopPlayDubbing)
            {
                StopPlayingDubbing();
            }
        }
Esempio n. 4
0
        private void Awake()
        {
            _onClickGotoGame = transform.Find("OnClickGotoGame");
            _ani             = _onClickGotoGame.GetImage("Ani");

            _loginPanel   = transform.Find("Panel");
            _chooseServer = transform.Find("ChooseServer");
            _serverObj    = _chooseServer.transform.Find("TempGroup/ServerList").gameObject;
            //_serverDropdown = _chooseServer.Find("TempGroup/ServerListDropdown").GetComponent<Dropdown>();

            _btnServer   = _chooseServer.transform.Find("TempGroup/ServerBtn").GetComponent <Button>();
            _serverPanel = _chooseServer.transform.Find("ChooseServerPanel").gameObject;
            _serverName  = _btnServer.transform.Find("ServerName").GetComponent <Text>();
            _btnServer.onClick.AddListener(OnBtnServerClick);

            TipsTween();

            Button customServiceBtn = transform.GetButton("TopRight/CustomServiceBtn");

            customServiceBtn.onClick.AddListener(() => { SdkHelper.CustomServiceAgent.Show(); });

            customServiceBtn.gameObject.SetActive(AppConfig.Instance.SwitchControl.CustomerServices);


            PointerClickListener.Get(_onClickGotoGame.gameObject).onClick = go =>
            {
                SendMessage(new Message(MessageConst.CMD_LOGIN_DO_LOGIN, Message.MessageReciverType.CONTROLLER));
            };



            //公告
            Button AnnouncementBtn = transform.Find("TopRight/AnnouncementBtn").GetComponent <Button>();

            AnnouncementBtn.onClick.AddListener(() => {
                Debug.Log("AnnouncementBtn Onclick");
                SendMessage(new Message(MessageConst.CMD_LOGIN_ANNOUNCEMENT));
            });
            //切换账号
            Button SwitchAccountBtn = transform.Find("TopRight/SwitchAccountBtn").GetComponent <Button>();

            SwitchAccountBtn.gameObject.SetActive(AppConfig.Instance.UseGalaLogin);
            SwitchAccountBtn.onClick.AddListener(() => {
                Debug.Log("SwitchAccountBtn Onclick");
                SendMessage(new Message(MessageConst.CMD_LOGIN_SWITCH_LOGIN, Message.MessageReciverType.CONTROLLER));
            });
            //修复包
            Button RepairBtn = transform.Find("TopRight/RepairBtn").GetComponent <Button>();

            RepairBtn.onClick.AddListener(() =>
            {
                PopupManager.ShowConfirmWindow(I18NManager.Get("Login_RepairTip")).WindowActionCallback = OnRepairConfirm;
            });



            string version = "V" + AppConfig.Instance.versionName;

            if (AppConfig.Instance.hotVersion > 0)
            {
                version += "_" + AppConfig.Instance.hotVersion;
            }
            transform.GetText("VersionId").text = version;

            HandelTencent();

            HandleTest();

            OnRefreshServerData();
            EventDispatcher.AddEventListener(EventConst.OnConnetToServer, OnRefreshServerData);
            EventDispatcher.AddEventListener(EventConst.OnChooseServer, OnChooseServer);
        }
Esempio n. 5
0
 private void Awake()
 {
     _instance    = this;
     _windowLayer = transform;
     _waitToShows = new List <MySmsOrCallVo>();
 }
Esempio n. 6
0
 private void ShowTencentBalance()
 {
     PopupManager.ShowWindow <TencentBalanceWindow>("Shop/Prefab/TencentBalanceWindow");
 }