private void Remove_And_Refresh(CFriendModel.FriendType type, COMDT_ACNT_UNIQ uniq) { this.model.Remove(type, uniq); if (this.view.IsActive()) { this.view.Refresh(); } }
public static void OnSCID_CMD_NTF_FRIEND_LOGIN_STATUS(CSPkg msg) { Singleton <EventRouter> .GetInstance().BroadCastEvent <CSPkg>("Friend_Login_NTF", msg); SCPKG_CMD_NTF_FRIEND_LOGIN_STATUS stNtfFriendLoginStatus = msg.stPkgData.stNtfFriendLoginStatus; CFriendModel.FriendType type = (stNtfFriendLoginStatus.bFriendType != 1) ? CFriendModel.FriendType.SNS : CFriendModel.FriendType.GameFriend; bool flag = stNtfFriendLoginStatus.bLoginStatus == 0; Singleton <EventRouter> .GetInstance().BroadCastEvent <CFriendModel.FriendType, ulong, uint, bool>("Chat_Friend_Online_Change", type, stNtfFriendLoginStatus.stUin.ullUid, stNtfFriendLoginStatus.stUin.dwLogicWorldId, flag); }
private void Add_And_Refresh(CFriendModel.FriendType type, COMDT_FRIEND_INFO data) { this.model.Add(type, data, false); if (type == CFriendModel.FriendType.GameFriend) { Singleton <CFriendContoller> .GetInstance().model.SortGameFriend(); } if (this.view.IsActive()) { this.view.Refresh(); } }
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); }
public void ShowMentorSearchInfo(COMDT_FRIEND_INFO info, CFriendModel.FriendType friendType, FriendShower.ItemType type) { enMentorState mentorState = CFriendContoller.GetMentorState(0u, null); bool bActive = UT.NeedShowGenderGradeByMentor(type, friendType) && (mentorState == enMentorState.IWantMentor || mentorState == enMentorState.IHasMentor); if (this.m_mentorTitleObj != null) { this.m_mentorTitleObj.transform.parent.gameObject.CustomSetActive(true); this.m_mentorTitleObj.gameObject.CustomSetActive(bActive); string text = string.Empty; try { text = GameDataMgr.famousMentorDatabin.GetDataByKey(info.dwMasterLvl).szTitle; } catch (Exception var_3_84) { } this.m_mentorTitleObj.GetComponent <Text>().text = text; } if (this.m_mentorFamousObj != null) { this.m_mentorFamousObj.gameObject.CustomSetActive(bActive); this.m_mentorFamousObj.text = Singleton <CTextManager> .GetInstance().GetText("Mentor_LvNApprenticeCountInfo", new string[] { info.dwMasterLvl.ToString(), info.dwStudentNum.ToString() }); } if (this.m_RankIconObj != null) { int num = CLadderSystem.ConvertEloToRank(info.RankVal[7]); CLadderView.ShowRankDetail(this.m_RankIconObj.transform.parent.gameObject, (byte)num, Singleton <RankingSystem> .GetInstance().GetRankClass(info.stUin.ullUid), 1u, false, true, false, false, true); } if (UT.NeedShowGenderGradeByMentor(type, friendType)) { this.ShowGenderType(info.bGender); } }
public static void SetAddNodeActive(GameObject addnode, CFriendModel.FriendType friendType, bool ifGrey = false) { if (addnode != null) { addnode.CustomSetActive(true); Transform transform = addnode.transform.Find("add_btn"); if (transform != null) { GameObject gameObject = transform.gameObject; if (gameObject != null) { gameObject.CustomSetActive(!ifGrey); stUIEventParams eventParams = default(stUIEventParams); eventParams.tag = (int)friendType; CUIEventScript component = gameObject.GetComponent <CUIEventScript>(); if (component != null) { component.SetUIEvent(enUIEventType.Click, enUIEventID.Friend_RequestBeFriend, eventParams); } } } } }
private void On_Friend_Login_NTF(CSPkg msg) { SCPKG_CMD_NTF_FRIEND_LOGIN_STATUS stNtfFriendLoginStatus = msg.stPkgData.stNtfFriendLoginStatus; CFriendModel.FriendType type = (stNtfFriendLoginStatus.bFriendType != 1) ? CFriendModel.FriendType.SNS : CFriendModel.FriendType.GameFriend; COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .GetInstance().model.GetInfo(type, stNtfFriendLoginStatus.stUin); if (comdt_friend_info != null) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { comdt_friend_info.bIsOnline = stNtfFriendLoginStatus.bLoginStatus; comdt_friend_info.dwLastLoginTime = (uint)masterRoleInfo.getCurrentTimeSinceLogin(); Singleton <CFriendContoller> .GetInstance().model.SortGameFriend(); if ((this.view != null) && this.view.IsActive()) { this.view.Refresh(); } } } }
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); } } } }
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); }
private void OnInvite_SendInviteFriend(CUIEvent uiEvent) { COM_INVITE_JOIN_TYPE tag = (COM_INVITE_JOIN_TYPE)uiEvent.m_eventParams.tag; ulong uid = uiEvent.m_eventParams.commonUInt64Param1; CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .instance.GetMasterRoleInfo(); if (masterRoleInfo != null) { uint time = (uint)masterRoleInfo.getCurrentTimeSinceLogin(); if (this.InInviteCdList(uid, time)) { object[] replaceArr = new object[] { this.GetNextInviteSec(uid, time) }; Singleton <CUIManager> .instance.OpenTips("Invite_Friend_Tips_1", true, 1f, null, replaceArr); } else { bool flag = Singleton <CFriendContoller> .instance.model.IsGameFriend(uid); CFriendModel.FriendType friendType = !flag ? CFriendModel.FriendType.SNS : CFriendModel.FriendType.GameFriend; byte num3 = !flag ? ((byte)2) : ((byte)1); COMDT_FRIEND_INFO comdt_friend_info = Singleton <CFriendContoller> .instance.model.getFriendByUid(uid, friendType); if (comdt_friend_info != null) { switch (tag) { case COM_INVITE_JOIN_TYPE.COM_INVITE_JOIN_ROOM: { CSPkg msg = NetworkModule.CreateDefaultCSPKG(0x7e1); msg.stPkgData.stInviteFriendJoinRoomReq.stFriendInfo.ullUid = comdt_friend_info.stUin.ullUid; msg.stPkgData.stInviteFriendJoinRoomReq.stFriendInfo.dwLogicWorldId = comdt_friend_info.stUin.dwLogicWorldId; msg.stPkgData.stInviteFriendJoinRoomReq.bFriendType = num3; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref msg, false); break; } case COM_INVITE_JOIN_TYPE.COM_INVITE_JOIN_TEAM: { CSPkg pkg2 = NetworkModule.CreateDefaultCSPKG(0x7e8); pkg2.stPkgData.stInviteFriendJoinTeamReq.stFriendInfo.ullUid = comdt_friend_info.stUin.ullUid; pkg2.stPkgData.stInviteFriendJoinTeamReq.stFriendInfo.dwLogicWorldId = comdt_friend_info.stUin.dwLogicWorldId; pkg2.stPkgData.stInviteFriendJoinTeamReq.bFriendType = num3; Singleton <NetworkModule> .GetInstance().SendLobbyMsg(ref pkg2, false); break; } } if (uiEvent.m_srcWidget.transform.parent != null) { Transform transform = uiEvent.m_srcWidget.transform.parent.Find("Online"); if (transform != null) { transform.GetComponent <Text>().text = Singleton <CTextManager> .GetInstance().GetText("Guild_Has_Invited"); } } this.AddInviteStateList(uid, time, enInviteState.Invited); } } } }
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; } } } } } }
public stFriendByUUIDAndLogicID(ulong uuid, uint logicWorldID, CFriendModel.FriendType type) { this.ullUid = uuid; this.dwLogicWorldID = logicWorldID; this.friendType = type; }
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)); } }
public static bool NeedShowGenderGradeByMentor(FriendShower.ItemType type, CFriendModel.FriendType friendType) { return(friendType == CFriendModel.FriendType.MentorRecommend || type == FriendShower.ItemType.AddMentor || type == FriendShower.ItemType.AddApprentice || friendType == CFriendModel.FriendType.MentorRequestList); }
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); } }