Пример #1
0
            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;
            }
Пример #2
0
            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;
            }