Ejemplo n.º 1
0
 void OnClickGetAll()
 {
     foreach (ulong mailKeys in MailData.UserMailMap.Keys)
     {
         CG_MAIL_OPERATION packetDelMail = (CG_MAIL_OPERATION)PacketDistributed.CreatePacket(MessageID.PACKET_CG_MAIL_OPERATION);
         packetDelMail.SetOperationType((int)CG_MAIL_OPERATION.MailOperation.OPERATION_GETITEM);
         packetDelMail.SetMailGuid(mailKeys);
         packetDelMail.SendPacket();
     }
 }
Ejemplo n.º 2
0
    void DoDeleteCurMail()
    {
        MailData.UserMail curMail = GetMailByItem(m_curSelectItem);
        if (null == curMail)
        {
            LogModule.ErrorLog("can not find cur select item");
            return;
        }
        CG_MAIL_OPERATION packetDelMail = (CG_MAIL_OPERATION)PacketDistributed.CreatePacket(MessageID.PACKET_CG_MAIL_OPERATION);

        packetDelMail.SetOperationType((int)CG_MAIL_OPERATION.MailOperation.OPERATION_DELETE);
        packetDelMail.SetMailGuid(curMail.key);
        packetDelMail.SendPacket();
    }
Ejemplo n.º 3
0
 void DoDeleteAll()
 {
     foreach (ulong mailKeys in MailData.UserMailMap.Keys)
     {
         MailData.UserMail curMail = MailData.UserMailMap[mailKeys];
         if (curMail.bReaded && !(curMail.itemID >= 0 || curMail.moneyCount > 0))
         {
             CG_MAIL_OPERATION packetDelMail = (CG_MAIL_OPERATION)PacketDistributed.CreatePacket(MessageID.PACKET_CG_MAIL_OPERATION);
             packetDelMail.SetOperationType((int)CG_MAIL_OPERATION.MailOperation.OPERATION_DELETE);
             packetDelMail.SetMailGuid(mailKeys);
             packetDelMail.SendPacket();
         }
     }
 }
Ejemplo n.º 4
0
    void OnClickGetCur()
    {
        MailData.UserMail curMail = GetMailByItem(m_curSelectItem);
        if (null == curMail)
        {
            return;
        }

        if (curMail.itemID > 0 || curMail.moneyCount > 0)
        {
            CG_MAIL_OPERATION packetDelMail = (CG_MAIL_OPERATION)PacketDistributed.CreatePacket(MessageID.PACKET_CG_MAIL_OPERATION);
            packetDelMail.SetOperationType((int)CG_MAIL_OPERATION.MailOperation.OPERATION_GETITEM);
            packetDelMail.SetMailGuid(curMail.key);
            packetDelMail.SendPacket();
        }
        else
        {
            OnClickDelCur();
        }
    }
Ejemplo n.º 5
0
    public void ShowMailItem(MailListItem curItem)
    {
        if (null == curItem)
        {
            return;
        }
        if (m_curSelectItem == curItem)
        {
            return;
        }

        if (null != m_curSelectItem)
        {
            m_curSelectItem.EnableHighlight(false);
        }

        m_curSelectItem = curItem;
        m_curSelectItem.gameObject.SetActive(true);
        m_curSelectItem.EnableHighlight(true);

        MailData.UserMail curMail = GetMailByItem(curItem);
        if (null == curMail)
        {
            return;
        }

        m_playerName.text = curMail.SenderName;
        bool bHaveItem = false;

        LabelCurMailText.text = StrDictionary.GetClientString_WithNameSex(curMail.text);//curMail.text;
        if (curMail.itemID >= 0)
        {
            CurRewardItem.SetData(curMail.itemID, curMail.itemCount);
            CurRewardItem.gameObject.SetActive(true);
            bHaveItem = true;
        }
        else
        {
            CurRewardItem.gameObject.SetActive(false);
        }

        if (curMail.moneyCount > 0)
        {
            MoneyCountLabel.SetActive(true);
            MoneyIcon.SetActive(true);
            m_MoneyBack.gameObject.SetActive(true);
            MoneyCountLabel.GetComponent <UILabel>().text = curMail.moneyCount.ToString();
            if (curMail.moneyType == 0)
            {
                MoneyIcon.GetComponent <UISprite>().spriteName = "jinbi";
            }
            else if (curMail.moneyType == 2)
            {
                MoneyIcon.GetComponent <UISprite>().spriteName = "bdyuanbao";
            }
            else
            {
                MoneyIcon.GetComponent <UISprite>().spriteName = "gonghuijifen";
            }
            bHaveItem = true;
        }
        else
        {
            MoneyCountLabel.SetActive(false);
            MoneyIcon.SetActive(false);
            m_MoneyBack.gameObject.SetActive(false);
        }

        if (bHaveItem)
        {
            m_awardText.text = "领奖";
        }
        else
        {
            m_awardText.text = "删除";
        }

        BtnGetItem.SetActive(true);

        BtnReplay.SetActive(curMail.senderType != GC_MAIL_UPDATE.MailSender.MAILSENDER_SYS);
        BtnBtnReport.SetActive(curMail.senderType != GC_MAIL_UPDATE.MailSender.MAILSENDER_SYS);
        if (!curMail.bReaded)
        {
            CG_MAIL_OPERATION packetDelMail = (CG_MAIL_OPERATION)PacketDistributed.CreatePacket(MessageID.PACKET_CG_MAIL_OPERATION);
            packetDelMail.SetOperationType((int)CG_MAIL_OPERATION.MailOperation.OPERATION_SETREAD);
            packetDelMail.SetMailGuid(curMail.key);
            packetDelMail.SendPacket();
        }
    }