Beispiel #1
0
    public void UpdateListElenment(GameObject element, CMail mail)
    {
        int                currentUTCTime = CRoleInfo.GetCurrentUTCTime();
        Text               component      = element.transform.FindChild("Title").GetComponent <Text>();
        Text               text2          = element.transform.FindChild("MailTime").GetComponent <Text>();
        GameObject         gameObject     = element.transform.FindChild("New").gameObject;
        GameObject         obj3           = element.transform.FindChild("ReadMailIcon").gameObject;
        GameObject         obj4           = element.transform.FindChild("UnReadMailIcon").gameObject;
        GameObject         obj5           = element.transform.FindChild("CoinImg").gameObject;
        Text               text3          = element.transform.FindChild("From").GetComponent <Text>();
        CUIHttpImageScript script         = element.transform.FindChild("HeadBg/imgHead").GetComponent <CUIHttpImageScript>();

        component.text = mail.subject;
        text2.text     = Utility.GetTimeBeforString((long)mail.sendTime, (long)currentUTCTime);
        bool bActive = mail.mailState == COM_MAIL_STATE.COM_MAIL_UNREAD;

        gameObject.CustomSetActive(bActive);
        if (mail.mailType == COM_MAIL_TYPE.COM_MAIL_SYSTEM)
        {
            obj3.CustomSetActive(!bActive);
            obj4.CustomSetActive(bActive);
            text3.text = string.Empty;
            script.gameObject.CustomSetActive(false);
            obj5.SetActive(false);
        }
        else if (mail.mailType == COM_MAIL_TYPE.COM_MAIL_FRIEND)
        {
            obj3.CustomSetActive(false);
            obj4.CustomSetActive(false);
            text3.text = mail.from;
            script.gameObject.CustomSetActive(true);
            if (mail.subType == 3)
            {
                obj5.CustomSetActive(false);
                script.SetImageSprite(CGuildHelper.GetGuildHeadPath(), this.m_CUIForm);
            }
            else
            {
                obj5.CustomSetActive(true);
                if (!CSysDynamicBlock.bFriendBlocked)
                {
                    COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                    if (comdt_friend_info == null)
                    {
                        comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                    }
                    if (comdt_friend_info != null)
                    {
                        string url = Utility.UTF8Convert(comdt_friend_info.szHeadUrl);
                        script.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
                    }
                }
            }
        }
        else if (mail.mailType == COM_MAIL_TYPE.COM_MAIL_FRIEND_INVITE)
        {
            obj3.CustomSetActive(false);
            obj4.CustomSetActive(false);
            text3.text = string.Empty;
            script.gameObject.CustomSetActive(true);
            obj5.SetActive(false);
            if (!CSysDynamicBlock.bFriendBlocked)
            {
                COMDT_FRIEND_INFO comdt_friend_info2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                if (comdt_friend_info2 == null)
                {
                    comdt_friend_info2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                }
                if (comdt_friend_info2 != null)
                {
                    string str2 = Utility.UTF8Convert(comdt_friend_info2.szHeadUrl);
                    script.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(str2));
                }
            }
        }
    }
    public void UpdateListElenment(GameObject element, CMail mail)
    {
        int                currentUTCTime   = CRoleInfo.GetCurrentUTCTime();
        Text               componetInChild  = Utility.GetComponetInChild <Text>(element, "Title");
        Text               componetInChild2 = Utility.GetComponetInChild <Text>(element, "MailTime");
        GameObject         obj              = Utility.FindChild(element, "New");
        GameObject         obj2             = Utility.FindChild(element, "ReadMailIcon");
        GameObject         obj3             = Utility.FindChild(element, "UnReadMailIcon");
        GameObject         obj4             = Utility.FindChild(element, "CoinImg");
        Text               componetInChild3 = Utility.GetComponetInChild <Text>(element, "From");
        CUIHttpImageScript componetInChild4 = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadBg/imgHead");
        GameObject         obj5             = null;
        Text               text             = null;
        GameObject         gameObject       = Utility.FindChild(element, "OnlineBg");

        if (gameObject != null)
        {
            obj5 = gameObject.gameObject;
        }
        GameObject gameObject2 = Utility.FindChild(element, "Online");

        if (gameObject2 != null)
        {
            text = gameObject2.GetComponent <Text>();
        }
        componetInChild.set_text(mail.subject);
        componetInChild2.set_text(Utility.GetTimeBeforString((long)((ulong)mail.sendTime), (long)currentUTCTime));
        bool flag = mail.mailState == COM_MAIL_STATE.COM_MAIL_UNREAD;

        obj.CustomSetActive(flag);
        if (mail.mailType == CustomMailType.SYSTEM)
        {
            obj2.CustomSetActive(!flag);
            obj3.CustomSetActive(flag);
            componetInChild3.set_text(string.Empty);
            componetInChild4.gameObject.CustomSetActive(false);
            obj4.CustomSetActive(false);
            obj5.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
        }
        else if (mail.mailType == CustomMailType.FRIEND)
        {
            obj5.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
            obj2.CustomSetActive(false);
            obj3.CustomSetActive(false);
            componetInChild3.set_text(mail.from);
            componetInChild4.gameObject.CustomSetActive(true);
            if (mail.subType == 3)
            {
                obj4.CustomSetActive(false);
                componetInChild4.SetImageSprite(CGuildHelper.GetGuildHeadPath(), this.m_CUIForm);
            }
            else
            {
                obj4.CustomSetActive(true);
                if (!CSysDynamicBlock.bFriendBlocked)
                {
                    COMDT_FRIEND_INFO friendByName = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                    if (friendByName == null)
                    {
                        friendByName = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                    }
                    if (friendByName != null)
                    {
                        string url = Utility.UTF8Convert(friendByName.szHeadUrl);
                        componetInChild4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
                    }
                }
            }
        }
        else if (mail.mailType == CustomMailType.FRIEND_INVITE)
        {
            obj5.CustomSetActive(true);
            if (text != null)
            {
                text.gameObject.CustomSetActive(true);
            }
            obj2.CustomSetActive(false);
            obj3.CustomSetActive(false);
            componetInChild3.set_text(string.Empty);
            componetInChild4.gameObject.CustomSetActive(true);
            obj4.CustomSetActive(false);
            Transform  transform = element.transform.FindChild("invite_btn");
            GameObject obj6      = null;
            if (transform != null)
            {
                obj6 = transform.gameObject;
            }
            if (mail.relationType == 1)
            {
                GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(mail.uid);
                Singleton <CMailSys> .instance.AddGuildMemInfo(guildMemberInfoByUid);
            }
            this.SetEventParams(element, mail);
            string text2;
            string url2;
            bool   flag2             = !this.GetOtherPlayerState((COM_INVITE_RELATION_TYPE)mail.relationType, mail.uid, mail.dwLogicWorldID, out text2, out url2);
            string processTypeString = this.GetProcessTypeString((CMailSys.enProcessInviteType)mail.processType);
            componetInChild.set_text(string.Format("{0} {1}", mail.subject, processTypeString));
            if (text != null)
            {
                text.set_text(text2);
            }
            componetInChild4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url2));
            if (flag2)
            {
                CUIUtility.GetComponentInChildren <Image>(componetInChild4.gameObject).set_color(CUIUtility.s_Color_GrayShader);
            }
            else
            {
                CUIUtility.GetComponentInChildren <Image>(componetInChild4.gameObject).set_color(CUIUtility.s_Color_Full);
            }
            obj6.CustomSetActive(!flag2);
        }
        else if (mail.mailType == CustomMailType.ASK_FOR)
        {
            obj2.CustomSetActive(false);
            obj3.CustomSetActive(false);
            componetInChild3.set_text(mail.from);
            componetInChild4.gameObject.CustomSetActive(true);
            obj4.CustomSetActive(false);
            obj5.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
            if (!CSysDynamicBlock.bFriendBlocked)
            {
                CFriendModel.FriendType friendType    = CFriendModel.FriendType.GameFriend;
                COMDT_FRIEND_INFO       friendByName2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                if (friendByName2 == null)
                {
                    friendType    = CFriendModel.FriendType.SNS;
                    friendByName2 = Singleton <CFriendContoller> .instance.model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                }
                if (friendByName2 != null)
                {
                    string url3 = Utility.UTF8Convert(friendByName2.szHeadUrl);
                    componetInChild4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url3));
                    UT.ShowFriendData(friendByName2, element.GetComponent <FriendShower>(), FriendShower.ItemType.Normal, false, friendType, Singleton <CUIManager> .GetInstance().GetForm(CMailSys.MAIL_FORM_PATH), true);
                }
            }
        }
    }
Beispiel #3
0
    public void UpdateListElenment(GameObject element, CMail mail)
    {
        int                currentUTCTime = CRoleInfo.GetCurrentUTCTime();
        Text               component      = element.transform.FindChild("Title").GetComponent <Text>();
        Text               component2     = element.transform.FindChild("MailTime").GetComponent <Text>();
        GameObject         gameObject     = element.transform.FindChild("New").gameObject;
        GameObject         gameObject2    = element.transform.FindChild("ReadMailIcon").gameObject;
        GameObject         gameObject3    = element.transform.FindChild("UnReadMailIcon").gameObject;
        GameObject         gameObject4    = element.transform.FindChild("CoinImg").gameObject;
        Text               component3     = element.transform.FindChild("From").GetComponent <Text>();
        CUIHttpImageScript component4     = element.transform.FindChild("HeadBg/imgHead").GetComponent <CUIHttpImageScript>();
        GameObject         obj            = null;
        Text               text           = null;
        Transform          transform      = element.transform.FindChild("OnlineBg");

        if (transform != null)
        {
            obj = transform.gameObject;
        }
        Transform transform2 = element.transform.FindChild("Online");

        if (transform2 != null)
        {
            text = transform2.GetComponent <Text>();
        }
        component.text  = mail.subject;
        component2.text = Utility.GetTimeBeforString((long)((ulong)mail.sendTime), (long)currentUTCTime);
        bool flag = mail.mailState == 1;

        gameObject.CustomSetActive(flag);
        if (mail.mailType == 1)
        {
            gameObject2.CustomSetActive(!flag);
            gameObject3.CustomSetActive(flag);
            component3.text = string.Empty;
            component4.gameObject.CustomSetActive(false);
            gameObject4.SetActive(false);
            obj.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
        }
        else if (mail.mailType == 2)
        {
            obj.CustomSetActive(false);
            if (text != null)
            {
                text.gameObject.CustomSetActive(false);
            }
            gameObject2.CustomSetActive(false);
            gameObject3.CustomSetActive(false);
            component3.text = mail.from;
            component4.gameObject.CustomSetActive(true);
            if (mail.subType == 3)
            {
                gameObject4.CustomSetActive(false);
                component4.SetImageSprite(CGuildHelper.GetGuildHeadPath(), this.m_CUIForm);
            }
            else
            {
                gameObject4.CustomSetActive(true);
                if (!CSysDynamicBlock.bFriendBlocked)
                {
                    COMDT_FRIEND_INFO friendByName = Singleton <CFriendContoller> .get_instance().model.getFriendByName(mail.from, CFriendModel.FriendType.GameFriend);

                    if (friendByName == null)
                    {
                        friendByName = Singleton <CFriendContoller> .get_instance().model.getFriendByName(mail.from, CFriendModel.FriendType.SNS);
                    }
                    if (friendByName != null)
                    {
                        string url = Utility.UTF8Convert(friendByName.szHeadUrl);
                        component4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
                    }
                }
            }
        }
        else if (mail.mailType == 3)
        {
            obj.CustomSetActive(true);
            if (text != null)
            {
                text.gameObject.CustomSetActive(true);
            }
            gameObject2.CustomSetActive(false);
            gameObject3.CustomSetActive(false);
            component3.text = string.Empty;
            component4.gameObject.CustomSetActive(true);
            gameObject4.SetActive(false);
            Transform  transform3 = element.transform.FindChild("invite_btn");
            GameObject obj2       = null;
            if (transform3 != null)
            {
                obj2 = transform3.gameObject;
            }
            if (mail.relationType == 1)
            {
                GuildMemInfo guildMemberInfoByUid = CGuildHelper.GetGuildMemberInfoByUid(mail.uid);
                Singleton <CMailSys> .get_instance().AddGuildMemInfo(guildMemberInfoByUid);
            }
            this.SetEventParams(element, mail);
            string text2;
            string url2;
            bool   flag2             = !this.GetOtherPlayerState(mail.relationType, mail.uid, mail.dwLogicWorldID, out text2, out url2);
            string processTypeString = this.GetProcessTypeString((CMailSys.enProcessInviteType)mail.processType);
            component.text = string.Format("{0} {1}", mail.subject, processTypeString);
            if (text != null)
            {
                text.text = text2;
            }
            component4.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url2));
            if (flag2)
            {
                CUIUtility.GetComponentInChildren <Image>(component4.gameObject).color = CUIUtility.s_Color_GrayShader;
            }
            else
            {
                CUIUtility.GetComponentInChildren <Image>(component4.gameObject).color = CUIUtility.s_Color_Full;
            }
            obj2.CustomSetActive(!flag2);
        }
    }