public override void addPopupMenu() { if (m_Component.popupMenuHandle == null) { return; } UPopupAction popupAction = new UPopupAction(); DataCenter.SNSDataManager.BuddyInfo buddy = LogicDataCenter.snsDataManager.getBuddyInfoByUserID(m_Component.Item.nUserID); bool isSameWorld = LogicDataCenter.snsDataManager.isSameGameWorld(buddy.Info.nUserID); popupAction.Add(UPopupItemDataBuddyChat.GetDescString(), new UPopupItemDataBuddyChat(buddy.Info.nUserID)); if (isSameWorld) { popupAction.Add(UPopupItemDataTeamRequest.GetDescString(), new UPopupItemDataTeamRequest((int)buddy.Info.dwPdbID)); popupAction.Add(UPopupItemDataTeamInvite.GetDescString(), new UPopupItemDataTeamInvite((int)buddy.Info.dwPdbID)); popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail((int)buddy.Info.dwPdbID)); popupAction.Add(UPopupItemDataKinInvite.GetDescString(), new UPopupItemDataKinInvite((int)buddy.Info.dwPdbID)); //popupAction.Add(UPopupItemDataRequestJoinBuddyKin.GetDescString(), new UPopupItemDataRequestJoinBuddyKin((int)buddy.Info.dwPdbID)); popupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(buddy.Info.szName)); } popupAction.Add(UPopupItemDataAddBlackList.GetDescString(), new UPopupItemDataAddBlackList(buddy.Info.nUserID, buddy.Info.szName)); popupAction.Add(UPopupItemDataAddFriend.GetDescString(), new UPopupItemDataAddFriend(buddy.Info.nUserID, buddy.Info.szName)); m_Component.popupMenuHandle.HandlePopupAction = popupAction; }
/// <summary> /// 通知UI将菜单数据进行显示 /// </summary> protected void SendPopupMenuMessage() { m_PopupMenuAction.Clear(); foreach (UPopupItemRegisterInfo info in m_dicPopupItemInfo.Values) { if (info != null && info.ItemData != null) { m_PopupMenuAction.Add(info.ItemData.ItemTypeName, info.ItemData); } } m_MenuData.actionPopup = m_PopupMenuAction; EntityView ev = EntityFactory.getEntityViewByID(PopupMenuTargetEntityID); if (ev == null) { ev = EntityFactory.MainHeroView; m_MenuData.actionTipPostion = UIWidgets.TipPosition.MouseBottomRightCorner; } m_MenuData.actionTarget = ev.gameObject.transform; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_COMMON_POPUPMENU, m_MenuData); }
public override void addPopupMenu() { UPopupAction popupAction = new UPopupAction(); DataCenter.SNSDataManager.BuddyInfo buddy = LogicDataCenter.snsDataManager.getBuddyInfoByUserID(m_Component.Item.nUserID); bool isSameWorld = LogicDataCenter.snsDataManager.isSameGameWorld(buddy.Info.nUserID); popupAction.Add(UPopupItemDataAddFriend.GetDescString(), new UPopupItemDataAddFriend(buddy.Info.nUserID, buddy.Info.szName)); if (isSameWorld) { popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail((int)buddy.Info.dwPdbID)); } popupAction.Add(UPopupItemDataDelBuddy.GetDescString(), new UPopupItemDataDelBuddy(buddy.Info.nUserID, buddy.Info.szName)); m_Component.popupMenuHandle.HandlePopupAction = popupAction; }
// 为好友分组添加PopupMenu private void addPopupMenuForBuddyGroup(int buddyGroupID) { // 添加PopupAction popupMenuHandle = BuddyGroupTrans.gameObject.GetComponent <UPopupMenuHandle>(); if (popupMenuHandle != null) { popupMenuHandle.HandlePopupAction.Clear(); UPopupAction popupAction = new UPopupAction(); popupAction.Add(UPopupItemDataAddBuddyGroup.GetDescString(), new UPopupItemDataAddBuddyGroup()); // 非系统默认的分组才可以编辑名字和删除 if (!DataCenter.SNSDataManager.isDefaultBuddyGroup(buddyGroupID)) { popupAction.Add(UPopupItemDataUpdateBuddyGroupName.GetDescString(), new UPopupItemDataUpdateBuddyGroupName(buddyGroupID)); popupAction.Add(UPopupItemDataDelBuddyGroup.GetDescString(), new UPopupItemDataDelBuddyGroup(buddyGroupID)); } popupMenuHandle.HandlePopupAction = popupAction; } }
public virtual void addPopupMenu() { UPopupAction popupAction = new UPopupAction(); DataCenter.SNSDataManager.BuddyInfo buddy = LogicDataCenter.snsDataManager.getBuddyInfoByUserID(m_Component.Item.nUserID); bool isSameWorld = LogicDataCenter.snsDataManager.isSameGameWorld(buddy.Info.nUserID); popupAction.Add(UPopupItemDataBuddyChat.GetDescString(), new UPopupItemDataBuddyChat(buddy.Info.nUserID)); if (isSameWorld) { if (buddy.Info.nStatus != (int)ACTOR_GAME_STATE.GAME_STATE_OFFLINE) { popupAction.Add(UPopupItemDataTeamRequest.GetDescString(), new UPopupItemDataTeamRequest((int)buddy.Info.dwPdbID)); popupAction.Add(UPopupItemDataTeamInvite.GetDescString(), new UPopupItemDataTeamInvite((int)buddy.Info.dwPdbID)); } popupAction.Add(UPopupItemDataGetPlayerDetail.GetDescString(), new UPopupItemDataGetPlayerDetail((int)buddy.Info.dwPdbID)); //popupAction.Add(UPopupItemDataRequestJoinBuddyKin.GetDescString(), new UPopupItemDataRequestJoinBuddyKin((int)buddy.Info.dwPdbID)); popupAction.Add(UPopupItemDataKinInvite.GetDescString(), new UPopupItemDataKinInvite((int)buddy.Info.dwPdbID)); } if (buddy.Info.nStatus != (int)ACTOR_GAME_STATE.GAME_STATE_OFFLINE) { popupAction.Add(UPopupItemDataPrivateChat.GetDescString(), new UPopupItemDataPrivateChat(buddy.Info.szName)); if (GameLogicAPI.isMainMap((int)buddy.Info.dwSceneID)) { popupAction.Add(UPopupItemDataTransmitTo.GetDescString(), new UPopupItemDataTransmitTo(buddy.Info.dwWorldID, buddy.Info.dwServerID, buddy.Info.dwSceneID)); } } popupAction.Add(UPopupItemDataDelBuddy.GetDescString(), new UPopupItemDataDelBuddy(buddy.Info.nUserID, buddy.Info.szName)); popupAction.Add(UPopupItemDataUpdateRemark.GetDescString(), new UPopupItemDataUpdateRemark(buddy.Info.nUserID, buddy.Info.szName)); // 移动好友到分组 UListComponentItemDataPopup popupItem = new UListComponentItemDataPopup(_actionSelected: null, _listChildItems: new List <UListComponentItemDataPopupBase>()); Dictionary <int, string> buddyGroupList = new Dictionary <int, string>(); int nValidBuddyGroupCount = 0; foreach (var item in LogicDataCenter.snsDataManager.getBuddyGroupList()) { if (item.Info.nBuddyGroupID == (int)EMSNS_BUDDYGROUP_ID.EMSNS_BUDDYGROUP_ID_BLACKLIST || item.Info.nBuddyGroupID == (int)EMSNS_BUDDYGROUP_ID.EMSNS_BUDDYGROUP_ID_LastPlaying || item.Info.nBuddyGroupID == (int)EMSNS_BUDDYGROUP_ID.EMSNS_BUDDYGROUP_ID_NEARBY) { continue; } if (item.Info.nBuddyGroupID == LogicDataCenter.snsDataManager.getBuddyGroupID(buddy.Info.nUserID)) { continue; } popupItem.ItemChildItems.Add(new UPopupItemDataChangeBuddyGroup(buddy.Info.nUserID, item.Info.nBuddyGroupID, _strItemTypeName: item.Info.szBuddyGroupName)); nValidBuddyGroupCount++; } if (nValidBuddyGroupCount > 0) { popupAction.Add(ULocalizationService.Instance.Get("UIView", "PopupMenu", "ChangeBuddyGroup"), popupItem); } popupAction.Add(UPopupItemDataAddBlackList.GetDescString(), new UPopupItemDataAddBlackList(buddy.Info.nUserID, buddy.Info.szName)); m_Component.popupMenuHandle.HandlePopupAction = popupAction; }