/// <summary> /// 填充队伍数据 /// </summary> public void SetTeamData(TeamMemberVO infoVO, UISocialList.SocialType socialType, Vector2Int vector2Int) { UIUtil.SetIconImage(m_TeamPosImage, (uint)m_TeamPosIcons[vector2Int.y]); if (infoVO.UID > 0) { m_NullElelment.gameObject.SetActive(false); m_Elelment.gameObject.SetActive(true); m_SocialType = socialType; SetContent(); m_LevelText.text = string.Format(TableUtil.GetLanguageString("character_text_1019"), infoVO.Level.ToString()); m_DanText.text = string.Format(TableUtil.GetLanguageString("social_text_1004"), infoVO.DanLevel.ToString()); m_PlayerName.text = infoVO.Name; if (infoVO.IsOnline) { m_TeamOnLineImage.gameObject.SetActive(true); } if (infoVO.TID > 0) { if (m_CfgEternityProxy.GetPlayerByItemTId(infoVO.TID) != null) { UIUtil.SetIconImage(m_TeamHeardImage, (uint)m_CfgEternityProxy.GetPlayerByItemTId(infoVO.TID).Value.HeadPortrait); } } if (m_FriendProxy.GetFriend(infoVO.UID) != null) //好友 { m_TeamFriendImage.gameObject.SetActive(true); } else { m_TeamFriendImage.gameObject.SetActive(false); } if (m_TeamProxy.GetMember(infoVO.UID) == null) { m_TeamHeaderImage.gameObject.SetActive(false); } else { if (m_TeamProxy.GetMember(infoVO.UID).IsLeader) //队长 { m_TeamHeaderImage.gameObject.SetActive(true); } else { m_TeamHeaderImage.gameObject.SetActive(false); } } } else { m_NullElelment.gameObject.SetActive(true); m_Elelment.gameObject.SetActive(false); } }
public override void HandleNotification(INotification notification) { switch ((NotificationName)notification.Name) { case NotificationName.MSG_TEAM_BATTLE_UPDATE: ulong id = (ulong)notification.Body; if (m_TeamProxy.GetMember(id) != null) { FillPanel(); } break; case NotificationName.MSG_TEAM_MEMBER_UPDATE: //好友列表更新 FillPanel(); break; default: break; } }
/// <summary> /// 显示BuffIcon /// </summary> public void OnAddBufferIcon(SpacecraftEntity target) { RectTransform view = null; if (m_UIDToRectTranform1.ContainsKey(target.GetUId())) { view = m_UIDToRectTranform1[target.GetUId()].view; } else { if (m_UIDToRectTranform2.ContainsKey(target.GetUId())) { view = m_UIDToRectTranform2[target.GetUId()].view; } else { return; } } Transform bufferIconBox = view.Find("BuffIconBox"); if (bufferIconBox == null) { return; } bufferIconBox.gameObject.SetActive(true); Transform iconTemplate = bufferIconBox.GetChild(0); iconTemplate.gameObject.SetActive(false); int index = 0; if (target.GetAllBuffs().Count > 0) { foreach (KeyValuePair <uint, Buff> buffID2Value in target.GetAllBuffs()) { SkillBuff configVO = m_SkillProxy.GetBuff((int)buffID2Value.Key); Transform iconTras; if (configVO.ByteBuffer != null) { if ((BufferType)configVO.BuffHudShow == BufferType.None) { continue; } // Debug.LogError(target.GetName() + "==============" + configVO.Id + "========" //+ target.GetAllBuffs().Count + "=======" + (BufferType)configVO.BuffHudShow); index++; if (bufferIconBox.childCount >= index) { iconTras = bufferIconBox.GetChild(index - 1); } else { iconTras = Object.Instantiate(iconTemplate); iconTras.SetParent(bufferIconBox); iconTras.localScale = Vector3.one; iconTras.localPosition = Vector3.zero; iconTras.SetAsLastSibling(); } bufferIconBox.localScale = Vector3.one; if (m_MainEntity == target) { bufferIconBox.localScale = Vector3.one * 1.5f; } if ((uint)configVO.BuffHudIcon > 0) { UIUtil.SetIconImage(iconTras.GetComponent <Image>(), (uint)configVO.BuffHudIcon); } else { Debug.LogWarning("报错" + configVO.Id); } //Debug.Log(configVO.BuffHudIcon + "-=-=-=-=-=-" + configVO.BuffHudShow); switch ((BufferType)configVO.BuffHudShow) { case BufferType.All: // 1 全体 iconTras.gameObject.SetActive(true); break; case BufferType.Friend: // 2 友方 if (m_TeamProxy.GetMember(target.GetPlayerId()) != null) { iconTras.gameObject.SetActive(true); } break; case BufferType.Enemy: // 3 敌方 if (m_MainEntity != target && m_TeamProxy.GetMember(target.GetPlayerId()) == null) { iconTras.gameObject.SetActive(true); } break; case BufferType.Self: // 4 自己 if (m_MainEntity = target) { iconTras.gameObject.SetActive(true); } break; default: break; } } } // Debug.Log(index); for (int i = index; i < bufferIconBox.childCount; i++) { bufferIconBox.GetChild(i).gameObject.SetActive(false); } } else { for (int i = 0; i < bufferIconBox.childCount; i++) { bufferIconBox.GetChild(i).gameObject.SetActive(false); } } }
/// <summary> /// 刷新热键 /// </summary> public void RefreshHotKey() { if (m_SelectVoUid > 0) { SetHotKeyEnabled(UIAction.Social_AddBlacklist, true, true); SetHotKeyEnabled(UIAction.Social_Delete_RemoveBlacklist, true, true); SetHotKeyEnabled(UIAction.Team_Kick_Leave, true, true); SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, true); SetHotKeyEnabled(UIAction.Social_PrivateChat, true); SetHotKeyEnabled(UIAction.Team_Promote, true); SetHotKeyEnabled(UIAction.Team_Invite, true); State.GetAction(UIAction.Social_Inspect_AddFriend).Visible = true; } SetHotKeyEnabled(UIAction.Team_Mute_Unmute_MicOn_MicOff, true); switch (m_SocialType) { case SocialType.Team: SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 1); SetHotKeyDescription(UIAction.Team_Promote, 0); SetHotKeyDescription(UIAction.Team_Invite, 0); if (m_TeamProxy.GetMember(m_SelectVoUid) != null) { if (!m_TeamProxy.GetMember(m_SelectVoUid).IsOnline) { SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); SetHotKeyEnabled(UIAction.Social_PrivateChat, false); SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); SetHotKeyEnabled(UIAction.Team_Mute_Unmute_MicOn_MicOff, false); } } if (IsCaptainBySelf()) //自己是队长 { if (m_SelectVoUid == m_ServerListProxy.GetCurrentCharacterVO().UId) //选自己 { SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 1, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 1, true); if (m_TeamProxy.GetMember(m_SelectVoUid) != null) { if (m_TeamProxy.GetMember(m_SelectVoUid).IsMute) { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 3); } else { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 2); } } SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); SetHotKeyEnabled(UIAction.Social_PrivateChat, false); SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 0); } else { SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 0, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 0, true); if (m_TeamProxy.GetMember(m_SelectVoUid) != null) { if (m_TeamProxy.GetMember(m_SelectVoUid).IsMute) { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 1); } } SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 0); if (m_FriendProxy.GetFriend(m_SelectVoUid) != null) //好友 { SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 0); } else { SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 1); } if (m_FriendProxy.GetBlack(m_SelectVoUid) != null) { SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); } } } else { SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); if (m_SelectVoUid == m_ServerListProxy.GetCurrentCharacterVO().UId) //选自己 { SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 1, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 1, true); SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); SetHotKeyEnabled(UIAction.Social_PrivateChat, false); SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 0); if (m_TeamProxy.GetMember(m_SelectVoUid) != null) { if (m_TeamProxy.GetMember(m_SelectVoUid).IsMute) { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 3); } else { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 2); } } } else { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 0); SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 0, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 0, true); SetHotKeyEnabled(UIAction.Social_Delete_RemoveBlacklist, false, true); SetHotKeyEnabled(UIAction.Team_Kick_Leave, false, true); if (m_FriendProxy.GetFriend(m_SelectVoUid) != null) //好友 { SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 0); SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); } else { SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 1); } if (m_FriendProxy.GetBlack(m_SelectVoUid) != null) { SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); } } } if (m_TeamProxy.GetMember(m_ServerListProxy.GetCurrentCharacterVO().UId) == null) { SetHotKeyEnabled(UIAction.Social_Delete_RemoveBlacklist, false, true); SetHotKeyEnabled(UIAction.Team_Kick_Leave, false, true); SetHotKeyEnabled(UIAction.Team_Mute_Unmute_MicOn_MicOff, false); SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); if (m_SelectVoUid == m_ServerListProxy.GetCurrentCharacterVO().UId) { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 2); } else { SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 0); } } if (m_SelectVoUid <= 0) { SetHotKeyEnabled(UIAction.Team_Mute_Unmute_MicOn_MicOff, false); } break; case SocialType.Friend: SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 1); State.GetAction(UIAction.Social_Inspect_AddFriend).Visible = false; SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 0); SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 0, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 0, true); SetHotKeyDescription(UIAction.Team_Promote, 0); SetHotKeyDescription(UIAction.Team_Invite, 0); if (m_FriendProxy.GetBlack(m_SelectVoUid) != null) { SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 1); SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 1, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 1, true); SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); } else { SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 0, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 0, true); } if (m_FriendProxy.GetFriend(m_SelectVoUid) != null) { SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); if (m_FriendProxy.GetFriend(m_SelectVoUid).Status == FriendInfoVO.FriendState.LEAVE) { SetHotKeyEnabled(UIAction.Social_PrivateChat, false); SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); } } if (m_TeamProxy.GetMember(m_SelectVoUid) != null) { SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); } break; case SocialType.Ship: break; case SocialType.Other: SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 1); SetHotKeyDescription(UIAction.Team_Mute_Unmute_MicOn_MicOff, 0); SetHotKeyDescription(UIAction.Social_Delete_RemoveBlacklist, 0, true); SetHotKeyDescription(UIAction.Team_Kick_Leave, 0, true); SetHotKeyDescription(UIAction.Team_Promote, 0); SetHotKeyDescription(UIAction.Team_Invite, 0); SetHotKeyEnabled(UIAction.Social_Delete_RemoveBlacklist, false, true); SetHotKeyEnabled(UIAction.Team_Kick_Leave, false, true); if (m_FriendProxy.GetBlack(m_SelectVoUid) != null) { SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); if (m_FriendProxy.GetBlack(m_SelectVoUid).Status == FriendInfoVO.FriendState.LEAVE) { SetHotKeyEnabled(UIAction.Team_Invite, false); } } if (m_FriendProxy.GetFriend(m_SelectVoUid) != null) { SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 0); SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); State.GetAction(UIAction.Social_Inspect_AddFriend).Visible = false; if (m_FriendProxy.GetFriend(m_SelectVoUid).Status == FriendInfoVO.FriendState.LEAVE) { SetHotKeyEnabled(UIAction.Social_PrivateChat, false); SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); } } else { if (m_FriendProxy.GetRecent(m_SelectVoUid) != null) { if (m_FriendProxy.GetRecent(m_SelectVoUid).Status == FriendInfoVO.FriendState.LEAVE) { State.GetAction(UIAction.Social_Inspect_AddFriend).Visible = false; } } SetHotKeyDescription(UIAction.Social_Inspect_AddFriend, 1); } if (m_TeamProxy.GetMember(m_SelectVoUid) != null) { SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); } break; default: break; } if (m_SelectVoUid <= 0) { SetHotKeyEnabled(UIAction.Social_AddBlacklist, false, true); SetHotKeyEnabled(UIAction.Social_Delete_RemoveBlacklist, false, true); SetHotKeyEnabled(UIAction.Team_Kick_Leave, false, true); SetHotKeyEnabled(UIAction.Social_Inspect_AddFriend, false); State.GetAction(UIAction.Social_Inspect_AddFriend).Visible = false; SetHotKeyEnabled(UIAction.Social_PrivateChat, false); SetHotKeyEnabled(UIAction.Team_Promote, false); SetHotKeyEnabled(UIAction.Team_Invite, false); } }