예제 #1
0
            private void OnNextGameStart(long id)
            {
                if (id != 10005)
                {
                    return;
                }
                string inputName = m_input.Text;

                if (string.IsNullOrEmpty(inputName))
                {
                    PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("UI_PLAYERINFO_NICK_NULL"));
                    return;
                }
                if (EngineCore.Utility.CommonUtils.GetStringCount(inputName) > 20)
                {
                    PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("UI_PLAYERINFO_NICK_OVERFLOW"));
                    return;
                }
                CSRenameRequest c2sRename = new CSRenameRequest();

                c2sRename.NewName  = inputName;
                c2sRename.PlayerId = GlobalInfo.MY_PLAYER_ID;
                GameEvents.NetWorkEvents.SendMsg.SafeInvoke(c2sRename);

                GameEvents.UI_Guid_Event.OnGuidNewEnd.SafeInvoke(10005);
                //GameEvents.UIEvents.UI_StartCartoon_Event.OnNext.SafeInvoke();
            }
        public override void OnHide()
        {
            base.OnHide();

            m_is_start_timer = false;
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCRegGuestResponse, OnScResponse);
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCIdentifyCheckRepsonse, OnScResponse);
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCPlayerInfoResponse, OnScResponse);
            //MessageHandler.UnRegisterMessageHandler(MessageDefine.SCPlayerPropResponse, OnScResponse);
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCFBLoginResponse, OnScResponse);
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCFBBindResponse, OnScResponse);
            //MessageHandler.UnRegisterMessageHandler(MessageDefine.SCNoticeListResponse, OnScResponse);
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCPlayerGuildResponse, OnScResponse);
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCGetPushResponse, OnScResponse);
            MessageHandler.UnRegisterMessageHandler(MessageDefine.SCIdentifyCheckMuiltyMessage, OnScResponse);

            GameEvents.UIEvents.UI_FB_Event.Listen_FbLoginStatusChanged -= SetFBBtnIcon;

            m_login_btn.RemoveClickCallBack(OnNormalVersionClicked);
            m_fackbook_btn.RemoveClickCallBack(OnFBVersionClicked);

            LocalDataManager.Instance.Is_login = false;

            PopUpManager.ClosePopUp();

            GameEvents.UIEvents.UI_FB_Event.Listen_FbLoginStatusChanged.SafeInvoke();
        }
예제 #3
0
        public void PopUpBuyConfirm(long marketID, int market_count, int prop_count, ShopType type, int cost)
        {
            System.Action act = () =>
            {
                GameEvents.BuyEvent.OnShopReq.SafeInvoke(marketID, market_count, market_count * prop_count, type);
#if Test
                MarkeBuyResponse res = new global::MarkeBuyResponse();
                res.ResponseStatus      = new ResponseStatus();
                res.ResponseStatus.Code = 0;
                MarkeBuyResponse(res);
#else
                MarkeBuyRequest req = new MarkeBuyRequest();
                req.MarketItemId = (int)marketID;
                req.Count        = market_count;
                GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
#endif
            };

            PopUpData pd = new PopUpData();
            pd.title     = "goods_buy";
            pd.content   = "shop_now_buying";
            pd.twoStr    = "shop_no";
            pd.isOneBtn  = false;
            pd.oneAction = act;
            PopUpManager.OpenPopUp(pd);
        }
예제 #4
0
        public void RequestEnter()
        {
#if OFFICER_SYS
            List <long> officeIDList = EventGamePoliceDispatchManager.Instance.GetAllDispathOfficersID();
            if (officeIDList.Count == 0)
            {
                Dictionary <UBSParamKeyName, object> _params = new Dictionary <UBSParamKeyName, object>()
                {
                    { UBSParamKeyName.Success, 0 },
                    { UBSParamKeyName.Description, UBSDescription.NO_OFFICER_SELECTED },
                    { UBSParamKeyName.SceneID, m_event_id }
                };
                UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.event_begin, null, _params);

                PopUpManager.OpenPopUp(new PopUpData()
                {
                    isOneBtn = true,
                    content  = "UI_ENTER_GAME_NO_OFFICE",
                });

                return;
            }
#endif

            CSEventEnterRequest req = new CSEventEnterRequest();

            this.OnScHalfAsyncRequest(req, m_event_id);
        }
예제 #5
0
        private void OnAddClick(GameObject obj)
        {
            if (string.IsNullOrEmpty(m_input.Text))
            {
                return;
            }
            long val;

            if (false == long.TryParse(m_input.Text, out val))
            {
                return;
            }

            if (val == GlobalInfo.MY_PLAYER_ID)
            {
                PopUpData pd = new PopUpData();
                pd.title          = string.Empty;
                pd.content        = "friend_number_self_ID";
                pd.content_param0 = "";
                pd.isOneBtn       = true;
                pd.OneButtonText  = "UI.OK";
                pd.twoStr         = "UI.OK";
                pd.oneAction      = null;
                pd.twoAction      = null;

                PopUpManager.OpenPopUp(pd);

                return;
            }

#if !TEST
            //CurViewLogic().RequestAddFriend(val);
            GameEvents.UIEvents.UI_Friend_Event.Listen_AddFriend.SafeInvoke(val);
#endif
        }
예제 #6
0
 public static void OnReponse(object obj, NormalTask taskInfo)
 {
     if (obj is SCCanTaskResponse)
     {
         SCCanTaskResponse res = (SCCanTaskResponse)obj;
         if (res.TaskId == taskInfo.TaskConfID)
         {
             if (res.CanTask)
             {
                 GameEntryUILogic.S_CUR_EXCUTE_TASK_ID = res.TaskId;
                 OnExcuteTask(taskInfo);
             }
             else
             {
                 ConfTask confTask = ConfTask.Get(res.TaskId);
                 if (confTask == null)
                 {
                     return;
                 }
                 if (confTask.building != null && confTask.building.Length > 0)
                 {
                     ConfBuilding building = ConfBuilding.Get(confTask.building[0]);
                     if (building == null)
                     {
                         return;
                     }
                     PopUpManager.OpenNormalOnePop("task_unlock_tips", LocalizeModule.Instance.GetString(building.name));
                 }
             }
         }
     }
 }
예제 #7
0
        /// <summary>
        /// 此主线任务是否能完成
        /// </summary>
        private static void OnCheckMainTaskCanStart(NormalTask taskInfo)
        {
            ConfTask confTask = ConfTask.Get(taskInfo.TaskConfID);

            if (confTask == null)
            {
                return;
            }

            if (confTask.building != null && confTask.building.Length > 0)
            {
                ConfBuilding building = ConfBuilding.Get(confTask.building[0]);
                if (building == null)
                {
                    return;
                }

                if (!GameEvents.BigWorld_Event.OnCheckBuildStatusByID(building.id))
                {
                    PopUpManager.OpenNormalOnePop("task_unlock_tips", LocalizeModule.Instance.GetString(building.name));
                    return;
                }
            }

            GameEntryUILogic.S_CUR_EXCUTE_TASK_ID = taskInfo.TaskConfID;
            OnExcuteTask(taskInfo);
        }
예제 #8
0
        public override void OnScResponse(object s)
        {
            base.OnScResponse(s);

            if (s is SCCombineResponse)
            {
                var rsp = s as SCCombineResponse;

                if (MsgStatusCodeUtil.OnError(rsp.Result))
                {
                    return;
                }

                if (false == rsp.Success)
                {
                    PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("slots_luckTxt"));
                }
                else
                {
                    var raw_req          = EngineCoreEvents.SystemEvents.GetRspPairReq.SafeInvoke();
                    CSCombineRequest req = raw_req as CSCombineRequest;

                    m_view.RefreshCombinedPropCount(req.CombineId);
                }
            }
        }
        IEnumerator ITestNetwork()
        {
            //使用Get方式访问HTTP地址
            WWW www = new WWW("http://game.fotoable-conan.com/api-web/confirm/api");

            //等待服务器的响应
            yield return(www);

            //如果出现错误
            if (www.error != null)
            {
                m_isClick = false;
                //获取服务器的错误信息
                Debug.LogError(www.error);
                PopUpManager.OpenNormalOnePop("systen_unusual");

                yield return(null);
            }
            else
            {
                Debug.Log("net work is ok");

                //todo:临时写
                //this.GetVersion();

                if (ENUM_ACCOUNT_TYPE.E_GUEST == m_login_type)
                {
                    OnLoginButtonClick(null);
                }
                else
                {
                    OnFaceBookButtonClick(null);
                }
            }
        }
예제 #10
0
 private void OnClose(GameObject obj)
 {
     PopUpManager.OnCloseSureUI("reasoning_exit_tips", "reasoning_exit_ta", "reasoning_exit_quit", () =>
     {
         HideReasonUI();
     });
 }
예제 #11
0
        private bool OnClickBuildIcon()
        {
            if (m_achorData == null)
            {
                return(false);
            }
            if (m_achorData.BuildStatus == 2)
            {
                if (IsChapterValid())
                {
                    FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_UNLOCK);
                    param.Param = m_achorData.m_buidID;
                    EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param);
                    return(false);
                }
                else
                {
                    GameEvents.ChapterEvents.OnChapterDownloadFinish += OnChapterDownloaded;
                    FrameMgr.OpenUIParams uiParams = new FrameMgr.OpenUIParams(UIDefine.UI_ChapterMap);
                    uiParams.Param = m_confBuilding.id;

                    EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(uiParams);

                    return(false);
                }
            }
            else if (m_achorData.BuildStatus == 3)
            {
                if (m_confBuilding.unlockTask > 0)
                {
                    GlobalInfo.MY_PLAYER_INFO.PlayerTaskSystem.IsCompleteTaskByConfigID(m_confBuilding.unlockTask, (bool taskComplete) =>
                    {
                        if (!taskComplete)
                        {
                            string taskName   = string.Empty;
                            ConfTask confTask = ConfTask.Get(m_confBuilding.unlockTask);
                            if (confTask != null)
                            {
                                taskName = LocalizeModule.Instance.GetString(confTask.name);
                            }
                            if (GlobalInfo.MY_PLAYER_INFO.Level < m_confBuilding.unlockLevel)
                            {
                                PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("map_clock_level_mission", m_confBuilding.unlockLevel, taskName));
                            }
                            else
                            {
                                PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("group_unlock_tips", taskName));
                            }
                            return;
                        }
                    });
                }
                else
                {
                    PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("map_clock_level", m_confBuilding.unlockLevel));
                }
                return(false);
            }
            return(true);
        }
예제 #12
0
 /// <summary>
 /// 资源服务器连接出错
 /// </summary>
 private void AssetServerError(string errorMsg)
 {
     PopUpManager.OpenPopUp(new PopUpData()
     {
         content  = errorMsg,
         isOneBtn = true,
     });
 }
예제 #13
0
            private void OnNextBtn(GameObject obj)
            {
                //TimeModule.Instance.RemoveTimeaction(ChapterTimeout);
                EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, EngineCommonAudioKey.Button_Click_Common.ToString());
                if (m_IsEnd)
                {
                    GameEvents.UI_Guid_Event.OnGuidNewEnd.SafeInvoke(m_GuidID);
                    //GameEvents.UI_Guid_Event.OnStartGuidCartoonOver.SafeInvoke();
                    //GameEvents.UIEvents.UI_StartCartoon_Event.OnFinish.SafeInvoke();
                }
                else
                {
                    if (cartoonType == GuidStartCartoonType.HEAD)
                    {
                        if (!string.IsNullOrEmpty(m_HeadName))
                        {
                            CSPlayerRenewIconReq changeIconReq = new CSPlayerRenewIconReq();
                            changeIconReq.NewIcon = m_HeadName;
                            GameEvents.NetWorkEvents.SendMsg.SafeInvoke(changeIconReq);
                            GameEvents.UI_Guid_Event.OnGuidNewEnd.SafeInvoke(m_GuidID);
                            GameEvents.UIEvents.UI_StartCartoon_Event.OnNext.SafeInvoke();
                        }
                        else
                        {
                            PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("guid_photo_no"));
                            //Debug.Log("Facebook Login,don't replace icon");
                            //GameEvents.UIEvents.UI_StartCartoon_Event.OnNext.SafeInvoke();
                            //GameEvents.UI_Guid_Event.OnGuidNewEnd.SafeInvoke(m_GuidID);
                            //GameEvents.UI_Guid_Event.OnStartGuidCartoonNext.SafeInvoke();
                        }
                    }
                    else if (cartoonType == GuidStartCartoonType.NAME)
                    {
                        string inputName = m_InputName.Text;
                        if (string.IsNullOrEmpty(inputName))
                        {
                            PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("UI_PLAYERINFO_NICK_NULL"));
                            return;
                        }
                        if (EngineCore.Utility.CommonUtils.GetStringCount(inputName) > 20)
                        {
                            PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("UI_PLAYERINFO_NICK_OVERFLOW"));
                            return;
                        }
                        CSRenameRequest c2sRename = new CSRenameRequest();
                        c2sRename.NewName  = inputName;
                        c2sRename.PlayerId = GlobalInfo.MY_PLAYER_ID;
                        GameEvents.NetWorkEvents.SendMsg.SafeInvoke(c2sRename);

                        GameEvents.UI_Guid_Event.OnGuidNewEnd.SafeInvoke(m_GuidID);
                        GameEvents.UIEvents.UI_StartCartoon_Event.OnNext.SafeInvoke();
                    }
                    else
                    {
                        GameEvents.UIEvents.UI_StartCartoon_Event.OnNext.SafeInvoke();
                    }
                }
            }
예제 #14
0
        public void OnBuildClick()
        {
            //if (!SeekerGame.NewGuid.GuidNewManager.Instance.GetProgressByIndex(4))
            //{
            //    return;
            //}
            //todo//////////////////////////临时注释
            if (m_BuildID >= 4)
            {
                PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("group_unlock_future_tips"));
                return;
            }

            if (status == 2)
            {
                FrameMgr.OpenUIParams param = new FrameMgr.OpenUIParams(UIDefine.UI_UNLOCK);
                param.Param = m_BuildID;
                EngineCoreEvents.UIEvent.ShowUIEventWithParam.SafeInvoke(param);
            }
            else if (status == 0)
            {
                if (m_confBuild.unlockTask > 0)
                {
                    GlobalInfo.MY_PLAYER_INFO.PlayerTaskSystem.IsCompleteTaskByConfigID(m_confBuild.unlockTask, (bool taskComplete) =>
                    {
                        if (!taskComplete)
                        {
                            string taskName   = string.Empty;
                            ConfTask confTask = ConfTask.Get(m_confBuild.unlockTask);
                            if (confTask != null)
                            {
                                taskName = LocalizeModule.Instance.GetString(confTask.name);
                            }
                            if (GlobalInfo.MY_PLAYER_INFO.Level < m_confBuild.unlockLevel)
                            {
                                PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("map_clock_level_mission", m_confBuild.unlockLevel, taskName));
                            }
                            else
                            {
                                PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("group_unlock_tips", taskName));
                            }
                            return;
                        }
                    });
                    // bool taskComplete = true;//GlobalInfo.MY_PLAYER_INFO.PlayerTaskSystem.IsCompleteTaskByConfigID(m_confBuild.unlockTask);
                }
                else
                {
                    PopUpManager.OpenNormalOnePop(LocalizeModule.Instance.GetString("map_clock_level", m_confBuild.unlockLevel));
                }
            }
        }
예제 #15
0
        private static void PopupInfo(string content_, string content_param0_ = "")
        {
            PopUpData pd = new PopUpData();

            pd.title          = string.Empty;
            pd.content        = content_;
            pd.content_param0 = content_param0_;
            pd.isOneBtn       = true;
            pd.twoStr         = "UI.OK";
            pd.oneAction      = null;
            pd.twoAction      = null;

            PopUpManager.OpenPopUp(pd);
        }
예제 #16
0
 private void Quit(GameObject obj)
 {
     if (this.m_chooseCom.Visible)
     {
         this.m_chooseCom.Visible = false;
     }
     else
     {
         PopUpManager.OnCloseSureUI("persuade_exit_tips", "persuade_exit_ta", "persuade_exit_quit", () => {
             PresuadeUILogic.Hide();
         });
         //Hide();
     }
 }
예제 #17
0
        private void OnResponse(object msg)
        {
            if (msg == null)
            {
                return;
            }
            if (msg is MarketResponse)
            {
                MarketResponse res = (MarketResponse)msg;
                if (res.Category == Category.Black)
                {
                    m_ChooseEffect.gameObject.transform.SetParent(m_MaskRoot, false);
                    m_blackdata   = ShopHelper.getShopData(res);
                    m_NeedReflash = true;
                    System.DateTime dt = CommonTools.TimeStampToDateTime(m_blackdata.m_NextReflashTime);
                    m_TotalSecond          = (float)(dt - System.DateTime.Now).TotalSeconds + 2;
                    m_curTime              = Time.time;
                    m_tradingTime_lab.Text = CommonTools.SecondToStringDDMMSS(m_TotalSecond);
                    ReflashShop(m_blackdata);
                }
                else if (res.Category == Category.Common)
                {
                    m_ChooseEffect.gameObject.transform.SetParent(m_MaskRoot, false);
                    m_propdata = ShopHelper.getShopData((res));
                    ReflashShop(m_propdata);
                }
            }
            else if (msg is MarkeFreshResponse)
            {
                MarkeFreshResponse res = (MarkeFreshResponse)msg;
                if (res.ResponseStatus == null)
                {
                    m_ChooseEffect.gameObject.transform.SetParent(m_MaskRoot, false);
                    GlobalInfo.MY_PLAYER_INFO.ChangeCash(-m_blackdata.m_reflashCost);

                    MarketResponse shopRes = new MarketResponse();
                    shopRes.MarketBlack = res.MarketBlack;
                    shopRes.MarketItems.Clear();
                    shopRes.MarketItems.Add(res.MarketItems);
                    shopRes.Category = Category.Black;
                    m_blackdata      = ShopHelper.getShopData(shopRes);
                    ReflashShop(m_blackdata);
                }
                else
                {
                    ResponseStatus resStatus = res.ResponseStatus;
                    PopUpManager.OpenNormalOnePop("shop_limite_times");
                }
            }
        }
예제 #18
0
        public void OfflineTipsNoRetry()
        {
            EngineCore.EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_SYNC_LOADING);

            PopUpData pd = new PopUpData();

            pd.title          = "NETWORK_TIME";
            pd.content        = "systen_unusual";
            pd.content_param0 = null;
            pd.isOneBtn       = true;
            pd.order_in_layer = 13000;

            PopUpManager.OpenPopUp(pd);
        }
예제 #19
0
        private void NeedAnOfficerForEventGame(int idx_)
        {
            m_cur_dispath_index = idx_;

            if (EventGamePoliceDispatchManager.Instance.GetAllDispathOfficersID().Count == GlobalInfo.MY_PLAYER_INFO.Officer_infos.Count)
            {
                PopUpManager.OpenNormalOnePop("action_start_no_police");
                return;
            }

            GameEvents.UIEvents.UI_Enter_Event.Tell_GetAllDispatchedOfficerID += EventGamePoliceDispatchManager.Instance.GetAllDispathOfficersID;
            GameEvents.UIEvents.UI_Enter_Event.Tell_GetGameType += EventGamePoliceDispatchManager.Instance.GetGameType;
            EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_SELECT_POLICE_GRID);
        }
        public override void Update()
        {
            base.Update();

            if (m_is_start_timer)
            {
                m_cur_time += Time.deltaTime;

                if (m_cur_time > 30)
                {
                    OccurEror();
                    PopUpManager.OpenNormalOnePop("systen_unusual");
                }
            }
        }
예제 #21
0
        public void OfflineTips()
        {
            HttpPingModule.Instance.Enable = false;
            EngineCore.EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_SYNC_LOADING);

            PopUpData pd = new PopUpData();

            pd.title          = "NETWORK_TIME";
            pd.content        = "systen_unusual";
            pd.content_param0 = null;
            pd.isOneBtn       = false;
            pd.twoStr         = "close_button";
            pd.order_in_layer = 13000;
            if (InOrOutScene.InScene == (InOrOutScene)((SceneModule.Instance.CurrentScene is GameSceneBase) ? 1 : 0))
            {
                if (SceneBase.GameStatus.GAMEOVER != ((GameSceneBase)(SceneModule.Instance.CurrentScene)).CurGameStatus)
                {
                    PauseGame();
                    pd.oneAction = SendNeedMoreTime;
                }
                else
                {
                    pd.oneAction = TestNetworkAgain;
                }
            }
            else if (0 != LoadingManager.Instance.SCENE_ID)
            {
                PauseGame();
                pd.oneAction = SendNeedMoreTime;
            }
            else
            {
                if (GameRoot.instance.GameFSM.CurrentState.StateFlag.Equals((int)ClientFSM.ClientState.LOGIN))
                {
                    pd.oneAction = null;
                    ResetOfflineTime();
                }
                else
                {
                    pd.oneAction = TestNetworkAgain;
                }
            }

            pd.twoAction = BackToLogin;

            PopUpManager.OpenPopUp(pd);
        }
예제 #22
0
        private void TransactionTips(string desc_, bool ok_)
        {
            PopUpData pd = new PopUpData();

            pd.title = "recharge_title";
            if (ok_)
            {
                pd.content = "recharge_ok";
            }
            else
            {
                pd.content = "recharge_fail";
            }
            pd.content_param0 = desc_;
            pd.isOneBtn       = true;

            PopUpManager.OpenPopUp(pd);
        }
예제 #23
0
        private void DelPopUp()
        {
            PopUpData pd = new PopUpData();

            pd.title         = string.Empty;
            pd.content       = "friend_delete";
            pd.isOneBtn      = false;
            pd.OneButtonText = "shop_no";
            pd.twoStr        = "UI.OK";
            pd.oneAction     = null;
            pd.twoAction     = delegate()
            {
                EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.friend_unfriend.ToString());
                GameEvents.UIEvents.UI_Friend_Event.OnInfoChanged.SafeInvoke(this.m_player_id, ENUM_INFO_CONTROL.E_DEL);
            };

            PopUpManager.OpenPopUp(pd);
        }
예제 #24
0
        private void OnSure(GameObject obj)
        {
            ConfProp confProp = m_bagData.prop.prop;

            if (m_bagData.infoType == PropInfoTypeEnum.Use)
            {
                if (confProp.type == 3)
                {
                    EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.gift_open.ToString());
                    CSDropReq req = new CSDropReq();
                    req.PropId = confProp.id;
                    req.Count  = m_curNum;
                    GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
                }
                else
                {
                    EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.item_use.ToString());
                    if (confProp.skillId <= 0)
                    {
                        PopUpManager.OpenNormalOnePop("skill not exits");
                    }
                    GameSkillManager.Instance.OnStartSkill(confProp.id, m_curNum);
                }
            }
            else if (m_bagData.infoType == PropInfoTypeEnum.Sale)
            {
                EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.item_sold.ToString());
                PlayerPropSellRequest req        = new PlayerPropSellRequest();
                PlayerPropMsg         playerProp = new PlayerPropMsg();
                playerProp.PropId = confProp.id;
                playerProp.Count  = m_curNum;
                req.PlayerProps.Add(playerProp);
                GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
                System.Collections.Generic.Dictionary <UBSParamKeyName, object> _params = new System.Collections.Generic.Dictionary <UBSParamKeyName, object>()
                {
                    { UBSParamKeyName.ContentID, confProp.id },
                    { UBSParamKeyName.ContentType, 1 },
                    { UBSParamKeyName.Description, UBSDescription.PROPSELL }
                };
                UserBehaviorStatisticsModules.Instance.LogEvent(UBSEventKeyName.Pror_use, 1.0f, _params);
            }
            //GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(confProp.id);
            //EngineCoreEvents.UIEvent.HideUIEvent.SafeInvoke(UIDefine.UI_BAGUSE);
        }
예제 #25
0
        public void ShopBuy(long marketID, int market_count, int prop_count, ShopType type, int cost, CostType costType)
        {
            if (costType == CostType.CostCash)
            {
                EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.shop_buycash.ToString());
                if (GlobalInfo.MY_PLAYER_INFO.Cash < cost)
                {
                    //PopUpManager.OpenCashBuyError();
                    PopUpManager.OpenGoToCashShop();
                    return;
                }

                if (GlobalInfo.Enable_Purchase)
                {
                    PopUpBuyConfirm(marketID, market_count, prop_count, type, cost);
                    return;
                }
            }
            else if (costType == CostType.CostCoin)
            {
                EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.shop_buycoin.ToString());
                if (GlobalInfo.MY_PLAYER_INFO.Coin < cost)
                {
                    //PopUpManager.OpenCoinBuyError();
                    //PopUpManager.OpenGoToCoinShop();
                    PushGiftManager.Instance.TurnOn(ENUM_PUSH_GIFT_BLOCK_TYPE.E_COIN);
                    return;
                }
            }
            GameEvents.BuyEvent.OnShopReq.SafeInvoke(marketID, market_count, market_count * prop_count, type);
#if Test
            MarkeBuyResponse res = new global::MarkeBuyResponse();
            res.ResponseStatus      = new ResponseStatus();
            res.ResponseStatus.Code = 0;
            MarkeBuyResponse(res);
#else
            MarkeBuyRequest req = new MarkeBuyRequest();
            req.MarketItemId = (int)marketID;
            req.Count        = market_count;
            GameEvents.NetWorkEvents.SendMsg.SafeInvoke(req);
#endif
        }
예제 #26
0
 void btnShop(GameObject obj)
 {
     if (!SeekerGame.NewGuid.GuidNewManager.Instance.GetProgressByIndex(8))
     {
         PopUpManager.OpenNormalOnePop("guid_shop_no");
         return;
     }
     if (GameEvents.UIEvents.UI_Bag_Event.GetCurrentBagType() == BagTypeEnum.Energy)
     {
         EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, EngineCommonAudioKey.Button_Click_Common.ToString());
         //EngineCoreEvents.UIEvent.ShowUIEvent.SafeInvoke(UIDefine.UI_SHOPENERGY);
         //EngineCoreEvents.UIEvent.ShowUIByOther.SafeInvoke(UIDefine.UI_SHOPENERGY, UIDefine.UI_BAG);
         EngineCoreEvents.UIEvent.ShowUIByOther.SafeInvoke(UIDefine.UI_SHOP, UIDefine.UI_BAG);
     }
     else
     {
         //GameEvents.UIEvents.UI_GameEntry_Event.OnOpenPanel.SafeInvoke(UIDefine.UI_SHOP);
         EngineCoreEvents.UIEvent.ShowUIByOther.SafeInvoke(UIDefine.UI_SHOP, UIDefine.UI_BAG);
     }
 }
예제 #27
0
        private void NetRequestReflash()
        {
            if (m_blackdata.m_reflashCost > GlobalInfo.MY_PLAYER_INFO.Cash)
            {
                PopUpManager.OpenCashBuyError();
                return;
            }
            MarkeFreshRequest refreshReq = new MarkeFreshRequest();

#if !NETWORK_SYNC || UNITY_EDITOR
            GameEvents.NetWorkEvents.SendHalfSyncMsg.SafeInvoke(refreshReq);
#else
            GameEvents.NetWorkEvents.SendMsg.SafeInvoke(refreshReq);
#endif


#if Test
#else
#endif
        }
예제 #28
0
        private void OnClick(GameObject obj)
        {
            EngineCoreEvents.AudioEvents.PlayAudio.SafeInvoke(Audio.AudioType.UISound, GameCustomAudioKey.game_star.ToString());

            if (m_item_in_bag_num >= m_item_cost_num)
            {
                CurViewLogic().StartGame();
            }
            else
            {
                PopUpData pd = new PopUpData()
                {
                    title         = string.Empty,
                    content       = "action_pt_mp",
                    isOneBtn      = true,
                    OneButtonText = "UI.OK",
                };

                PopUpManager.OpenPopUp(pd);
            }
        }
예제 #29
0
        private void BackToLogin(string title_, string content_)
        {
            System.Action act = () =>
            {
                BigWorldManager.Instance.ClearBigWorld();
                EngineCoreEvents.ResourceEvent.LeaveScene.SafeInvoke();

                FrameMgr.Instance.HideAllFrames(new List <string>()
                {
                    UIDefine.UI_GUEST_LOGIN, UIDefine.UI_GM, UIDefine.UI_GUID
                });


                TimeModule.Instance.SetTimeout(() => GameRoot.instance.GameFSM.GotoState((int)ClientFSM.ClientState.LOGIN), 1.0f);
            };

            PopUpData pd = new PopUpData();

            pd.title     = title_;
            pd.content   = content_;
            pd.isOneBtn  = true;
            pd.oneAction = act;
            PopUpManager.OpenPopUp(pd);
        }
예제 #30
0
        private void OnBuyCallback(MarkeBuyResponse res)
        {
            if (m_itemdata == null || m_requestType != m_curShopType)
            {
                return;
            }
            if (res.ResponseStatus != null)  ////////////////TTTTT
            {
                PopUpManager.OpenNormalOnePop("shop_rmb_no");
            }
            else
            {
                if (m_itemdata.marketID == m_requestID)
                {
                    m_requestType = ShopType.None;
                    int cost = 0;
                    if (m_itemdata.m_hasDis)
                    {
                        cost = m_itemdata.m_disPrice * m_requestCount;
                    }
                    else
                    {
                        cost = m_itemdata.m_oriPrice * m_requestCount;
                    }
                    if (m_itemdata.m_costType == CostType.CostCash)
                    {
                        GlobalInfo.MY_PLAYER_INFO.ChangeCash(-cost);
                    }
                    else if (m_itemdata.m_costType == CostType.CostCoin)
                    {
                        GlobalInfo.MY_PLAYER_INFO.ChangeCoin(-cost);
                    }
                    PopUpManager.OpenNormalOnePop("shop_rmb_ok");
                    //CommonHelper.OpenGift(m_itemdata.m_prop.id, m_requestCount);

                    if (m_is_fast_buy)
                    {
                        if (12 != res.Props.PropId) //火锅
                        {
                            GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(res.Props.PropId, res.Props.Count);

                            GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke();
                        }
                        GameSkillManager.Instance.OnStartSkill(m_itemdata.m_prop.id, 1);
                    }
                    else
                    {
                        if (ShopType.Vit == m_curShopType)
                        {
                            ConfProp confProp = ConfProp.Get(m_itemdata.m_prop.id);
                            if (confProp != null && confProp.skillId != 26)
                            {
                                long itemID  = res.Props.PropId;
                                int  itemNum = res.Props.Count;

                                GlobalInfo.MY_PLAYER_INFO.AddSingleBagInfo(res.Props.PropId, res.Props.Count);
                                GameEvents.UIEvents.UI_Bag_Event.OnPropCost.SafeInvoke(m_itemdata.m_prop.id);

                                GameEvents.UIEvents.UI_GameEntry_Event.Listen_OnCombinePropCollected.SafeInvoke();
                            }
                            else if (confProp != null)
                            {
                                ConfSkill confskill = ConfSkill.Get(confProp.skillId);
                                VitManager.Instance.ReflashInfiniteVitTime(confskill.duration * 1000);
                            }
                        }
                    }

                    if (m_itemdata.m_limitNumber > 0)
                    {
                        --m_itemdata.m_limitNumber;

                        m_limited_buy_num_txt.Text = string.Format("({0}/{1})", m_itemdata.m_limitNumber, m_limited_max_num);

                        if (0 == m_itemdata.m_limitNumber)
                        {
                            m_limited_buy_btn.Enable = false;
                            m_limited_buy_btn.SetGray(true);
                        }
                        else
                        {
                            m_limited_buy_btn.Enable = true;
                            m_limited_buy_btn.SetGray(false);
                        }

                        this.SwitchButton();

                        return;
                    }


                    if (1 == m_itemdata.m_number && false == m_itemdata.m_hasDis)
                    {
                        this.SwitchButton();
                    }
                }
            }
        }