Beispiel #1
0
        public void onRecvMailDetailInfo(WndMsgID msgID, UIMsgData msgData)
        {
            UIMsgCmdData           cmdData = (UIMsgCmdData)msgData;
            IntPtrVaArgParseHelper helper  = new IntPtrVaArgParseHelper(cmdData.ptrParam, cmdData.nPtrLen);

            GameLogic.gameview_mail_rsp_detaildata detailData = helper.get <GameLogic.gameview_mail_rsp_detaildata>();

            if (CurSelectItem != null && CurSelectItem.nMailID == detailData.nMailID)
            {
                mailContentFrame.SetMailContentData(CurSelectItem.szTitle, CurSelectItem.szSenderName, detailData);
            }

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MAIL_NEWMAILCOUNT, null);
        }
Beispiel #2
0
        public void OnRecvMailDetailInfo(int cmdID, int nParam, string strParam, IntPtr ptrParam, int nPtrLen)
        {
            IntPtrVaArgParseHelper helper = new IntPtrVaArgParseHelper(ptrParam, nPtrLen);

            GameLogic.gameview_mail_rsp_detaildata cmdData = helper.get <GameLogic.gameview_mail_rsp_detaildata>();

            if (m_MailDetailInfoList.ContainsKey(cmdData.nMailID))
            {
                m_MailDetailInfoList[cmdData.nMailID] = cmdData;
            }
            else
            {
                m_MailDetailInfoList.Add(cmdData.nMailID, cmdData);
            }

            for (int i = 0; i < m_MailBaseInfoList.Count; ++i)
            {
                if (cmdData.nMailID == m_MailBaseInfoList[i].nMailID)
                {
                    GameLogic.gameview_mail_baseinfo tmpBaseInfo = m_MailBaseInfoList[i];
                    if (tmpBaseInfo.nIsRead == 0)
                    {
                        m_MailCount--;
                        tmpBaseInfo.nIsRead = 1;
                    }
                    tmpBaseInfo.nReadFlag = 1;
                    m_MailBaseInfoList[i] = tmpBaseInfo;
                    break;
                }
            }

            m_MailCount = m_MailCount < 0 ? 0 : m_MailCount;

            UIMsgCmdData uiMailDetailInfo = new UIMsgCmdData((int)WndMsgID.WND_MSG_MAIL_DETAILINFO, nParam, strParam, ptrParam, nPtrLen);

            UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_MAIL_DETAILINFO, uiMailDetailInfo);
        }
Beispiel #3
0
        public void AddFastRecvData(long nMailID)
        {
            if (m_MailDetailInfoList.ContainsKey(nMailID))
            {
                GameLogic.gameview_mail_rsp_detaildata detailData = m_MailDetailInfoList[nMailID];
                if (detailData.nPlusMoney > 0)
                {
                    m_SumPlusMoney += detailData.nPlusMoney;
                }

                if (detailData.nPlusExp > 0)
                {
                    m_SumPlusExp += detailData.nPlusExp;
                }

                for (int i = 0; i < detailData.nPlusGoodsNum; ++i)
                {
                    GameLogic.gameview_mail_goodsinfo goodsInfo = detailData.sGoodsList[i];
                    if (goodsInfo.nGoodsID > 0)
                    {
                        if (m_FastRecvGoodsList.ContainsKey(goodsInfo.nGoodsID))
                        {
                            GameLogic.gameview_mail_goodsinfo tmpGoodsInfo = m_FastRecvGoodsList[goodsInfo.nGoodsID];
                            tmpGoodsInfo.nCount += goodsInfo.nCount;
                            m_FastRecvGoodsList[goodsInfo.nGoodsID] = tmpGoodsInfo;
                        }
                        else
                        {
                            GameLogic.gameview_mail_goodsinfo tmpGoodsInfo;
                            tmpGoodsInfo.nGoodsID = goodsInfo.nGoodsID;
                            tmpGoodsInfo.nCount   = goodsInfo.nCount;
                            m_FastRecvGoodsList.Add(tmpGoodsInfo.nGoodsID, tmpGoodsInfo);
                        }
                    }
                }
            }
        }
Beispiel #4
0
        public void SetMailContentData(String strMailTitle, String strSenderName, GameLogic.gameview_mail_rsp_detaildata detailData)
        {
            m_nMailID = detailData.nMailID;

            recvConfirmDesc.text = ULocalizationService.Instance.Get("UIView", "Mail", "RecvConfirmDes");

            recvBtn.gameObject.SetActive(false);
            recvConfirmDesc.gameObject.SetActive(false);

            mailTitle.text   = ULocalizationService.Instance.Get("UIView", "Mail", "MailTitleDesc") + strMailTitle;
            senderName.text  = ULocalizationService.Instance.Get("UIView", "Mail", "SenderNameDesc") + strSenderName;
            mailContent.text = "    " + ULocalizationService.Instance.Get("UIView", "Mail", "MailContentDesc") + detailData.szContext;

            ListMailPlusNum.DataSource.BeginUpdate();
            ListMailPlusNum.DataSource.Clear();
            ListMailGoods.DataSource.BeginUpdate();
            ListMailGoods.DataSource.Clear();

            bool bHavePlus = false;

            if (detailData.nPlusMoney > 0 || detailData.nPlusExp > 0)
            {
                bHavePlus = true;
                int nIndex = 1;
                UIWidgets.ObservableList <UListItemMailPlusData> dataSource = new UIWidgets.ObservableList <UListItemMailPlusData>();
                if (detailData.nPlusMoney > 0)
                {
                    UListItemMailPlusData itemMoney = new UListItemMailPlusData();
                    itemMoney.nIndex = nIndex;
                    itemMoney.szName = ULocalizationService.Instance.Get("UIView", "Mail", "MailPlusMoneyDesc");
                    itemMoney.nCount = detailData.nPlusMoney;

                    dataSource.Add(itemMoney);

                    ++nIndex;
                }

                if (detailData.nPlusExp > 0)
                {
                    UListItemMailPlusData itemExp = new UListItemMailPlusData();
                    itemExp.nIndex = nIndex;
                    itemExp.szName = ULocalizationService.Instance.Get("UIView", "Mail", "MailPlusExpDesc");
                    itemExp.nCount = detailData.nPlusExp;

                    dataSource.Add(itemExp);
                }

                ListMailPlusNum.DataSource = dataSource;
            }

            if (detailData.nPlusGoodsNum > 0)
            {
                int nGoodsIndex = 1;
                UIWidgets.ObservableList <UListItemMailGoods> goodsDataSource = new UIWidgets.ObservableList <UListItemMailGoods>();
                for (int i = 0; i < detailData.nPlusGoodsNum; ++i)
                {
                    int nGoodsID = detailData.sGoodsList[i].nGoodsID;
                    if (nGoodsID > 0)
                    {
                        UListItemMailGoods itemGoods = new UListItemMailGoods();
                        itemGoods.nIndex   = nGoodsIndex;
                        itemGoods.nGoodsID = nGoodsID;
                        itemGoods.nCount   = detailData.sGoodsList[i].nCount;

                        goodsDataSource.Add(itemGoods);

                        bHavePlus = true;

                        ++nGoodsIndex;
                    }
                }

                ListMailGoods.DataSource = goodsDataSource;
            }

            ListMailPlusNum.DataSource.EndUpdate();
            ListMailGoods.DataSource.EndUpdate();

            int nMailType = LogicDataCenter.mailDataManager.GetMailType(m_nMailID);

            if (bHavePlus && (nMailType == (int)EMMailType.emMailType_Player || nMailType == (int)EMMailType.emMailType_System))
            {
                if (LogicDataCenter.mailDataManager.PlusMailList.Contains(m_nMailID))
                {
                    recvBtn.gameObject.SetActive(true);
                }
                else
                {
                    recvConfirmDesc.gameObject.SetActive(true);
                }
            }
        }