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; }
private void SetData() { HandlePopupAction = null; HandlePopupAction = new UPopupAction() { { "菜单元素名字1", new UListComponentItemDataPopup(_actionSelected: Select, _nDepth: 0, _sprItemPopup: TestSprite01, _listChildItems: new List <UListComponentItemDataPopupBase>() { { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试1", _nDepth: 1) }, { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试2", _nDepth: 1) }, { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试3", _nDepth: 1) } }) }, { "菜单元素名字2", new UListComponentItemDataPopup(_actionSelected: Select) }, { "菜单元素名字4", new UListComponentItemDataPopup(_actionSelected: Select) }, { "菜单元素名字5", new UListComponentItemDataPopup(_actionSelected: Select, _nDepth: 0, _listChildItems: new List <UListComponentItemDataPopupBase>() { { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试3", _nDepth: 1, _sprItemPopup: TestSprite02) }, { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试4", _nDepth: 1, _listChildItems: new List <UListComponentItemDataPopupBase>() { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试4-1", _nDepth: 2), new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试4-2", _nDepth: 2), }) } }) }, { "菜单元素名字6", new UListComponentItemDataPopup(_actionSelected: Select) }, { "菜单元素名字7", new UListComponentItemDataPopup(_actionSelected: Select, _sprItemPopup: TestSprite03, _bInteractable: false) }, }; HandlePopupAction2 = null; HandlePopupAction2 = new UPopupAction() { { "菜单元素名字1", new UListComponentItemDataPopup(_actionSelected: Select, _nDepth: 0) }, { "菜单元素名字2", new UListComponentItemDataPopup(_actionSelected: Select, _listChildItems: new List <UListComponentItemDataPopupBase>() { { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试1", _nDepth: 1) }, { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试2", _nDepth: 1) } }) }, { "菜单元素名字4", new UListComponentItemDataPopup(_actionSelected: Select) }, { "菜单元素名字5", new UListComponentItemDataPopup(_actionSelected: Select, _nDepth: 0, _listChildItems: new List <UListComponentItemDataPopupBase>() { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试4-1", _nDepth: 2), new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试4-2", _nDepth: 2), }) }, { "菜单元素名字6", new UListComponentItemDataPopup(_actionSelected: Select) }, { "菜单元素名字7", new UListComponentItemDataPopup(_actionSelected: Select, _sprItemPopup: TestSprite03, _bInteractable: false, _listChildItems: new List <UListComponentItemDataPopupBase>() { { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试3", _nDepth: 1, _sprItemPopup: TestSprite02) }, { new UListComponentItemDataPopup(_actionSelected: Select, _strItemTypeName: "子项测试4", _nDepth: 1) } }) }, }; }
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 UIPopupMenuData(UWidgets.UPopupAction _actionPopup, UnityEngine.Transform _actonTarget, UIWidgets.TipPosition _actionTipPosition) { actionPopup = _actionPopup; actionTarget = _actonTarget; actionTipPostion = _actionTipPosition; }
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; }