Beispiel #1
0
        /// <summary>
        /// 显示主面板
        /// </summary>
        public void updateMainPanel()
        {
            // 设置好友列表内容
            Data.Clear();
            foreach (var buddyGroup in LogicDataCenter.snsDataManager.getBuddyGroupList())
            {
                // 添加一个好友分组
                UBuddyGroupTreeViewDataSource data = new UBuddyGroupTreeViewDataSource();
                data.nBuddyGroupID = buddyGroup.Info.nBuddyGroupID;
                data.Depth         = 0;
                data.IsExpanded    = buddyGroup.isExpanded;

                Data.Add(data);

                // 添加该好友分组下的好友
                foreach (var buddy in LogicDataCenter.snsDataManager.getBuddyListByBuddyGroupID(buddyGroup.Info.nBuddyGroupID))
                {
                    data         = new UBuddyGroupTreeViewDataSource();
                    data.nUserID = buddy.Info.nUserID;
                    data.Depth   = 1;

                    Data.Add(data);
                }
            }

            setBuddyGroupTreeViewDataSource();

            // 设置自己的信息
            DataCenter.SNSDataManager.BuddyInfo myInfo = LogicDataCenter.snsDataManager.MyBuddyInfo;
            MyAvatar.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PlayerHead, WndID.WND_ID_PLAYERFRAME, 2, 1);
            MyName.text     = myInfo.Info.szName;
            MyStatus.text   = LogicDataCenter.snsDataManager.getSelfStatusDesc();
        }
Beispiel #2
0
        /// <summary>
        /// 显示主面板
        /// </summary>
        public void updateMainPanel()
        {
            // 设置好友列表内容
            Data.Clear();

            List <SNSDataManager.BuddyInfo> buddyList = null;
            bool isWarScene = GameLogicAPI.isInWarScene() > 0;

            foreach (var buddyGroup in LogicDataCenter.snsDataManager.getBuddyGroupList())
            {
                // 战场中不显示附近的人分组信息
                if (isWarScene && buddyGroup.Info.nBuddyGroupID == (int)EMSNS_BUDDYGROUP_ID.EMSNS_BUDDYGROUP_ID_NEARBY)
                {
                    continue;
                }

                // 添加一个好友分组
                UBuddyGroupTreeViewDataSource data = new UBuddyGroupTreeViewDataSource();
                data.nBuddyGroupID = buddyGroup.Info.nBuddyGroupID;
                data.Depth         = 0;
                data.IsExpanded    = buddyGroup.isExpanded;

                Data.Add(data);

                // 添加该好友分组下的好友
                buddyList = LogicDataCenter.snsDataManager.getBuddyListByBuddyGroupID(buddyGroup.Info.nBuddyGroupID);
                foreach (var buddy in buddyList)
                {
                    data         = new UBuddyGroupTreeViewDataSource();
                    data.nUserID = buddy.Info.nUserID;
                    data.Depth   = 1;

                    Data.Add(data);
                }
            }

            setBuddyGroupTreeViewDataSource();

            // 设置自己的信息
            DataCenter.SNSDataManager.BuddyInfo myInfo = LogicDataCenter.snsDataManager.MyBuddyInfo;
            MyAvatar.sprite    = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_PlayerHead, WndID.WND_ID_SNS_MAINPANEL, 1, 1);
            MyName.text        = myInfo.Info.szName;
            MyStateText.text   = LogicDataCenter.snsDataManager.getSelfStatusDesc();
            MyStateIcon.sprite = USpriteManager.Instance.GetSprite(USpriteManager.ESpriteType.EST_GameState, WndID.WND_ID_SNS_MAINPANEL,
                                                                   UDefines.GetGameStateIconID(myInfo.Info.nStatus));

            if (String.IsNullOrEmpty(myInfo.Info.szMood) == false)
            {
                MyMoodInputField.text = myInfo.Info.szMood;
                if (MoodTips != null)
                {
                    MoodTips.SetText(UTooltipParamName.BodyText, myInfo.Info.szMood);
                    MoodTips.tipPosition = TipPosition.MouseTopRightCorner;
                    MoodTips.enabled     = true;
                }
            }
        }
Beispiel #3
0
        /// <summary>
        /// Convert item to node.
        /// </summary>
        /// <returns>The node.</returns>
        /// <param name="item">Item.</param>
        protected virtual TreeNode <UBuddyGroupTreeItemData> Item2Node(UBuddyGroupTreeViewDataSource item)
        {
            var nodeItem = new UBuddyGroupTreeItemData(item.Name, item.Icon);

            nodeItem.Tag           = item.Tag;
            nodeItem.Name          = item.Name;
            nodeItem.nUserID       = item.nUserID;
            nodeItem.nBuddyGroupID = item.nBuddyGroupID;

            return(new TreeNode <UBuddyGroupTreeItemData>(nodeItem, new ObservableList <TreeNode <UBuddyGroupTreeItemData> >(), item.IsExpanded, item.IsVisible));
        }