Ejemplo n.º 1
0
        public void GuideActionEnd(UGuideWidgetMsgData _msgData)
        {
            if (cultureArray.Length == 0)
            {
                Trace.LogWarning("本命英雄培养仓数量为0?");
            }

            if (_msgData.nGuideStepID == 0)
            {
                cultureArray[0].cultureBtn.gameObject.RemoveComponent <Guide.UGuideWidget>();
            }
            else if (_msgData.nGuideStepID == 3)
            {
                this.injectFrame.GuideActionEnd(_msgData);
            }

            if (_msgData.nGuideID == (int)GUIDE.EGuideNodeID.GuideNodeID_2004)
            {
                if (RecordShareFrame != null)
                {
                    Transform SureBtnTrans = RecordShareFrame.transform.FindChild("SureBtn");
                    if (SureBtnTrans == null)
                    {
                        Trace.LogError("LifeHeroCultureWnd.RecordShareFrame.SureBtn 对象移除了?目前这里需要引导,处理下。");
                        return;
                    }
                    SureBtnTrans.gameObject.RemoveComponent <Guide.UGuideWidget>();
                }
            }

            #endregion
        }
Ejemplo n.º 2
0
        public override void OnMessage(WndMsgID msgID, UIMsgData data)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_LEAVE:
            {
                UnloadView();
            }
            break;

            case WndMsgID.WND_MSG_OPEN_LIFEHERO_SELECT:
            {
                if (data == null)
                {
                    return;
                }

                ULifeHeroCandidateData msgData = data as ULifeHeroCandidateData;
                if (msgData.candidates == null || msgData.candidates.Count == 0)
                {
                    return;
                }

                SetVisible(true);
                if (m_wndView != null)
                {
                    m_wndView.SetData(msgData);
                }
            }
            break;

                #region 新手引导相关
            case WndMsgID.WND_MSG_LIFEHERO_SELECT_GUIDE_ACTIONBEGIN:
            {
                UGuideWidgetMsgData _widgetMsgData = data as UGuideWidgetMsgData;

                if (m_wndView != null && _widgetMsgData != null)
                {
                    m_wndView.GuideActionBegin(_widgetMsgData);
                }
            }
            break;

            case WndMsgID.WND_MSG_LIFEHERO_SELECT_GUIDE_ACTIONEND:
            {
                UGuideWidgetMsgData _widgetMsgData = data as UGuideWidgetMsgData;

                if (m_wndView != null && _widgetMsgData != null)
                {
                    m_wndView.GuideActionEnd(_widgetMsgData);
                }
            }
            break;
                #endregion

            default:
                break;
            }
        }
Ejemplo n.º 3
0
 public void GuideActionBegin(UGuideWidgetMsgData _msgData)
 {
     Guide.UGuideWidget guideWidget = gameObject.AddComponent <Guide.UGuideWidget>();
     if (guideWidget != null)
     {
         guideWidget.SetFromMsgData(_msgData);
     }
 }
Ejemplo n.º 4
0
 public void GuideActionEnd(UGuideWidgetMsgData _msgData)
 {
     Guide.UGuideWidget guideWidget = gameObject.GetComponent <Guide.UGuideWidget>();
     if (guideWidget != null)
     {
         gameObject.RemoveComponent <Guide.UGuideWidget>();
     }
 }
Ejemplo n.º 5
0
 public void SetFromMsgData(UGuideWidgetMsgData _msgData)
 {
     this.GuideID            = (EGuideNodeID)_msgData.nGuideID;
     this.GuideEffectID      = _msgData.nGuideEffectID;
     this.GuideStepID        = _msgData.nGuideStepID;
     this.IsForceGuide       = _msgData.bForeceGuide;
     this.IsAcceptClickEvent = _msgData.bAcceptClickEvent;
 }
Ejemplo n.º 6
0
 public void GuideActionEnd(UGuideWidgetMsgData _msgData)
 {
     if (confirmBtnText == null || confirmBtnText.transform.parent == null)
     {
         Trace.LogError("是不是 InjectPrizeFrame.confirmBtnText 改了?这里需要新手引导响应,处理下。");
         return;
     }
     confirmBtnText.transform.parent.gameObject.RemoveComponent <Guide.UGuideWidget>();
 }
Ejemplo n.º 7
0
        internal void AddGuideUIWidget(UGuideWidgetMsgData _msgData)
        {
            if (_msgData == null || (int)_msgData.oUserData < 1)
            {
                return;
            }

            if (WarMainModeItems.Length >= (int)_msgData.oUserData && WarMainModeItems[(int)_msgData.oUserData - 1] != null)
            {
                WarMainModeItems[(int)_msgData.oUserData - 1].SetGuideWidgetData(true, new UGuideWidgetMsgData(_msgData));
            }
        }
Ejemplo n.º 8
0
        public void GuideActionBegin(UGuideWidgetMsgData _msgData)
        {
            if (confirmBtnText == null || confirmBtnText.transform.parent == null || confirmBtnText.transform.parent.GetComponent <Button>() == null)
            {
                Trace.LogError("是不是 InjectPrizeFrame.confirmBtnText 改了?这里需要新手引导响应,处理下。");
                return;
            }
            Button confirmBtn = confirmBtnText.transform.parent.GetComponent <Button>();

            Guide.UGuideWidget widget = confirmBtn.gameObject.AddComponent <Guide.UGuideWidget>();
            widget.SetFromMsgData(_msgData);
        }
Ejemplo n.º 9
0
        internal void RemoveGuideUIWidget(UGuideWidgetMsgData _msgData)
        {
            {
                if (MiscFrame.StartBtn == null)
                {
                    return;
                }

                Guide.UGuideWidget guideWidget = MiscFrame.StartBtn.gameObject.GetComponent <Guide.UGuideWidget>();
                if (guideWidget != null)
                {
                    MiscFrame.StartBtn.gameObject.RemoveComponent <Guide.UGuideWidget>();
                }
            }
        }
Ejemplo n.º 10
0
        internal void AddGuideUIWidget(UGuideWidgetMsgData _msgData)
        {
            if (MiscFrame == null || MiscFrame.StartBtn == null || _msgData == null)
            {
                return;
            }

            Guide.UGuideWidget guideWidget = MiscFrame.StartBtn.gameObject.GetComponent <Guide.UGuideWidget>();
            if (guideWidget == null)
            {
                guideWidget = MiscFrame.StartBtn.gameObject.AddComponent <Guide.UGuideWidget>();
            }

            guideWidget.SetFromMsgData(_msgData);
        }
Ejemplo n.º 11
0
        public void GuideActionEnd(UGuideWidgetMsgData _msgData)
        {
            if (_msgData.nGuideStepID == 1)
            {
                if (HeroList.DataSource.Count == 0)
                {
                    Trace.LogWarning("没有可用的本命英雄?");
                }

                HeroList.DataSource[0].bUseGuideWidget = false;
                HeroList.DataSource[0].GuideWidgetData = new UGuideWidgetMsgData(_msgData);
            }
            else if (_msgData.nGuideStepID == 2 && sureBtn != null)
            {
                sureBtn.gameObject.RemoveComponent <Guide.UGuideWidget>();
            }
        }
Ejemplo n.º 12
0
        internal void RemoveGuideUIWidget(UGuideWidgetMsgData _msgData)
        {
            if (warHallBtn != null)
            {
                Guide.UGuideWidget guideWidget = warHallBtn.gameObject.GetComponent <Guide.UGuideWidget>();
                if (guideWidget != null)
                {
                    gameObject.RemoveComponent <Guide.UGuideWidget>();

                    SetWarHallBtnType(true);
                    //Text txtTitle = warHallBtn.GetComponentInChildren<Text>();
                    //txtTitle.text = ULocalizationService.Instance.Get("UIView", "PLayerButtonFrameView", "HallBtn");
                }
                warHallBtn.onClick.RemoveAllListeners();
                warHallBtn.onClick.AddListener(onWarHillPressDwon);
            }
        }
Ejemplo n.º 13
0
        internal void AddGuideUIWidget(UGuideWidgetMsgData _msgData)
        {
            if (warHallBtn != null)
            {
                Guide.UGuideWidget guideWidget = warHallBtn.gameObject.GetComponent <Guide.UGuideWidget>();
                if (guideWidget == null)
                {
                    guideWidget = warHallBtn.gameObject.AddComponent <Guide.UGuideWidget>();
                }

                guideWidget.SetFromMsgData(_msgData);

                if (_msgData.oUserData != null)
                {
                    if ((string)_msgData.oUserData == ULocalizationService.Instance.Get("UIView", "PLayerButtonFrameView", "HallBtnGuide"))
                    {
                        SetWarHallBtnType(false);
                    }
                    else
                    {
                        SetWarHallBtnType(true);
                    }
                }

                {
                    if (_msgData.nGuideID == (int)GUIDE.EGuideNodeID.GuideNodeID_2001)
                    {
                        warHallBtn.onClick.RemoveAllListeners();
                        warHallBtn.onClick.AddListener(OnGuideStepFirstEnterClick);
                    }
                    else if (_msgData.nGuideID == (int)GUIDE.EGuideNodeID.GuideNodeID_3001)
                    {
                        warHallBtn.onClick.RemoveAllListeners();
                        warHallBtn.onClick.AddListener(OnGuideMachineBtnClick);
                        warHallBtn.onClick.AddListener(onWarHillPressDwon);
                    }
                }
            }
        }
Ejemplo n.º 14
0
        public void SetGuideWidgetData(bool openGuide, UGuideWidgetMsgData widgetMsg)
        {
            bUseGuideWidget = openGuide;
            GuideWidgetData = widgetMsg;

            if (!bUseGuideWidget)
            {
                gameObject.RemoveComponent <Guide.UGuideWidget>();
            }
            else
            {
                Guide.UGuideWidget guideWidget = gameObject.GetComponent <Guide.UGuideWidget>();
                if (guideWidget == null)
                {
                    guideWidget = gameObject.AddComponent <Guide.UGuideWidget>();
                }
                guideWidget.GuideID       = (GUIDE.EGuideNodeID)GuideWidgetData.nGuideID;
                guideWidget.GuideStepID   = GuideWidgetData.nGuideStepID;
                guideWidget.GuideEffectID = GuideWidgetData.nGuideEffectID;
                guideWidget.IsForceGuide  = GuideWidgetData.bForeceGuide;
                guideWidget.ModalTrans    = guideWidget.IsForceGuide ? GuideModalTrans : null;
            }
        }
Ejemplo n.º 15
0
        public void GuideActionBegin(UGuideWidgetMsgData _msgData)
        {
            if (_msgData.nGuideStepID == 1)
            {
                HeroList.DataSource.BeginUpdate();

                if (HeroList.DataSource.Count == 0)
                {
                    Trace.LogWarning("没有可用的本命英雄?");
                }

                {
                    HeroList.DataSource[0].bUseGuideWidget = true;
                    HeroList.DataSource[0].GuideWidgetData = new UGuideWidgetMsgData(_msgData);
                }
                HeroList.DataSource.EndUpdate();
                HeroList.UpdateItems();
            }
            else if (_msgData.nGuideStepID == 2 && sureBtn != null)
            {
                var widget = sureBtn.gameObject.AddComponent <Guide.UGuideWidget>();
                widget.SetFromMsgData(_msgData);
            }
        }
Ejemplo n.º 16
0
        public override void OnMessage(WndMsgID msgID, UIMsgData data)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_LEAVE:
            {
                UnloadView();
            }
            break;

            case WndMsgID.WND_MSG_LIFEHERO_INJECT:
            {
                if (m_wndView != null)
                {
                    m_wndView.OnInjectLifeHero(data as ULifeHeroInjectHeroData);
                }
            }
            break;

            case WndMsgID.WND_MSG_OPEN_LIFEHERO_CULTURE_HERO_HINT:
            {
                if (m_wndView != null)
                {
                    m_wndView.OnRecvHeroDetailInfo(data as UIMsgCmdData);
                }
            }
            break;

            case WndMsgID.WND_MSG_HERODETAIL_CLOSE:
            {
                if (m_wndView != null)
                {
                    m_wndView.RestoreVeiwState();
                }
            }
            break;

                #region 引导相关的
            case WndMsgID.WND_MSG_LIFEHERO_CULTURE_GUIDE_ACTIONBEGIN:
            {
                UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)data;

                if (m_wndView != null && cmdData != null)
                {
                    m_wndView.GuideActionBegin(cmdData);
                }
            }
            break;

            case WndMsgID.WND_MSG_LIFEHERO_CULTURE_GUIDE_ACTIONEND:
            {
                UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)data;

                if (m_wndView != null && cmdData != null)
                {
                    m_wndView.GuideActionEnd(cmdData);
                }
            }
            break;

                #endregion
            default:
                break;
            }
        }
Ejemplo n.º 17
0
        public override void OnMessage(WndMsgID msgID, UIMsgData data)
        {
            switch (msgID)
            {
                #region 新手引导相关
            case WndMsgID.WND_MSG_LIFEHERO_GUIDE_ACTIONBEGIN:
            {
                SetVisible(true);
                UGuideWidgetMsgData _widgetMsgData = data as UGuideWidgetMsgData;
                if (_widgetMsgData != null)
                {
                    m_wndView.GuideActionBegin(_widgetMsgData);
                }
            }
            break;

            case WndMsgID.WND_MSG_LIFEHERO_GUIDE_ACTIONEND:
            {
                UGuideWidgetMsgData _widgetMsgData = data as UGuideWidgetMsgData;
                if (_widgetMsgData != null && m_wndView != null)
                {
                    m_wndView.GuideActionEnd(_widgetMsgData);
                }
            }
            break;

                #endregion
            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_ENTER:
            case WndMsgID.WND_MSG_UPDATENOVICEGUIDEDATA:
            case WndMsgID.WND_MSG_PLAYERINFO_INITINFO:
            {
                if (!m_isVisible)
                {
                    if (GuideManager.Instance.IsCurrentGuideGreaterEqual(ENNOVICEGUIDE_TYPE.ENNOVICEGUIDE_TYPE_GUIDE_LIFEHEROENTRY) ||
                        (LogicDataCenter.playerSystemDataManager.GetActorPlayerInfo().playerInfo.nLv > 3))
                    {
                        SetVisible(true);
                        if (LogicDataCenter.lifeHeroDataManager.IsFromWarExit)
                        {
                            OpenLifeHeroDialog();
                        }

                        UISystem.Instance.UnregisterWndMessage(WndMsgID.WND_MSG_PLAYERINFO_INITINFO, this);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_LEAVE:
            {
                UnloadView();
                UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_DIALOG_HIDE, new UIDialogHide(EDialogType.LifeHeroEntrance));
            }
            break;

            case WndMsgID.WND_MSG_RECV_ALL_LIFEHERO_INFO:
            case WndMsgID.WND_MSG_LIFEHERO_ENTRANCE_REFRESH_DATA:
            case WndMsgID.WND_MSG_LIFEHERO_RECV_HISTORY_RECORD:
            case WndMsgID.WND_MSG_OPEN_LIFEHERO_CULTURE_HERO_HINT:
            {
                if (m_wndView != null)
                {
                    m_wndView.RefreshView();
                }
            }
            break;

            default:
                break;
            }
        }
Ejemplo n.º 18
0
        // 接受消息
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            UIMsgCmdData data = msgData as UIMsgCmdData;

            switch (msgID)
            {
            case WndMsgID.WND_MSG_WAR_MAIN_OPEN:
            {
                //// 隐藏其他同级窗体
                //UISystem.Instance.ShowWnd(WndID.WND_ID_SOCIALCONTACT, false);
                //UISystem.Instance.ShowWnd(WndID.WND_ID_CHART, false);

                SetVisible(true);
                if (m_wndView != null)
                {
                    m_wndView.WarMainModeItemsInit();
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMON_LOGINMOBA:
            {
                this.UnloadView();
            }
            break;

            case WndMsgID.WND_MSG_WAR_MAIN_CLOSE:
            {
                // 隐藏其他同级窗体
                OnCloseKey();
            }
            break;

            case WndMsgID.WND_MSG_WAR_MAIN_MATCHTYPE_OPEN_OR_CLOSE:
            {
                //更新下显示相关
                if (m_wndView != null)
                {
                    m_wndView.WarMainModeItemsInit();
                }
            }
            break;

                #region 新手引导部分

            case WndMsgID.WND_MSG_WAR_MAIN_GAMEMODEBTN_ADDGUIDEWIDGET:
            {
                if (m_wndView == null)
                {
                    LoadView();
                    SetVisible(false);
                }
                UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                if (cmdData != null)
                {
                    m_wndView.AddGuideUIWidget(cmdData);
                }
            }
            break;

            case WndMsgID.WND_MSG_WAR_MAIN_GAMEMODEBTN_REMOVEGUIDEWIDGET:
            {
                if (m_wndView != null)
                {
                    UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                    if (cmdData != null)
                    {
                        m_wndView.RemoveGuideUIWidget(cmdData);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_WAR_MAIN_GUIDE_ACTIONBEGIN:
            {
                if (m_wndView != null)
                {
                    m_wndView.GuideActionBegin();
                }
            }
            break;

            case WndMsgID.WND_MSG_WAR_MAIN_GUIDE_ACTIONEND:
            {
                if (m_wndView != null)
                {
                    m_wndView.GuideActionEnd();
                }
            }
            break;
                #endregion

            default:
                break;
            }
        }
Ejemplo n.º 19
0
        // 接收消息
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_ENTER:
            {
                SetVisible(true);
            }
            break;

            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_LEAVE:
            {
                this.UnloadView();
            }
            break;

            case WndMsgID.WND_MSG_PLAYERBUTTONFRAME_SETREDPOINTTIP:
            {
                if (m_wndView != null)
                {
                    m_wndView.SetRedPointTip(msgData as RedPointSetCount);
                }
            }
            break;

            case WndMsgID.WND_MSG_PLAYERBUTTONFRAME_SIMULATEVIEWOPEN:
            {
                if (m_wndView != null)
                {
                    PlayerButtonFrameSimulateOpenData data = msgData as PlayerButtonFrameSimulateOpenData;
                    m_wndView.SimulateOpenView(data.eViewType);
                }
            }
            break;

            case WndMsgID.WND_MSG_MAIL_NEWMAILCOUNT:
            {
                if (m_wndView != null)
                {
                    m_wndView.UpdateMailRedTip();
                }
            }
            break;

            case WndMsgID.WND_MSG_CROWNPAGE_REDPOINTTIP:
            {
                if (m_wndView != null)
                {
                    UIMsgCmdData cmdData = (UIMsgCmdData)msgData;
                    m_wndView.SetGemstoneRedPointCount(cmdData.nParam);
                }
            }
            break;

            case WndMsgID.WND_MSG_MSTCHTIMEINFO_SHOW:
            {
                if (m_wndView != null)
                {
                    if (LogicDataCenter.viewPersonStateDataManager.bIsMatching == false)
                    {
                        m_wndView.warHallBtn.gameObject.SetActive(false);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_ACCEPTWAIT_SHOW:
            case WndMsgID.WND_MSG_MSTCHTIMEINFO_HIDE:
            case WndMsgID.WND_MSG_COMMOM_MATCHROOMSTATE_ENTER:
            {
                if (m_wndView != null)
                {
                    m_wndView.warHallBtn.gameObject.SetActive(true);
                }
            }
            break;

                #region 新手引导

            case WndMsgID.WND_MSG_PLAYERBUTTONFRAME_WARHALLBUTTON_ADDGUIDEWIDGET:
            {
                if (m_wndView != null)
                {
                    UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                    if (cmdData != null)
                    {
                        m_wndView.AddGuideUIWidget(cmdData);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_PLAYERBUTTONFRAME_WARHALLBUTTON_REMOVEGUIDEWIDGET:
            {
                if (m_wndView != null)
                {
                    UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                    if (cmdData != null)
                    {
                        m_wndView.RemoveGuideUIWidget(cmdData);
                    }
                }
            }
            break;

                #endregion
            default:
                break;
            }
        }
Ejemplo n.º 20
0
        // 接收消息
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_ENTER:
            {
                AddListener();
            }
            break;

            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_ENTER:
            {
                RemoveListener();
                if (m_wndView != null)
                {
                    UnloadView();
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMON_WAREND:
            {
                UCommonWarEndMsgData uiInfo = (UCommonWarEndMsgData)msgData;
                if (m_wndView == null)
                {
                    LoadView();
                }

                SetVisible(false);

                m_wndView.setResult(uiInfo.isSelfWin, uiInfo.nUseTime);
            }
            break;

            case WndMsgID.WND_MSG_WAR_RECORDTABLE_END_SHOW:
            {
                if (m_wndView == null)
                {
                    LoadView();
                }
                SetVisible(true);

                // 设置结算界面基本信息
                SetRecordTableBaseInfo();

                // 显示杯赛信息
                ShowWarEndLegendCupInfo();

                // 自动炫耀战绩
                CheckAutoSendWarResult();
            }
            break;

            //case WndMsgID.WND_MSG_WAR_RECORDTABLE_END_BASEFRAME:
            //    {
            //        if (m_wndView == null)
            //        {
            //            LoadView();
            //        }
            //        SetRecordTableBaseInfo();
            //    }
            //    break;
            //case WndMsgID.WND_MSG_WAR_RECORDTABLE_END_INITAWAKEINFO:
            //    {
            //        if (m_wndView == null)
            //        {
            //            LoadView();
            //        }
            //        m_wndView.initAwakeInfo();
            //        CheckAutoSendWarResult();
            //    }
            //    break;

            case WndMsgID.WND_MSG_RECORDTABLE_END_EXITBTN_ADDGUIDEWIDGET:
            {
                if (m_wndView != null)
                {
                    UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                    if (cmdData != null)
                    {
                        m_wndView.AddExitBtnGuideUIWidget(cmdData);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_RECORDTABLE_END_EXITBTN_REMOVEGUIDEWIDGET:
            {
                if (m_wndView != null)
                {
                    UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                    if (cmdData != null)
                    {
                        m_wndView.RemoveExitBtnGuideUIWidget(cmdData);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE:
            {
                RemoveListener();
                if (m_wndView != null)
                {
                    UnloadView();
                }
            }
            break;

            default:
                break;
            }
        }
Ejemplo n.º 21
0
        // 接受消息
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            saveCacheUIMsg(msgID, msgData);

            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_ENTER:
            {
                if (m_wndView == null)
                {
                    LoadView();
                    SetVisible(true);
                }

                // 运行缓存的消息
                runCacheUIMsg();
            }
            break;

            case WndMsgID.WND_ID_HEROTALENTVIEW_HEROTALENTVISIBLE:
            {
                if (m_wndView == null)
                {
                    return;
                }

                HeroTalentVisibleData uiTalent = (HeroTalentVisibleData)msgData;
                if (uiTalent.bVisible)
                {
                    // 显示
                    SetHeroTalentViewOpen();
                }
                else
                {
                    // 不显示
                    m_wndView.ShowMainTalent(false, false);
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMON_WAREND:
            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE:
            {
                this.UnloadView();
                m_CacheUIMsgList.Clear();
            }
            break;

            case WndMsgID.WND_MSG_COMMON_MAINHEROFIGHTSTATE:
            {
                // 战斗状态关闭天赋窗口
                if (m_bIsGuiding == false)
                {
                    CloseMainHeroTalentView();
                }
            }
            break;

            case WndMsgID.WND_ID_HEROTALENTVIEW_INITWARTALENT:
            {
                if (m_wndView == null)
                {
                    return;
                }

                if (EntityUtil.getMainHeroHeroID() <= 0)
                {
                    return;
                }

                Debug.LogWarning("WND_ID_HEROTALENTVIEW_INITWARTALENT");

                // 初始化本英雄的天赋列表界面数据
                InitShowDataInfo(EntityUtil.getMainHeroHeroID());
            }
            break;

            case WndMsgID.WND_ID_HEROTALENTVIEW_ACTIVEDTALENTLISTUPDATE:
            {
                // 断线重连情况下,该消息比BATTLESTATE_ENTER消息先来
                if (m_wndView == null)
                {
                    LoadView();
                    SetVisible(true);
                }

                // 已激活的主动学习天赋列表更新
                if (m_wndView != null)
                {
                    // 每次成功激活一个天赋后执行
                    UIMsgCmdData uiTalent  = (UIMsgCmdData)msgData;
                    int          nTalentId = uiTalent.nParam;
                    if (nTalentId > 0)
                    {
                        m_wndView.onActivedTalent(nTalentId);
                    }
                    else
                    {
                        // 断线重连后收到天赋列表
                        cmd_war_active_talent_list talentList = new cmd_war_active_talent_list();
                        if (LogicDataCenter.heroTalentDataManager.getActiveTalentList((ulong)EntityUtil.getMainHeroPdbid(), out talentList))
                        {
                            foreach (int item in talentList.nTalentList)
                            {
                                m_wndView.onActivedTalent(item);
                            }
                        }
                    }

                    m_wndView.ShowMainTalent(false);
                }
            }
            break;

                #region 新手引导
            case WndMsgID.WND_ID_HEROTALENTVIEW_ADDGUIDEWIDGET:
            {
                if (m_wndView != null && msgData != null)
                {
                    UGuideWidgetMsgData uiTalent = (UGuideWidgetMsgData)msgData;
                    m_bIsGuiding = true;
                    m_wndView.AddGuideWidget(uiTalent);
                }
            }
            break;

            case WndMsgID.WND_ID_HEROTALENTVIEW_REMOVEGUIDEWIDGET:
            {
                if (m_wndView != null && msgData != null)
                {
                    UGuideWidgetMsgData uiTalent = (UGuideWidgetMsgData)msgData;
                    m_bIsGuiding = false;
                    m_wndView.RemoveGuideWidget(uiTalent);
                }
            }
            break;

                #endregion
            default:
                break;
            }
        }
Ejemplo n.º 22
0
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFO:
            {
                HeroDetailViewData.Instance.Clear();
                UIMsgCmdData uiInitHeroInfo = (UIMsgCmdData)msgData;
                cmd_Return_Hero_Detail_Info initHeroInfo = IntPtrHelper.toData <cmd_Return_Hero_Detail_Info>(uiInitHeroInfo.ptrParam);
                SetHeroDetailData(initHeroInfo.nHeroID, initHeroInfo.nPDBID);

                SetVisible(true);
            }
            break;

            case WndMsgID.WND_MSG_HERODETAIL_HERODETAILINFOREFRESH:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData uiRefreshHeroInfo = (UIMsgCmdData)msgData;
                cmd_Return_Hero_Detail_Info refreshHeroInfo = IntPtrHelper.toData <cmd_Return_Hero_Detail_Info>(uiRefreshHeroInfo.ptrParam);
                if (refreshHeroInfo.nHeroID != HeroDetailViewData.Instance.nHeroID || refreshHeroInfo.nPDBID != HeroDetailViewData.Instance.nReqPDBID)
                {
                    return;
                }

                SetHeroDetailData(refreshHeroInfo.nHeroID, refreshHeroInfo.nPDBID);
                m_wndView.OnBuyOrChangeHeroSuccess();
            }
            break;

            case WndMsgID.WND_MSG_CHICKUPGRADEBUTTON_RETURN:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData uiHeroInfo             = (UIMsgCmdData)msgData;
                cmd_entity_hero_diff_expend cmdData = IntPtrHelper.toData <cmd_entity_hero_diff_expend>(uiHeroInfo.ptrParam);
                m_wndView.OnRecvHeroDiffInfo(cmdData);
            }
            break;

            case WndMsgID.WND_MSG_UPGRADESTARSUCESS_RESULT:
            {
                if (m_wndView == null)
                {
                    return;
                }

                if (!this.IsVisible())
                {
                    return;
                }

                UIMsgCmdData uiHeroUpStarInfo = (UIMsgCmdData)msgData;
                cmd_Return_HeroDetail_Upgrade_Success cmdUpStarData = IntPtrHelper.toData <cmd_Return_HeroDetail_Upgrade_Success>(uiHeroUpStarInfo.ptrParam);
                m_wndView.ShowUpStarSucess(cmdUpStarData);
            }
            break;

            case WndMsgID.WND_MSG_HEROSKINVIEW_UPDATESKINDATA:
            {
                if (m_wndView == null)
                {
                    return;
                }

                m_wndView.OnBuyOrChangeHeroSuccess();
            }
            break;

            case WndMsgID.WND_MSG_HERODETAIL_HERODETAILXPUPDATE:
            {
                if (m_wndView == null)
                {
                    return;
                }

                m_wndView.UpdateXPSkillList();
            }
            break;

            case WndMsgID.WND_MSG_HEROPREVIEWFRAME_GETHEROINFO:
            {
                if (m_wndView != null)
                {
                    // 购买卡牌,卡牌数据主动更新
                    int                      nHeroID = HeroDetailViewData.Instance.nHeroID;
                    IntPtrHelper             helper  = new IntPtrHelper();
                    cmd_get_hero_detail_info data    = new cmd_get_hero_detail_info();
                    data.nHeroID   = nHeroID;
                    data.nStarLv   = 1;
                    data.nStaticLv = 1;
                    ActorHeroInfo info = LogicDataCenter.playerSystemDataManager.GetActorAllHero();
                    if (info.dicEntityHeroInfo.ContainsKey(nHeroID))
                    {
                        data.nStarLv   = info.dicEntityHeroInfo[nHeroID].byStarLv;
                        data.nStaticLv = info.dicEntityHeroInfo[nHeroID].nLv;
                    }
                    IntPtr ptr = helper.toPtr <cmd_get_hero_detail_info>(ref data);
                    int    len = Marshal.SizeOf(data);

                    GameLogicAPI.onEntityEvent(EntityFactory.MainHeroID, (int)EntityLogicDef.ENTITY_CMD_REQ_UPGRADESTARANDHEROPRO, len, "", ptr, len);
                }
            }
            break;

            case WndMsgID.WND_MSG_HERODETAIL_UPDATEGOLD:
            {
                if (m_wndView != null && IsVisible())
                {
                    UIMsgCmdData uiData = (UIMsgCmdData)msgData;
                    m_wndView.UpdateUpStarGoldView(uiData.nParam);
                }
            }
            break;

            case WndMsgID.WND_ID_HEROTALENTVIEW_UPDATESTATICTALENT:
            {
                if (m_wndView != null && IsVisible())
                {
                    m_wndView.OnUpdateHeroTalent();
                }
            }
            break;

                #region 新手引导相关
            case WndMsgID.WND_MSG_HERODETAIL_GUIDE_ACTIONBEGIN:
            {
                UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;

                if (m_wndView != null && cmdData != null)
                {
                    m_wndView.GuideActionBegin(cmdData);
                }
            }
            break;

            case WndMsgID.WND_MSG_HERODETAIL_GUIDE_ACTIONEND:
            {
                UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;

                if (m_wndView != null && cmdData != null)
                {
                    m_wndView.GuideActionEnd(cmdData);
                }
            }
            break;

                #endregion
            default:
                break;
            }
        }
Ejemplo n.º 23
0
        public override void OnMessage(WndMsgID msgID, UIMsgData data)
        {
            switch (msgID)
            {
            case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_ENTER:
                this.SetVisible(false);
                LoadView();

                break;

            case WndMsgID.WND_MSG_GAMEGUIDE_ADDNODEMESSAGE:
            {
                //this.SetVisible(true);
                UGuideMsgData gData = data as UGuideMsgData;

                if (m_wndView == null || gData == null || string.IsNullOrEmpty(gData.strMsgText))
                {
                    break;
                }
                if (gData != null)
                {
                    #region 旧版处理
                    //m_messageQueue.Add(gData);
                    //if(m_messageQueue.Count >=1 && m_bAnimPlaying && !m_bRunningTimerID_0)
                    //{
                    //    m_bRunningTimerID_0 = true;
                    //    TimerManager.SetTimer(this, m_nPlayTimerID_0, m_nDelayPlayAnimDuration, 1);
                    //}
                    //PlayAnim();
                    #endregion
                    UBB.toHtml(ref gData.strMsgText);
                    SetVisible(true);
                    m_wndView.Show(gData);

                    ToggleModal(gData);
                }
            }
            break;

            case WndMsgID.WND_MSG_GAMEGUIDE_REMOVENODEMESSAGE:
            {
                if (m_wndView == null)
                {
                    break;
                }
                UGuideMsgRemoveData gData = data as UGuideMsgRemoveData;
                if (gData != null)         //&& gData.nGuideNodeID == m_eAddMessageGuideNodeID)
                {
                    #region 旧版处理
                    //if (gData.nGuideNodeID == m_eAddMessageGuideNodeID && !m_bRunningTimerID_0)
                    //    m_wndView.RemoveNode();
                    //else
                    //{
                    //    int removeIndex = m_messageQueue.FindIndex((queueData) => { if (queueData.nGuideNodeID == gData.nGuideNodeID) return true; else return false; });
                    //    if(removeIndex != -1)
                    //        m_messageQueue.RemoveAt(removeIndex);
                    //}
                    #endregion
                    if (gData.IsRemoveMessage)
                    {
                        m_wndView.Hide();
                    }
                    if (gData.IsRemoveModal)
                    {
                        m_wndView.HideModal();
                    }
                    if (gData.IsHideView)
                    {
                        SetVisible(false);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMON_LOGINSTATE_ENTER:
            {
                if (m_wndView != null)
                {
                    #region 旧版处理
                    //m_wndView.ClearNode();
                    //TimerManager.KillTimer(this, m_nPlayTimerID_0);
                    #endregion
                    m_wndView.Clear();
                    m_wndView.HideModal();

                    SetVisible(false);
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMON_LOGINMOBA:
            case WndMsgID.WND_MSG_COMMON_WAREND:
            case WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE:
            case WndMsgID.WND_MSG_GAMEGUIDE_REMOVEALLMESSAGE:
            {
                if (m_wndView == null)
                {
                    break;
                }
                #region 旧版处理
                //m_messageQueue.Clear();
                //m_wndView.RemoveNode();
                //TimerManager.KillTimer(this, m_nPlayTimerID_0);
                #endregion

                //WND_MSG_COMMON_WAREND 关闭引导提示
                //WND_MSG_COMMON_BATTLESTATE_LEAVE 启用引导提示
                m_bEnableGuideUI = msgID == WndMsgID.WND_MSG_COMMON_WAREND ? false : msgID == WndMsgID.WND_MSG_COMMON_BATTLESTATE_LEAVE ? true : true;


                m_wndView.Clear();
                m_wndView.HideModal();

                SetVisible(false);
            }
            break;

            case WndMsgID.WND_MSG_GAMEGUIDE_ADDAUTOMESSAGE:
            {
                if (m_wndView == null || !m_bEnableGuideUI)
                {
                    break;
                }
                UGuideMsgData gData = data as UGuideMsgData;
                if (gData != null)
                {
                    UBB.toHtml(ref gData.strMsgText);
                    m_wndView.ShowAutoMessage(gData.strMsgText, gData.nGuideSignSpriteID);
                    SetVisible(true);
                }
            }
            break;

            case WndMsgID.WND_MSG_GAMEGUIDE_ALWAYMESSAGE:
            {
                if (m_wndView == null)
                {
                    break;
                }

                UGuideMsgData gData = data as UGuideMsgData;
                if (gData != null)
                {
                    UBB.toHtml(ref gData.strMsgText);
                    m_wndView.ShowAlwaysDisplayMessage(gData.strMsgText);
                    SetVisible(true);
                }
            }
            break;

            case WndMsgID.WND_MSG_GAMEGUIDE_ADDGUIDEEFFECT:
            {
                if (m_wndView == null)
                {
                    break;
                }
                UGuideWidgetMsgData gData = data as UGuideWidgetMsgData;
                if (gData != null)
                {
                    m_wndView.AddGuideEffect(gData.nGuideEffectID);
                }
            }
            break;

            case WndMsgID.WND_MSG_GAMEGUIDE_REMOVEGUIDEEFFECT:
            {
                if (m_wndView == null)
                {
                    break;
                }
                UGuideWidgetMsgData gData = data as UGuideWidgetMsgData;
                if (gData != null)
                {
                    m_wndView.RemoveGuideEffect(gData.nGuideEffectID);
                }
            }
            break;

            case WndMsgID.WND_MSG_GAMEGUIDE_ADDNODEREWARDMESSAGE:
            {
                UGuideMsgData gData = data as UGuideMsgData;

                if (m_wndView == null || gData == null || string.IsNullOrEmpty(gData.strMsgText))
                {
                    break;
                }
                if (gData != null)
                {
                    UBB.toHtml(ref gData.strMsgText);
                    SetVisible(true);
                    m_wndView.ShowReward(gData);

                    ToggleModal(gData);
                }
            }
            break;

            case WndMsgID.WND_MSG_GAMEGUIDE_REMOVENODEREWARDMESSAGE:
            {
                if (m_wndView == null)
                {
                    break;
                }
                UGuideMsgRemoveData gData = data as UGuideMsgRemoveData;
                if (gData != null)
                {
                    if (gData.IsRemoveMessage)
                    {
                        m_wndView.HideReward();
                    }
                    if (gData.IsRemoveModal)
                    {
                        m_wndView.HideModal();
                    }
                    if (gData.IsHideView)
                    {
                        SetVisible(false);
                    }
                }
            }
            break;
            }
        }
Ejemplo n.º 24
0
        // 接受消息
        public override void OnMessage(WndMsgID msgID, UIMsgData msgData)
        {
            UIMsgCmdData data = msgData as UIMsgCmdData;

            switch (msgID)
            {
            case WndMsgID.WND_MSG_RANK_INVITE_SHOW:
            {
                if (m_wndView != null && m_wndView.IsVisible())
                {
                    return;
                }

                SetVisible(true);
                if (m_wndView != null)
                {
                    UIMsgCmdData cmdData = (UIMsgCmdData)msgData;
                    m_wndView.OnShowRankInviteView(cmdData.nParam);
                }
            }
            break;

            case WndMsgID.WND_MSG_RANK_INVITE_RETURN:
            {
                if (m_wndView == null)
                {
                    return;
                }

                SetVisible(true);
                if (m_wndView != null)
                {
                    m_wndView.OnReturnRankInviteView();
                }
            }
            break;

            case WndMsgID.WND_MSG_COMMOM_MATCHROOMSTATE_ENTER:
            {
                SetVisible(false);
            }
            break;

            // 以下为队伍操作
            case WndMsgID.WND_MSG_TEAMMATEINFO_UPDATE:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData uiTeammateInfoUpdateData = (UIMsgCmdData)msgData;
                m_wndView.TeammateInfoUpdate(uiTeammateInfoUpdateData.ptrParam, uiTeammateInfoUpdateData.nPtrLen);
            }
            break;

            case WndMsgID.WND_MSG_TEAMMATEINFO_CHANGECAPTAIN:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData uiTeammateChangeCaptainData = (UIMsgCmdData)msgData;
                m_wndView.TeammateInfoChangeCaptain(uiTeammateChangeCaptainData.ptrParam);
            }
            break;

            case WndMsgID.WND_WSG_TEAMMATEINFO_KICKOUTMEMBER:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData uiTeammateKickoutMemberData = (UIMsgCmdData)msgData;
                m_wndView.TeammateInfoKickoutMember(uiTeammateKickoutMemberData.ptrParam);
            }
            break;

            case WndMsgID.WND_MSG_TEAMMATEINFO_LEAVETEAM:
            {
                if (m_wndView == null)
                {
                    return;
                }

                UIMsgCmdData uiTeammateLeaveTeamData = (UIMsgCmdData)msgData;
                m_wndView.TeammateInfoLeaveTeam(uiTeammateLeaveTeamData.ptrParam);
            }
            break;

            case WndMsgID.WND_MSG_TEAMMATEINFO_DISBANDTEAM:
            {
                if (m_wndView == null)
                {
                    return;
                }

                m_wndView.TeammateInfoDisbandTeam();
            }
            break;
                #region 新手引导部分

            case WndMsgID.WND_MSG_WAR_MAIN_GAMEMODEBTN_ADDGUIDEWIDGET:
            {
                if (m_wndView == null)
                {
                    LoadView();
                    SetVisible(false);
                }
                UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                if (cmdData != null)
                {
                    m_wndView.AddGuideUIWidget(cmdData);
                }
            }
            break;

            case WndMsgID.WND_MSG_WAR_MAIN_GAMEMODEBTN_REMOVEGUIDEWIDGET:
            {
                if (m_wndView != null)
                {
                    UGuideWidgetMsgData cmdData = (UGuideWidgetMsgData)msgData;
                    if (cmdData != null)
                    {
                        m_wndView.RemoveGuideUIWidget(cmdData);
                    }
                }
            }
            break;

            case WndMsgID.WND_MSG_MSTCHIIMEINFO_GUIDE_ACTIONBEGIN:
            {
                if (m_wndView != null)
                {
                    m_wndView.GuideActionBegin();
                }
            }
            break;

            case WndMsgID.WND_MSG_MSTCHIIMEINFO_GUIDE_ACTIONEND:
            {
                if (m_wndView != null)
                {
                    m_wndView.GuideActionEnd();
                }
            }
            break;

                #endregion
            default:
                break;
            }
        }