Exemplo n.º 1
0
        public void On_List_ElementEnable(CUIEvent uievent)
        {
            int srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList;
            COMDT_FRIEND_INFO info           = this._get_current_info(this.CurTab, srcWidgetIndexInBelongedList);
            FriendShower      component      = uievent.m_srcWidget.GetComponent <FriendShower>();

            if ((component != null) && (info != null))
            {
                if (this.CurTab == Tab.Friend_SNS)
                {
                    UT.ShowFriendData(info, component, FriendShower.ItemType.Normal, true, CFriendModel.FriendType.SNS);
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = info.stUin.ullUid;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = info.stUin.dwLogicWorldId;
                }
                else if (this.CurTab == Tab.Friend)
                {
                    UT.ShowFriendData(info, component, FriendShower.ItemType.Normal, false, CFriendModel.FriendType.GameFriend);
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = info.stUin.ullUid;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = info.stUin.dwLogicWorldId;
                }
                else if (this.CurTab == Tab.Friend_Request)
                {
                    UT.ShowFriendData(info, component, FriendShower.ItemType.Request, false, CFriendModel.FriendType.RequestFriend);
                }
            }
        }
Exemplo n.º 2
0
 public static void ShowBlackListData(ref CFriendModel.stBlackName info, FriendShower com)
 {
     if (com == null)
     {
         return;
     }
     com.ullUid         = info.ullUid;
     com.dwLogicWorldID = info.dwLogicWorldId;
     com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(info.szHeadUrl));
     if (com.nobeIcon)
     {
         com.nobeIcon.CustomSetActive(false);
     }
     if (com.HeadIconBack)
     {
         com.HeadIconBack.CustomSetActive(false);
     }
     if (com.QQVipImage)
     {
         com.QQVipImage.CustomSetActive(false);
     }
     com.SetFriendItemType(FriendShower.ItemType.BlackList, true);
     com.SetBGray(false);
     com.ShowName(info.name);
     com.ShowLevel(info.dwPvpLvl);
     com.ShowLastTime(true, UT.GetTimeString(info.dwLastLoginTime));
     com.intimacyNode.CustomSetActive(false);
     com.ShowGenderType(info.bGender);
 }
Exemplo n.º 3
0
 private void _refresh_list(CUIListScript listScript, ListView <COMDT_FRIEND_INFO> data_list, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friend)
 {
     if (listScript != null)
     {
         int count = data_list.Count;
         listScript.SetElementAmount(count);
         for (int i = 0; i < count; i++)
         {
             CUIListElementScript elemenet = listScript.GetElemenet(i);
             if ((elemenet != null) && listScript.IsElementInScrollArea(i))
             {
                 FriendShower      component = elemenet.GetComponent <FriendShower>();
                 COMDT_FRIEND_INFO info      = data_list[i];
                 if ((component != null) && (info != null))
                 {
                     UT.ShowFriendData(info, component, type, bShowNickName, friend);
                     if (component.sendHeartButton != null)
                     {
                         if (friend == CFriendModel.FriendType.GameFriend)
                         {
                             component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SendCoin;
                         }
                         else if (friend == CFriendModel.FriendType.SNS)
                         {
                             component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SNS_SendCoin;
                         }
                         component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = info.stUin.ullUid;
                         component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = info.stUin.dwLogicWorldId;
                     }
                 }
             }
         }
     }
 }
Exemplo n.º 4
0
        private void On_Friend_CheckInfo(CUIEvent uievent)
        {
            FriendShower component = uievent.m_srcWidget.transform.parent.parent.parent.GetComponent <FriendShower>();

            if (component != null)
            {
                Singleton <CPlayerInfoSystem> .instance.ShowPlayerDetailInfo(component.ullUid, (int)component.dwLogicWorldID, CPlayerInfoSystem.DetailPlayerInfoSource.DefaultOthers);
            }
        }
Exemplo n.º 5
0
        public static void ShowLBSUserData(CSDT_LBS_USER_INFO info, FriendShower com)
        {
            if (com == null)
            {
                return;
            }
            com.ullUid         = info.stLbsUserInfo.stUin.ullUid;
            com.dwLogicWorldID = info.stLbsUserInfo.stUin.dwLogicWorldId;
            if (info.stLbsUserInfo.szHeadUrl != null)
            {
                string url = UT.Bytes2String(info.stLbsUserInfo.szHeadUrl);
                com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
            }
            if (com.nobeIcon)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwCurLevel, false);
            }
            if (com.HeadIconBack)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stLbsUserInfo.stGameVip.dwHeadIconId);
            }
            if (com.QQVipImage)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.stLbsUserInfo.dwQQVIPMask);
            }
            com.intimacyNode.CustomSetActive(false);
            com.SetFriendItemType(FriendShower.ItemType.LBS, true);
            com.ShowName(UT.Bytes2String(info.stLbsUserInfo.szUserName));
            com.ShowLevel(info.stLbsUserInfo.dwPvpLvl);
            com.ShowLastTime(true, UT.GetTimeString(info.stLbsUserInfo.dwLastLoginTime));
            com.ShowGenderType(info.stLbsUserInfo.bGender);
            com.ShowDistance(UT.GetDistance(info.dwDistance));
            com.SetBGray(info.stLbsUserInfo.bIsOnline != 1);
            if (com.platChannelIcon != null)
            {
                com.platChannelIcon.CustomSetActive(false);
            }
            if (com.lbsAddFriendBtn != null)
            {
                CFriendModel model = Singleton <CFriendContoller> .get_instance().model;

                if (model.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model.IsGameFriend(com.ullUid, com.dwLogicWorldID))
                {
                    CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, false, false, true);
                }
                else
                {
                    CUICommonSystem.SetButtonEnable(com.lbsAddFriendBtn, true, true, true);
                }
            }
            GameObject gameObject  = com.gameObject.transform.Find("body/LBS/Rank").gameObject;
            GameObject gameObject2 = com.gameObject.transform.Find("body/LBS/HisRank").gameObject;

            UT.ShowRank(com.formScript, gameObject, info.bGradeOfRank, info.stLbsUserInfo.dwRankClass);
            UT.ShowRank(com.formScript, gameObject2, info.bMaxGradeOfRank, info.stLbsUserInfo.dwRankClass);
        }
Exemplo n.º 6
0
        public void On_List_ElementEnable(CUIEvent uievent)
        {
            int          srcWidgetIndexInBelongedList = uievent.m_srcWidgetIndexInBelongedList;
            FriendShower component = uievent.m_srcWidget.GetComponent <FriendShower>();

            if (component != null)
            {
                if (this.CurTab == Tab.Friend_SNS)
                {
                    COMDT_FRIEND_INFO info = this._get_current_info(this.CurTab, srcWidgetIndexInBelongedList);
                    UT.ShowFriendData(info, component, FriendShower.ItemType.Normal, true, CFriendModel.FriendType.SNS);
                    component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SNS_SendCoin;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = info.stUin.ullUid;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = info.stUin.dwLogicWorldId;
                }
                else if (this.CurTab == Tab.Friend)
                {
                    COMDT_FRIEND_INFO comdt_friend_info2 = this._get_current_info(this.CurTab, srcWidgetIndexInBelongedList);
                    UT.ShowFriendData(comdt_friend_info2, component, FriendShower.ItemType.Normal, false, CFriendModel.FriendType.GameFriend);
                    component.sendHeartBtn_eventScript.m_onClickEventID = enUIEventID.Friend_SendCoin;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param1 = comdt_friend_info2.stUin.ullUid;
                    component.sendHeartBtn_eventScript.m_onClickEventParams.commonUInt64Param2 = comdt_friend_info2.stUin.dwLogicWorldId;
                }
                else if (this.CurTab == Tab.Friend_Request)
                {
                    UT.ShowFriendData(this._get_current_info(this.CurTab, srcWidgetIndexInBelongedList), component, FriendShower.ItemType.Request, false, CFriendModel.FriendType.RequestFriend);
                }
                else if (this.CurTab == Tab.Friend_BlackList)
                {
                    List <CFriendModel.stBlackName> blackList = Singleton <CFriendContoller> .instance.model.GetBlackList();

                    if (srcWidgetIndexInBelongedList < blackList.Count)
                    {
                        CFriendModel.stBlackName name = blackList[srcWidgetIndexInBelongedList];
                        if (component != null)
                        {
                            UT.ShowBlackListData(ref name, component);
                        }
                    }
                }
                else if (this.CurTab == Tab.Friend_LBS)
                {
                    ListView <CSDT_LBS_USER_INFO> currentLBSList = Singleton <CFriendContoller> .instance.model.GetCurrentLBSList();

                    if (srcWidgetIndexInBelongedList < currentLBSList.Count)
                    {
                        CSDT_LBS_USER_INFO csdt_lbs_user_info = currentLBSList[srcWidgetIndexInBelongedList];
                        if (component != null)
                        {
                            UT.ShowLBSUserData(csdt_lbs_user_info, component);
                        }
                    }
                }
            }
        }
Exemplo n.º 7
0
        private void On_Refuse_RequestFriend(CUIEvent uievent)
        {
            FriendShower component = uievent.m_srcWidget.transform.parent.parent.parent.GetComponent <FriendShower>();

            if (component != null)
            {
                COMDT_FRIEND_INFO comdt_friend_info = this.model.GetInfo(CFriendModel.FriendType.RequestFriend, component.ullUid, component.dwLogicWorldID);
                if (comdt_friend_info != null)
                {
                    FriendSysNetCore.Send_DENY_BeFriend(comdt_friend_info.stUin);
                }
            }
        }
Exemplo n.º 8
0
        private void On_Friend_SNS_ReCall(CUIEvent uievent)
        {
            FriendShower component = uievent.m_srcWidget.transform.parent.parent.parent.GetComponent <FriendShower>();

            if (component != null)
            {
                COMDT_FRIEND_INFO comdt_friend_info = this.model.GetInfo(CFriendModel.FriendType.SNS, component.ullUid, component.dwLogicWorldID);
                if (comdt_friend_info != null)
                {
                    FriendSysNetCore.ReCallSnsFriend(comdt_friend_info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);
                }
            }
        }
Exemplo n.º 9
0
        private void On_DelFriend_OK(CUIEvent evt)
        {
            FriendShower component = this.com.transform.parent.parent.parent.GetComponent <FriendShower>();

            if (component != null)
            {
                COMDT_FRIEND_INFO comdt_friend_info = this.model.GetInfo(CFriendModel.FriendType.GameFriend, component.ullUid, component.dwLogicWorldID);
                if (comdt_friend_info != null)
                {
                    FriendSysNetCore.Send_Del_Friend(comdt_friend_info.stUin);
                }
            }
        }
Exemplo n.º 10
0
            public void Clear()
            {
                Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Friend_SerchFriend, new CUIEventManager.OnUIEventHandler(this.On_SearchFriend));

                Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.Friend_Close_AddForm, new CUIEventManager.OnUIEventHandler(this.On_Friend_Close_AddForm));

                this.input = null;
                this.searchFriendShower     = null;
                this.recommandFriendListCom = null;
                this.search_info_Game       = null;
                this.buttons_node           = null;
                this.bShow = false;
            }
Exemplo n.º 11
0
            public void Refresh_Recomand_Friend(int index, COMDT_FRIEND_INFO info)
            {
                CUIListElementScript elemenet = this.recommandFriendListCom.GetElemenet(index);

                if (elemenet != null)
                {
                    FriendShower component = elemenet.GetComponent <FriendShower>();
                    if (component != null)
                    {
                        UT.ShowFriendData(info, component, FriendShower.ItemType.Add, false, CFriendModel.FriendType.Recommend);
                    }
                }
            }
Exemplo n.º 12
0
        public static void ShowSNSFriendData(COMDT_SNS_FRIEND_INFO info, FriendShower com)
        {
            com.ullUid         = info.ullUid;
            com.dwLogicWorldID = info.dwLogicWorldId;
            string url = UT.Bytes2String(info.szHeadUrl);

            com.HttpImage.SetImageUrl(Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(url));
            com.SetFriendItemType(FriendShower.ItemType.Add, true);
            com.SetBGray(false);
            com.ShowName(string.Format("{0}({1})", UT.Bytes2String(info.szRoleName), UT.Bytes2String(info.szNickName)));
            com.ShowLevel(info.dwPvpLvl);
            com.ShowVipLevel(info.dwPvpLvl);
            com.ShowLastTime(true, UT.GetTimeString(info.dwLastLoginTime));
        }
Exemplo n.º 13
0
        private ulong GetFriendUid(CUIEvent uiEvent)
        {
            FriendShower component = uiEvent.m_srcWidget.transform.parent.parent.parent.GetComponent <FriendShower>();

            if (component == null)
            {
                return(0L);
            }
            CFriendModel.FriendType type = (this.view.GetSelectedTab() != CFriendView.Tab.Friend_SNS) ? CFriendModel.FriendType.GameFriend : CFriendModel.FriendType.SNS;
            COMDT_FRIEND_INFO       comdt_friend_info = this.model.GetInfo(type, component.ullUid, component.dwLogicWorldID);

            if (comdt_friend_info == null)
            {
                return(0L);
            }
            return(comdt_friend_info.stUin.ullUid);
        }
Exemplo n.º 14
0
        public void ShowZhaomuZhe_Item(GameObject com, CFriendRecruit.RecruitData info)
        {
            if (info.userInfo != null)
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(true);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/hasData/Level").gameObject.CustomSetActive(true);
                CUIHttpImageScript component = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>();
                UT.SetHttpImage(component, info.userInfo.szHeadUrl);
                Text component2 = com.transform.FindChild("user/hasData/Level").GetComponent <Text>();
                component2.text = string.Format("Lv.{0}", info.userInfo.dwPvpLvl);
                GameObject gameObject = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage/NobeIcon").gameObject;
                if (gameObject)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)info.userInfo.stGameVip.dwCurLevel, false);
                }
                Text   component3 = com.transform.FindChild("user/hasData/NameGroup/Name").GetComponent <Text>();
                string text       = UT.Bytes2String(info.userInfo.szUserName);
                if (component3 != null)
                {
                    component3.text = text;
                }
                GameObject gameObject2 = com.transform.FindChild("user/hasData/NameGroup/Gender").gameObject;
                FriendShower.ShowGender(gameObject2, info.userInfo.bGender);
            }
            else
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(true);
            }
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            int num = Math.Min(this.zhaomuzheRewardCount, info.RewardList.get_Count());

            for (int i = 0; i < num; i++)
            {
                Transform transform = com.transform.FindChild(string.Format("reward_{0}", i));
                DebugHelper.Assert(transform != null, "rewardNodeTS not null...");
                if (!(transform == null))
                {
                    CFriendRecruit.RecruitReward recruitReward = info.RewardList.get_Item(i);
                    this.Show_Award(transform.gameObject, info.ullUid, info.dwLogicWorldId, 1, recruitReward.rewardID, recruitReward.state, form, true);
                }
            }
        }
Exemplo n.º 15
0
 private void _refresh_black_list(CUIListScript listScript, List <CFriendModel.stBlackName> blackList)
 {
     if (listScript != null)
     {
         int count = blackList.Count;
         listScript.SetElementAmount(count);
         for (int i = 0; i < count; i++)
         {
             CUIListElementScript elemenet = listScript.GetElemenet(i);
             if ((elemenet != null) && listScript.IsElementInScrollArea(i))
             {
                 FriendShower             component = elemenet.GetComponent <FriendShower>();
                 CFriendModel.stBlackName info      = blackList[i];
                 if (component != null)
                 {
                     UT.ShowBlackListData(ref info, component);
                 }
             }
         }
     }
 }
		public static void Show_Item_Top(CUIComponent com, CFR frData, CUIFormScript uiFrom)
		{
			Image componetInChild = Utility.GetComponetInChild<Image>(com.gameObject, "Image");
			IntimacyRelationViewUT.SetRelationBGImg(componetInChild, frData.state);
			IntimacyRelationViewUT.SetButtonParam(com.m_widgets[19], frData);
			if (IntimacyRelationViewUT.IsRelaState(frData.state))
			{
				com.m_widgets[19].CustomSetActive(true);
			}
			else
			{
				com.m_widgets[19].CustomSetActive(false);
			}
			COMDT_FRIEND_INFO friendInfo = frData.friendInfo;
			if (friendInfo == null)
			{
				return;
			}
			CUIHttpImageScript component = com.m_widgets[1].GetComponent<CUIHttpImageScript>();
			UT.SetHttpImage(component, friendInfo.szHeadUrl);
			Image componetInChild2 = Utility.GetComponetInChild<Image>(component.gameObject, "NobeImag");
			if (componetInChild2 && uiFrom != null)
			{
				MonoSingleton<NobeSys>.GetInstance().SetHeadIconBk(componetInChild2, (int)friendInfo.stGameVip.dwHeadIconId);
				MonoSingleton<NobeSys>.GetInstance().SetHeadIconBkEffect(componetInChild2, (int)friendInfo.stGameVip.dwHeadIconId, uiFrom, 1f, true);
			}
			GameObject gameObject = com.m_widgets[2];
			if (gameObject)
			{
				MonoSingleton<NobeSys>.GetInstance().SetNobeIcon(gameObject.GetComponent<Image>(), (int)friendInfo.stGameVip.dwCurLevel, false, false, friendInfo.ullUserPrivacyBits);
			}
			Text component2 = com.m_widgets[3].GetComponent<Text>();
			string text = UT.Bytes2String(friendInfo.szUserName);
			if (component2 != null)
			{
				component2.set_text(text);
			}
			GameObject genderImage = com.m_widgets[4];
			FriendShower.ShowGender(genderImage, (COM_SNSGENDER)friendInfo.bGender);
		}
Exemplo n.º 17
0
            public void Init()
            {
                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Friend_SerchFriend, new CUIEventManager.OnUIEventHandler(this.On_SearchFriend));

                Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.Friend_Close_AddForm, new CUIEventManager.OnUIEventHandler(this.On_Friend_Close_AddForm));

                CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(CFriendContoller.AddFriendFormPath, false, true);

                this.input = script.transform.FindChild("GameObject/SearchFriend/InputField/Text").GetComponent <Text>();
                this.searchFriendShower = script.transform.FindChild("GameObject/SearchFriend/Result/Friend").GetComponent <FriendShower>();
                this.searchFriendShower.gameObject.CustomSetActive(false);
                this.recommandFriendListCom = Utility.GetComponetInChild <CUIListScript>(script.gameObject, "GameObject/RecommandList");
                this.buttons_node           = script.transform.FindChild("GameObject/Buttons").gameObject;
                this.info_text = script.transform.Find("GameObject/SearchFriend/Result/info").gameObject;
                if (this.info_text != null)
                {
                    this.info_text.CustomSetActive(false);
                }
                FriendSysNetCore.Send_Request_RecommandFriend_List();
                this.Refresh();
                this.bShow = true;
            }
Exemplo n.º 18
0
        private void On_AddFriend(CUIEvent evt)
        {
            COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .GetInstance().search_info;

            if ((evt.m_srcWidgetBelongedListScript == null) && (comdt_friend_info != null))
            {
                FriendSysNetCore.Send_Request_BeFriend(comdt_friend_info.stUin);
            }
            else
            {
                FriendShower component = evt.m_srcWidget.transform.parent.parent.parent.GetComponent <FriendShower>();
                if (component != null)
                {
                    COMDT_FRIEND_INFO data = this.model.GetInfo(CFriendModel.FriendType.Recommend, component.ullUid, component.dwLogicWorldID);
                    FriendSysNetCore.Send_Request_BeFriend(component.ullUid, component.dwLogicWorldID);
                    if (data != null)
                    {
                        this.model.Remove(CFriendModel.FriendType.Recommend, data);
                    }
                }
            }
        }
Exemplo n.º 19
0
        public static void Show_Item_Top(CUIComponent com, CFR frData)
        {
            IntimacyRelationViewUT.SetButtonParam(com.m_widgets[19], frData);
            if (frData.state == 1 || frData.state == 2)
            {
                com.m_widgets[19].CustomSetActive(true);
            }
            else
            {
                com.m_widgets[19].CustomSetActive(false);
            }
            COMDT_FRIEND_INFO friendInfo = frData.friendInfo;

            if (friendInfo == null)
            {
                return;
            }
            CUIHttpImageScript component = com.m_widgets[1].GetComponent <CUIHttpImageScript>();

            UT.SetHttpImage(component, friendInfo.szHeadUrl);
            GameObject gameObject = com.m_widgets[2];

            if (gameObject)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)friendInfo.stGameVip.dwCurLevel, false);
            }
            Text   component2 = com.m_widgets[3].GetComponent <Text>();
            string text       = UT.Bytes2String(friendInfo.szUserName);

            if (component2 != null)
            {
                component2.text = text;
            }
            GameObject genderImage = com.m_widgets[4];

            FriendShower.ShowGender(genderImage, friendInfo.bGender);
        }
Exemplo n.º 20
0
        public static void ShowFriendData(COMDT_FRIEND_INFO info, FriendShower com, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friendType)
        {
            com.ullUid         = info.stUin.ullUid;
            com.dwLogicWorldID = info.stUin.dwLogicWorldId;
            SetHttpImage(com.HttpImage, info.szHeadUrl);
            if (com.nobeIcon != null)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stGameVip.dwCurLevel, false);
            }
            else
            {
                Debug.Log("nobeicon " + ((int)info.stGameVip.dwCurLevel));
            }
            if (com.HeadIconBack != null)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stGameVip.dwHeadIconId);
            }
            else
            {
                Debug.Log("HeadIconBack " + ((int)info.stGameVip.dwHeadIconId));
            }
            if (com.QQVipImage != null)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.dwQQVIPMask);
            }
            else
            {
                Debug.Log("QQVipImage " + ((int)info.dwQQVIPMask));
            }
            com.SetFriendItemType(type, !bShowNickName);
            com.SetBGray((type == FriendShower.ItemType.Normal) && (info.bIsOnline != 1));
            com.ShowLevel(info.dwPvpLvl);
            com.ShowVipLevel(info.dwVipLvl);
            com.ShowLastTime(info.bIsOnline != 1, GetTimeString(info.dwLastLoginTime));
            CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(info.stUin.ullUid, info.stUin.dwLogicWorldId);

            if (friendInGaming == null)
            {
                com.ShowName(Bytes2String(info.szUserName));
                com.ShowGameState(COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE, info.bIsOnline == 1);
            }
            else
            {
                if (!string.IsNullOrEmpty(friendInGaming.nickName) && bShowNickName)
                {
                    com.ShowName(string.Format("{0}({1})", Bytes2String(info.szUserName), friendInGaming.nickName));
                }
                else
                {
                    com.ShowName(Bytes2String(info.szUserName));
                }
                com.ShowGameState(friendInGaming.State, info.bIsOnline == 1);
            }
            if (Singleton <CGuildSystem> .GetInstance().CanInvite(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasInvited(info.stUin.ullUid))
                {
                    com.ShowinviteGuild(true, false);
                }
                else
                {
                    com.ShowinviteGuild(true, true);
                }
            }
            else if (Singleton <CGuildSystem> .GetInstance().CanRecommend(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasRecommended(info.stUin.ullUid))
                {
                    com.ShowRecommendGuild(true, false);
                }
                else
                {
                    com.ShowRecommendGuild(true, true);
                }
            }
            else
            {
                com.ShowinviteGuild(false, false);
            }
            bool flag = Singleton <CFriendContoller> .instance.model.HeartData.BCanSendHeart(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_GAME);

            bool flag2 = Singleton <CFriendContoller> .instance.model.HeartData.BCanSendHeart(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);

            com.ShowSendButton(flag && flag2);
            if (CSysDynamicBlock.bSocialBlocked)
            {
                com.HideSendButton();
            }
            if (CSysDynamicBlock.bSocialBlocked)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.GameFriend)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.SNS)
            {
                bool isShow = CFriendReCallData.BLose(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);
                bool flag4  = Singleton <CFriendContoller> .instance.model.SnsReCallData.BInCd(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);

                com.ShowInviteButton(isShow, !flag4);
            }
            com.ShowGenderType((COM_SNSGENDER)info.bGender);
        }
Exemplo n.º 21
0
        private void Show_BeiZhouMoZhe_Reward()
        {
            if (this.zhaomu_content == null || this.beizhaomu_content == null)
            {
                return;
            }
            this.zhaomu_content.CustomSetActive(false);
            this.beizhaomu_content.CustomSetActive(true);
            CFriendRecruit friendRecruit = Singleton <CFriendContoller> .get_instance().model.friendRecruit;

            Text component  = this.beizhaomu_content.transform.FindChild("info/text").GetComponent <Text>();
            Text component2 = this.beizhaomu_content.transform.FindChild("info/benift/exp/icon/txt").GetComponent <Text>();
            Text component3 = this.beizhaomu_content.transform.FindChild("info/benift/gold/icon/txt").GetComponent <Text>();

            if (component2 != null)
            {
                component2.text = string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardExp());
            }
            if (component3 != null)
            {
                component3.text = string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardGold());
            }
            GameObject gameObject = this.beizhaomu_content.transform.FindChild("info/user").gameObject;

            gameObject.CustomSetActive(true);
            GameObject gameObject2 = gameObject.transform.FindChild("default").gameObject;

            gameObject2.GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_User_DefalutTxt");

            this.beizhaomu_content.transform.FindChild("info/reward/title/Text").GetComponent <Text>().text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_RewardTip");

            GameObject gameObject3 = gameObject.transform.FindChild("NameGroup").gameObject;

            CFriendRecruit.RecruitData beiZhaoMuZhe = friendRecruit.GetBeiZhaoMuZhe();
            Text component4 = gameObject.transform.FindChild("Level").GetComponent <Text>();

            if (beiZhaoMuZhe.userInfo == null)
            {
                component.text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_Role_NoData");

                gameObject2.CustomSetActive(true);
                gameObject3.CustomSetActive(false);
                component4.gameObject.CustomSetActive(false);
            }
            else
            {
                component.text = Singleton <CTextManager> .get_instance().GetText("Friend_Rec_Bei_Role_HasData");

                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(true);
                component4.gameObject.CustomSetActive(true);
                CUIHttpImageScript component5 = gameObject.transform.FindChild("pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>();
                UT.SetHttpImage(component5, beiZhaoMuZhe.userInfo.szHeadUrl);
                component4.text = string.Format("Lv.{0}", beiZhaoMuZhe.userInfo.dwPvpLvl);
                GameObject gameObject4 = gameObject.transform.FindChild("pnlSnsHead/HttpImage/NobeIcon").gameObject;
                if (gameObject4)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject4.GetComponent <Image>(), (int)beiZhaoMuZhe.userInfo.stGameVip.dwCurLevel, false);
                }
                Text   component6 = gameObject.transform.FindChild("NameGroup/Name").GetComponent <Text>();
                string text       = UT.Bytes2String(beiZhaoMuZhe.userInfo.szUserName);
                if (component6 != null)
                {
                    component6.text = text;
                }
                GameObject gameObject5 = gameObject.transform.FindChild("NameGroup/Gender").gameObject;
                FriendShower.ShowGender(gameObject5, beiZhaoMuZhe.userInfo.bGender);
            }
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            GameObject gameObject6 = this.beizhaomu_content.transform.FindChild("info/reward").gameObject;

            CFriendRecruit.RecruitData beiZhaoMuZhe2 = friendRecruit.GetBeiZhaoMuZhe();
            ulong ullUid         = beiZhaoMuZhe2.ullUid;
            uint  dwLogicWorldId = beiZhaoMuZhe2.dwLogicWorldId;
            int   num            = Math.Min(4, beiZhaoMuZhe2.RewardList.get_Count());

            for (int i = 0; i < num; i++)
            {
                CFriendRecruit.RecruitReward recruitReward = beiZhaoMuZhe2.RewardList.get_Item(i);
                GameObject gameObject7 = gameObject6.transform.FindChild(string.Format("reward_{0}", i)).gameObject;
                this.Show_Award(gameObject7, ullUid, dwLogicWorldId, 2, recruitReward.rewardID, recruitReward.state, form, true);
            }
        }
Exemplo n.º 22
0
        public static void ShowFriendData(COMDT_FRIEND_INFO info, FriendShower com, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friendType)
        {
            if (info != null)
            {
                com.ullUid         = info.stUin.ullUid;
                com.dwLogicWorldID = info.stUin.dwLogicWorldId;
                SetHttpImage(com.HttpImage, info.szHeadUrl);
                if (com.nobeIcon != null)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stGameVip.dwCurLevel, false);
                }
                if (com.HeadIconBack != null)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stGameVip.dwHeadIconId);
                }
                if (com.QQVipImage != null)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.dwQQVIPMask);
                }
                if ((type == FriendShower.ItemType.Normal) && (friendType == CFriendModel.FriendType.GameFriend))
                {
                    ushort num;
                    CFriendModel.EIntimacyType type2;
                    bool flag;
                    if (Singleton <CFriendContoller> .instance.model.GetFriendIntimacy(info.stUin.ullUid, info.stUin.dwLogicWorldId, out num, out type2, out flag))
                    {
                        if (num == 0)
                        {
                            com.intimacyNode.CustomSetActive(false);
                        }
                        else
                        {
                            com.intimacyNode.CustomSetActive(true);
                            com.ShowIntimacyNum(num, type2, flag);
                        }
                    }
                    else
                    {
                        com.intimacyNode.CustomSetActive(false);
                    }
                }
                else
                {
                    com.intimacyNode.CustomSetActive(false);
                }
                com.SetFriendItemType(type, !bShowNickName);
                com.SetBGray((type == FriendShower.ItemType.Normal) && (info.bIsOnline != 1));
                com.ShowLevel(info.dwPvpLvl);
                com.ShowVipLevel(info.dwVipLvl);
                com.ShowLastTime(info.bIsOnline != 1, GetTimeString(info.dwLastLoginTime));
                if (type == FriendShower.ItemType.Request)
                {
                    string friendVerifyContent = Singleton <CFriendContoller> .instance.model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId);

                    com.ShowVerify(friendVerifyContent);
                }
                CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .instance.model.GetFriendInGaming(info.stUin.ullUid, info.stUin.dwLogicWorldId);

                if (friendInGaming == null)
                {
                    com.ShowName(Bytes2String(info.szUserName));
                    com.ShowGameState(COM_ACNT_GAME_STATE.COM_ACNT_GAME_STATE_IDLE, info.bIsOnline == 1);
                }
                else
                {
                    if (!string.IsNullOrEmpty(friendInGaming.NickName) && bShowNickName)
                    {
                        com.ShowName(string.Format("{0}({1})", Bytes2String(info.szUserName), friendInGaming.NickName));
                    }
                    else
                    {
                        com.ShowName(Bytes2String(info.szUserName));
                    }
                    com.ShowGameState(friendInGaming.State, info.bIsOnline == 1);
                }
                if (Singleton <CGuildSystem> .GetInstance().CanInvite(info))
                {
                    if (Singleton <CGuildSystem> .GetInstance().HasInvited(info.stUin.ullUid))
                    {
                        com.ShowinviteGuild(true, false);
                    }
                    else
                    {
                        com.ShowinviteGuild(true, true);
                    }
                }
                else if (Singleton <CGuildSystem> .GetInstance().CanRecommend(info))
                {
                    if (Singleton <CGuildSystem> .GetInstance().HasRecommended(info.stUin.ullUid))
                    {
                        com.ShowRecommendGuild(true, false);
                    }
                    else
                    {
                        com.ShowRecommendGuild(true, true);
                    }
                }
                else
                {
                    com.ShowinviteGuild(false, false);
                }
                bool flag2 = Singleton <CFriendContoller> .instance.model.HeartData.BCanSendHeart(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_GAME);

                bool flag3 = Singleton <CFriendContoller> .instance.model.HeartData.BCanSendHeart(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);

                com.ShowSendButton(flag2 && flag3);
                if (CSysDynamicBlock.bSocialBlocked)
                {
                    com.HideSendButton();
                }
                if (CSysDynamicBlock.bSocialBlocked)
                {
                    com.ShowInviteButton(false, false);
                }
                else if (friendType == CFriendModel.FriendType.GameFriend)
                {
                    com.ShowInviteButton(false, false);
                }
                else if (friendType == CFriendModel.FriendType.SNS)
                {
                    bool isShow = CFriendReCallData.BLose(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);
                    bool flag5  = Singleton <CFriendContoller> .instance.model.SnsReCallData.BInCd(info.stUin, COM_FRIEND_TYPE.COM_FRIEND_TYPE_SNS);

                    bool flag6 = CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, COM_REFUSE_TYPE.COM_REFUSE_TYPE_DONOTE_AND_REC);
                    com.ShowInviteButton(isShow, !flag5 && !flag6);
                }
                if (Singleton <COBSystem> .instance.IsInOBFriendList(info.stUin.ullUid))
                {
                    com.ShowOBButton(true);
                }
                else
                {
                    com.ShowOBButton(false);
                }
                com.ShowGenderType((COM_SNSGENDER)info.bGender);
                com.ShowPlatChannelIcon(info);
                com.ShowSendGiftBtn(true);
            }
        }
        private void Show_BeiZhouMoZhe_Reward()
        {
            if (this.zhaomu_content == null || this.beizhaomu_content == null)
            {
                return;
            }
            this.zhaomu_content.CustomSetActive(false);
            this.beizhaomu_content.CustomSetActive(true);
            CFriendRecruit friendRecruit = Singleton <CFriendContoller> .instance.model.friendRecruit;
            Text           component     = this.beizhaomu_content.transform.FindChild("info/text").GetComponent <Text>();
            Text           component2    = this.beizhaomu_content.transform.FindChild("info/benift/exp/icon/txt").GetComponent <Text>();
            Text           component3    = this.beizhaomu_content.transform.FindChild("info/benift/gold/icon/txt").GetComponent <Text>();

            if (component2 != null)
            {
                component2.set_text(string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardExp()));
            }
            if (component3 != null)
            {
                component3.set_text(string.Format("+{0}%", friendRecruit.GetBeiZhaoMuZhe_RewardGold()));
            }
            GameObject gameObject = this.beizhaomu_content.transform.FindChild("info/user").gameObject;

            gameObject.CustomSetActive(true);
            GameObject gameObject2 = gameObject.transform.FindChild("default").gameObject;

            gameObject2.GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_User_DefalutTxt"));
            this.beizhaomu_content.transform.FindChild("info/reward/title/Text").GetComponent <Text>().set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_RewardTip"));
            GameObject gameObject3 = gameObject.transform.FindChild("NameGroup").gameObject;

            CFriendRecruit.RecruitData beiZhaoMuZhe = friendRecruit.GetBeiZhaoMuZhe();
            Text component4 = gameObject.transform.FindChild("Level").GetComponent <Text>();

            if (beiZhaoMuZhe.userInfo == null)
            {
                component.set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_Role_NoData"));
                gameObject2.CustomSetActive(true);
                gameObject3.CustomSetActive(false);
                component4.gameObject.CustomSetActive(false);
            }
            else
            {
                component.set_text(Singleton <CTextManager> .instance.GetText("Friend_Rec_Bei_Role_HasData"));
                gameObject2.CustomSetActive(false);
                gameObject3.CustomSetActive(true);
                component4.gameObject.CustomSetActive(true);
                CUIHttpImageScript component5 = gameObject.transform.FindChild("pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>();
                UT.SetHttpImage(component5, beiZhaoMuZhe.userInfo.szHeadUrl);
                component4.set_text(string.Format("Lv.{0}", beiZhaoMuZhe.userInfo.dwPvpLvl));
                GameObject gameObject4 = gameObject.transform.FindChild("pnlSnsHead/HttpImage/NobeIcon").gameObject;
                if (gameObject4)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject4.GetComponent <Image>(), (int)beiZhaoMuZhe.userInfo.stGameVip.dwCurLevel, false, true, 0uL);
                }
                Text   component6 = gameObject.transform.FindChild("NameGroup/Name").GetComponent <Text>();
                string text       = UT.Bytes2String(beiZhaoMuZhe.userInfo.szUserName);
                if (component6 != null)
                {
                    component6.set_text(text);
                }
                GameObject gameObject5 = gameObject.transform.FindChild("NameGroup/Gender").gameObject;
                FriendShower.ShowGender(gameObject5, (COM_SNSGENDER)beiZhaoMuZhe.userInfo.bGender);
            }
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            GameObject gameObject6 = this.beizhaomu_content.transform.FindChild("info/reward").gameObject;

            CFriendRecruit.RecruitData beiZhaoMuZhe2 = friendRecruit.GetBeiZhaoMuZhe();
            ulong ullUid         = beiZhaoMuZhe2.ullUid;
            uint  dwLogicWorldId = beiZhaoMuZhe2.dwLogicWorldId;
            int   num            = Math.Min(4, beiZhaoMuZhe2.RewardList.Count);
            float num2           = 1000f;
            float num3           = -1f;

            for (int i = 0; i < num; i++)
            {
                CFriendRecruit.RecruitReward recruitReward = beiZhaoMuZhe2.RewardList[i];
                GameObject           gameObject7           = gameObject6.transform.FindChild(string.Format("reward_{0}", i)).gameObject;
                ResRecruitmentReward cfgReward             = Singleton <CFriendContoller> .instance.model.friendRecruit.GetCfgReward(recruitReward.rewardID);

                if (cfgReward.dwLevel < num2 && cfgReward.dwLevel != 1u)
                {
                    num2 = cfgReward.dwLevel;
                }
                if (cfgReward.dwLevel > num3)
                {
                    num3 = cfgReward.dwLevel;
                }
                this.Show_Award(gameObject7, ullUid, dwLogicWorldId, COM_RECRUITMENT_TYPE.COM_RECRUITMENT_PASSIVE, recruitReward.rewardID, cfgReward, recruitReward.state, form, true);
            }
            GameObject gameObject8      = Utility.FindChild(this.beizhaomu_content, "info/reward/BarBg");
            GameObject gameObject9      = Utility.FindChild(this.beizhaomu_content, "info/reward/BarBg2");
            Image      componetInChild  = Utility.GetComponetInChild <Image>(gameObject8, "Fore");
            Image      componetInChild2 = Utility.GetComponetInChild <Image>(gameObject9, "Fore");

            if (this.beiZhaoMuZheBarWidth1 == 0f && componetInChild != null)
            {
                this.beiZhaoMuZheBarWidth1 = componetInChild.get_rectTransform().sizeDelta.x;
            }
            if (this.beiZhaoMuZheBarWidth2 == 0f && componetInChild2 != null)
            {
                this.beiZhaoMuZheBarWidth2 = componetInChild2.get_rectTransform().sizeDelta.x;
            }
            if (beiZhaoMuZhe.userInfo != null)
            {
                CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo();

                this.SetCombineBar(gameObject8, gameObject9, this.beiZhaoMuZheBarWidth1, this.beiZhaoMuZheBarWidth2, masterRoleInfo.PvpLevel, num2, num3);
            }
            else
            {
                this.SetBarSize(componetInChild, 0f, 0f);
                this.SetBarSize(componetInChild2, 0f, 0f);
            }
        }
Exemplo n.º 24
0
 public void ShowGenderType(COM_SNSGENDER genderType)
 {
     FriendShower.ShowGender(this.genderImage, genderType);
 }
        public void ShowZhaomuZhe_Item(GameObject com, CFriendRecruit.RecruitData info)
        {
            GameObject bar              = Utility.FindChild(com, "BarBg");
            GameObject bar2             = Utility.FindChild(com, "BarBg2");
            Image      componetInChild  = Utility.GetComponetInChild <Image>(com, "BarBg/Fore");
            Image      componetInChild2 = Utility.GetComponetInChild <Image>(com, "BarBg2/Fore");

            if (this.zhaoMuZheBarWidth1 == 0f && componetInChild != null)
            {
                this.zhaoMuZheBarWidth1 = componetInChild.get_rectTransform().sizeDelta.x;
            }
            if (this.zhaoMuZheBarWidth2 == 0f && componetInChild2 != null)
            {
                this.zhaoMuZheBarWidth2 = componetInChild2.get_rectTransform().sizeDelta.x;
            }
            if (info.userInfo != null)
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(true);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/hasData/Level").gameObject.CustomSetActive(true);
                CUIHttpImageScript component = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage").GetComponent <CUIHttpImageScript>();
                UT.SetHttpImage(component, info.userInfo.szHeadUrl);
                Text component2 = com.transform.FindChild("user/hasData/Level").GetComponent <Text>();
                component2.set_text(string.Format("Lv.{0}", info.userInfo.dwPvpLvl));
                GameObject gameObject = com.transform.FindChild("user/hasData/pnlSnsHead/HttpImage/NobeIcon").gameObject;
                if (gameObject)
                {
                    MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(gameObject.GetComponent <Image>(), (int)info.userInfo.stGameVip.dwCurLevel, false, true, 0uL);
                }
                Text   component3 = com.transform.FindChild("user/hasData/NameGroup/Name").GetComponent <Text>();
                string text       = UT.Bytes2String(info.userInfo.szUserName);
                if (component3 != null)
                {
                    component3.set_text(text);
                }
                GameObject gameObject2 = com.transform.FindChild("user/hasData/NameGroup/Gender").gameObject;
                FriendShower.ShowGender(gameObject2, (COM_SNSGENDER)info.userInfo.bGender);
            }
            else
            {
                com.transform.FindChild("user/hasData").gameObject.CustomSetActive(false);
                com.transform.FindChild("user/null").gameObject.CustomSetActive(true);
            }
            float         num  = 1000f;
            float         num2 = -1f;
            CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath);

            int num3 = Math.Min(this.zhaomuzheRewardCount, info.RewardList.Count);

            for (int i = 0; i < num3; i++)
            {
                Transform transform = com.transform.FindChild(string.Format("reward_{0}", i));
                DebugHelper.Assert(transform != null, "rewardNodeTS not null...");
                if (!(transform == null))
                {
                    CFriendRecruit.RecruitReward recruitReward = info.RewardList[i];
                    ResRecruitmentReward         cfgReward     = Singleton <CFriendContoller> .instance.model.friendRecruit.GetCfgReward(recruitReward.rewardID);

                    if (cfgReward.dwLevel < num)
                    {
                        num = cfgReward.dwLevel;
                    }
                    if (cfgReward.dwLevel > num2)
                    {
                        num2 = cfgReward.dwLevel;
                    }
                    this.Show_Award(transform.gameObject, info.ullUid, info.dwLogicWorldId, COM_RECRUITMENT_TYPE.COM_RECRUITMENT_ACTIVE, recruitReward.rewardID, cfgReward, recruitReward.state, form, true);
                }
            }
            GameObject gameObject3 = Utility.FindChild(com, "cup");

            this.ShowCup(gameObject3, info.IsGetAllReward(), 0);
            if (info.userInfo != null)
            {
                this.SetCombineBar(bar, bar2, this.zhaoMuZheBarWidth1, this.zhaoMuZheBarWidth2, info.userInfo.dwPvpLvl, num, num2);
            }
            else
            {
                this.SetBarSize(componetInChild, 0f, 0f);
                this.SetBarSize(componetInChild2, 0f, 0f);
            }
        }
Exemplo n.º 26
0
        public static void ShowFriendData(COMDT_FRIEND_INFO info, FriendShower com, FriendShower.ItemType type, bool bShowNickName, CFriendModel.FriendType friendType)
        {
            if (info == null)
            {
                return;
            }
            com.ullUid         = info.stUin.ullUid;
            com.dwLogicWorldID = info.stUin.dwLogicWorldId;
            UT.SetHttpImage(com.HttpImage, info.szHeadUrl);
            if (com.nobeIcon)
            {
                MonoSingleton <NobeSys> .GetInstance().SetNobeIcon(com.nobeIcon.GetComponent <Image>(), (int)info.stGameVip.dwCurLevel, false);
            }
            if (com.HeadIconBack)
            {
                MonoSingleton <NobeSys> .GetInstance().SetHeadIconBk(com.HeadIconBack.GetComponent <Image>(), (int)info.stGameVip.dwHeadIconId);
            }
            if (com.QQVipImage)
            {
                MonoSingleton <NobeSys> .GetInstance().SetOtherQQVipHead(com.QQVipImage.GetComponent <Image>(), (int)info.dwQQVIPMask);
            }
            if ((type == FriendShower.ItemType.Normal && friendType == CFriendModel.FriendType.GameFriend) || type == FriendShower.ItemType.Mentor || type == FriendShower.ItemType.Apprentice)
            {
                CFriendModel model = Singleton <CFriendContoller> .get_instance().model;

                ushort num;
                CFriendModel.EIntimacyType type2;
                bool bFreeze;
                if (model.GetFriendIntimacy(info.stUin.ullUid, info.stUin.dwLogicWorldId, out num, out type2, out bFreeze))
                {
                    if (num == 0)
                    {
                        com.intimacyNode.CustomSetActive(false);
                    }
                    else
                    {
                        com.intimacyNode.CustomSetActive(true);
                        CFR cfr = model.FRData.GetCfr(info.stUin.ullUid, info.stUin.dwLogicWorldId);
                        if (cfr != null)
                        {
                            com.ShowIntimacyNum((int)num, type2, bFreeze, cfr.state);
                        }
                        else
                        {
                            com.ShowIntimacyNum((int)num, type2, bFreeze, 0);
                        }
                    }
                }
                else
                {
                    com.intimacyNode.CustomSetActive(false);
                }
            }
            else
            {
                com.intimacyNode.CustomSetActive(false);
            }
            com.SetFriendItemType(type, !bShowNickName);
            bool flag = type == FriendShower.ItemType.Normal || type == FriendShower.ItemType.Mentor || type == FriendShower.ItemType.Apprentice || type == FriendShower.ItemType.AddMentor || type == FriendShower.ItemType.AddApprentice || type == FriendShower.ItemType.MentorRequest;

            com.SetBGray(flag && info.bIsOnline != 1);
            com.ShowLevel(info.dwPvpLvl);
            com.ShowVipLevel(info.dwVipLvl);
            com.ShowLastTime(info.bIsOnline != 1, UT.GetTimeString(info.dwLastLoginTime));
            switch (type)
            {
            case FriendShower.ItemType.Request:
            {
                string friendVerifyContent = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Friend);

                com.ShowVerify(friendVerifyContent);
                break;
            }

            case FriendShower.ItemType.MentorRequest:
            {
                string friendVerifyContent2 = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifyContent(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Mentor);

                com.ShowVerify(friendVerifyContent2);
                break;
            }
            }
            CFriendModel.FriendInGame friendInGaming = Singleton <CFriendContoller> .get_instance().model.GetFriendInGaming(info.stUin.ullUid, info.stUin.dwLogicWorldId);

            string text;

            if (friendInGaming == null)
            {
                text = UT.Bytes2String(info.szUserName);
                com.ShowGameState(0, info.bIsOnline == 1);
            }
            else
            {
                if (!string.IsNullOrEmpty(friendInGaming.NickName) && bShowNickName)
                {
                    text = string.Format("{0}({1})", UT.Bytes2String(info.szUserName), friendInGaming.NickName);
                }
                else
                {
                    text = UT.Bytes2String(info.szUserName);
                }
                com.ShowGameState(friendInGaming.State, info.bIsOnline == 1);
            }
            switch (type)
            {
            case FriendShower.ItemType.Request:
            {
                string friendSourceDesc = UT.GetFriendSourceDesc(info.stUin.ullUid, Singleton <CFriendContoller> .get_instance().model.GetFriendVerifySource(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Friend));
                if (!string.IsNullOrEmpty(friendSourceDesc))
                {
                    text = text + " " + friendSourceDesc;
                }
                break;
            }

            case FriendShower.ItemType.MentorRequest:
            {
                COMDT_FRIEND_SOURCE friendVerifySource = Singleton <CFriendContoller> .get_instance().model.GetFriendVerifySource(info.stUin.ullUid, info.stUin.dwLogicWorldId, CFriendModel.enVerifyDataSet.Mentor);

                if (friendVerifySource != null)
                {
                    string friendSourceDesc2 = UT.GetFriendSourceDesc(info.stUin.ullUid, friendVerifySource);
                    if (!string.IsNullOrEmpty(friendSourceDesc2))
                    {
                        text = text + " " + friendSourceDesc2;
                    }
                }
                break;
            }
            }
            com.ShowName(text);
            if (Singleton <CGuildSystem> .GetInstance().CanInvite(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasInvited(info.stUin.ullUid))
                {
                    com.ShowinviteGuild(true, false);
                }
                else
                {
                    com.ShowinviteGuild(true, true);
                }
            }
            else if (Singleton <CGuildSystem> .GetInstance().CanRecommend(info))
            {
                if (Singleton <CGuildSystem> .GetInstance().HasRecommended(info.stUin.ullUid))
                {
                    com.ShowRecommendGuild(true, false);
                }
                else
                {
                    com.ShowRecommendGuild(true, true);
                }
            }
            else
            {
                com.ShowinviteGuild(false, false);
            }
            bool bEnable = Singleton <CFriendContoller> .get_instance().model.HeartData.BCanSendHeart(info.stUin);

            com.ShowSendButton(bEnable);
            if (CSysDynamicBlock.bSocialBlocked)
            {
                com.HideSendButton();
            }
            if (com.m_mentorTitleObj != null && com.m_mentorTitleObj.transform.parent != null)
            {
                com.m_mentorTitleObj.transform.parent.gameObject.CustomSetActive(false);
            }
            if (UT.NeedShowGenderGradeByMentor(type, friendType))
            {
                com.ShowMentorSearchInfo(info, friendType, type);
                com.HideSendButton();
            }
            else if (friendType == CFriendModel.FriendType.Mentor || friendType == CFriendModel.FriendType.Apprentice)
            {
                com.ShowInviteButton(false, false);
            }
            else if (CSysDynamicBlock.bSocialBlocked)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.GameFriend)
            {
                com.ShowInviteButton(false, false);
            }
            else if (friendType == CFriendModel.FriendType.SNS)
            {
                bool isShow = CFriendReCallData.BLose(info.stUin, 2);
                bool flag2  = Singleton <CFriendContoller> .get_instance().model.SnsReCallData.BInCd(info.stUin, 2);

                bool flag3 = CFriendModel.IsOnSnsSwitch(info.dwRefuseFriendBits, 0);
                com.ShowInviteButton(isShow, !flag2 && !flag3);
            }
            if (Singleton <COBSystem> .get_instance().IsInOBFriendList(info.stUin.ullUid))
            {
                com.ShowOBButton(true);
            }
            else
            {
                com.ShowOBButton(false);
            }
            com.ShowGenderType(info.bGender);
            com.ShowPlatChannelIcon(info);
            com.ShowSendGiftBtn(true);
            if (friendType == CFriendModel.FriendType.Mentor || friendType == CFriendModel.FriendType.Apprentice)
            {
                enMentorRelationType enMentorRelationType = (enMentorRelationType)(info.bStudentType >> 4);
                int num2 = (int)(info.bStudentType & 15);
                switch (enMentorRelationType)
                {
                case enMentorRelationType.mentor:
                    if (com.mentor_relationship != null)
                    {
                        com.mentor_relationship.CustomSetActive(friendType == CFriendModel.FriendType.Mentor);
                        com.mentor_relationship.transform.Find("MentorRelationText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_mentor");
                    }
                    break;

                case enMentorRelationType.schoolmate:
                    if (com.mentor_relationship != null)
                    {
                        com.mentor_relationship.CustomSetActive(friendType == CFriendModel.FriendType.Mentor);
                        com.mentor_relationship.transform.Find("MentorRelationText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_schoolmate");
                    }
                    if (com.normal_node != null)
                    {
                        com.normal_node.CustomSetActive(true);
                    }
                    for (int i = 0; i < com.normal_node.transform.childCount; i++)
                    {
                        Transform child = com.normal_node.transform.GetChild(i);
                        if (child != null)
                        {
                            child.gameObject.CustomSetActive(false);
                        }
                    }
                    break;
                }
                int num3 = num2;
                if (num3 != 1)
                {
                    if (num3 == 2)
                    {
                        if (com.mentor_graduation != null)
                        {
                            com.mentor_graduation.CustomSetActive(friendType == CFriendModel.FriendType.Apprentice || enMentorRelationType == enMentorRelationType.schoolmate);
                            com.mentor_graduation.transform.Find("MentorStatusText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_Graduated");

                            if (com.normal_node != null)
                            {
                                com.normal_node.CustomSetActive(true);
                            }
                            for (int j = 0; j < com.normal_node.transform.childCount; j++)
                            {
                                Transform child2 = com.normal_node.transform.GetChild(j);
                                if (child2 != null)
                                {
                                    child2.gameObject.CustomSetActive(false);
                                }
                            }
                            if (com.del_node != null)
                            {
                                com.del_node.CustomSetActive(enMentorRelationType == enMentorRelationType.apprentice);
                            }
                        }
                    }
                }
                else if (com.mentor_graduation != null)
                {
                    com.mentor_graduation.CustomSetActive(friendType == CFriendModel.FriendType.Apprentice || enMentorRelationType == enMentorRelationType.schoolmate);
                    com.mentor_graduation.transform.Find("MentorStatusText").GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Mentor_InStudy");
                }
                CFriendModel model2 = Singleton <CFriendContoller> .get_instance().model;

                UT.SetAddNodeActive(com.add_node, friendType, model2.IsSnsFriend(com.ullUid, com.dwLogicWorldID) || model2.IsGameFriend(com.ullUid, com.dwLogicWorldID));
            }
        }