Esempio n. 1
0
        private void OnVideoEnterConfirm(CUIEvent cuiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(OB_FORM_PATH);

            if (form != null)
            {
                CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "ContentList");
                if (componetInChild != null)
                {
                    int selectedIndex = componetInChild.GetSelectedIndex();
                    int count         = 0;
                    switch (this.CurTab)
                    {
                    case enOBTab.Expert:
                        if ((selectedIndex >= 0) && (selectedIndex < this.OBExpertList.Count))
                        {
                            stOBExpert expert = this.OBExpertList[selectedIndex];
                            Singleton <WatchController> .GetInstance().TargetUID = expert.heroLabel.ullUid;

                            stOBExpert expert2 = this.OBExpertList[selectedIndex];
                            SendOBServeGreat(expert2.desk);
                        }
                        count = this.OBExpertList.Count;
                        break;

                    case enOBTab.Friend:
                        if ((selectedIndex >= 0) && (selectedIndex < this.OBFriendList.Count))
                        {
                            stOBFriend friend = this.OBFriendList[selectedIndex];
                            Singleton <WatchController> .GetInstance().TargetUID = friend.uin.ullUid;

                            stOBFriend friend2 = this.OBFriendList[selectedIndex];
                            SendOBServeFriend(friend2.uin);
                        }
                        count = this.OBFriendList.Count;
                        break;

                    case enOBTab.Local:
                        Singleton <WatchController> .GetInstance().TargetUID = Singleton <CRoleInfoManager> .instance.masterUUID;

                        if ((selectedIndex >= 0) && (selectedIndex < this.OBLocalList.Count))
                        {
                            Singleton <WatchController> .GetInstance().StartReplay(this.OBLocalList[selectedIndex].path);
                        }
                        count = this.OBLocalList.Count;
                        break;
                    }
                }
            }
        }
Esempio n. 2
0
 private void OnGetGreatMatch(CSPkg msg)
 {
     this.OBExpertList.Clear();
     for (int i = 0; i < msg.stPkgData.stGetGreatMatchRsp.dwCount; i++)
     {
         for (int j = 0; j < msg.stPkgData.stGetGreatMatchRsp.astList[i].dwLabelNum; j++)
         {
             stOBExpert item = new stOBExpert {
                 desk       = msg.stPkgData.stGetGreatMatchRsp.astList[i].stDesk,
                 startTime  = msg.stPkgData.stGetGreatMatchRsp.astList[i].dwStartTime,
                 observeNum = msg.stPkgData.stGetGreatMatchRsp.astList[i].dwObserveNum,
                 heroLabel  = msg.stPkgData.stGetGreatMatchRsp.astList[i].astLabel[j]
             };
             this.OBExpertList.Add(item);
         }
     }
     this.OBExpertList.Sort(new Comparison <stOBExpert>(this.SortByObserveNum));
     this.UpdateView();
 }
Esempio n. 3
0
 private void UpdateElement(GameObject element, stOBExpert OBExpert)
 {
     this.UpdateElement(element, Utility.UTF8Convert(OBExpert.heroLabel.szRoleName), Singleton <ApolloHelper> .GetInstance().ToSnsHeadUrl(Utility.UTF8Convert(OBExpert.heroLabel.szHealUrl)), (byte)OBExpert.heroLabel.dwGrade, OBExpert.heroLabel.dwClass, OBExpert.heroLabel.dwHeroID, enOBTab.Expert, (int)OBExpert.observeNum, this.curStatus, 0L, 0, 0);
 }
Esempio n. 4
0
 private int SortByObserveNum(stOBExpert left, stOBExpert right)
 {
     return((int)(right.observeNum - left.observeNum));
 }