Beispiel #1
0
        public void UpdateView()
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            GameObject    widget           = form.GetWidget(0);
            GameObject    widget2          = form.GetWidget(2);
            Text          componetInChild  = Utility.GetComponetInChild <Text>(widget, "Text");
            GameObject    widget3          = form.GetWidget(1);
            CUIListScript componetInChild2 = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "ContentList");
            RectTransform component        = Utility.FindChild(componetInChild2.gameObject, "ScrollRect").GetComponent <RectTransform>();

            if (componetInChild2 == null)
            {
                return;
            }
            COBSystem.enOBTab curTab = this.CurTab;
            widget3.CustomSetActive(false);
            if (curTab == COBSystem.enOBTab.Expert)
            {
                widget2.CustomSetActive(false);
                component.anchoredPosition = Vector2.zero;
                component.sizeDelta        = Vector2.zero;
                componetInChild2.SetElementAmount(this.OBExpertList.get_Count());
            }
            else if (curTab == COBSystem.enOBTab.Friend)
            {
                widget2.CustomSetActive(false);
                component.anchoredPosition = Vector2.zero;
                component.sizeDelta        = Vector2.zero;
                componetInChild2.SetElementAmount(this.OBFriendList.get_Count());
            }
            else if (curTab == COBSystem.enOBTab.Guild)
            {
                widget2.CustomSetActive(false);
                component.anchoredPosition = Vector2.zero;
                component.sizeDelta        = Vector2.zero;
                componetInChild2.SetElementAmount(this.OBGuildList.get_Count());
            }
            else if (curTab == COBSystem.enOBTab.Local)
            {
                int num = 0;
                foreach (GameReplayModule.ReplayFileInfo current in this.OBLocalList)
                {
                    if (current.isExpired)
                    {
                        num++;
                    }
                }
                widget2.CustomSetActive(this.OBLocalList.Count > 0);
                widget3.CustomSetActive(num > 0 && this.curStatus == COBSystem.enStatus.Editor);
                component.sizeDelta        = COBSystem.s_content_size;
                component.anchoredPosition = COBSystem.s_content_pos;
                componetInChild.set_text(Singleton <CTextManager> .instance.GetText((this.curStatus == COBSystem.enStatus.Normal) ? "Common_Edit" : "Common_Close"));
                componetInChild2.SetElementAmount(this.OBLocalList.Count);
            }
        }
Beispiel #2
0
        private void OnOBVideoTabClick(CUIEvent cuiEvent)
        {
            COBSystem.enOBTab curTab = this.CurTab;
            this.m_watchEntryData = null;
            switch (curTab)
            {
            case COBSystem.enOBTab.Expert:
                COBSystem.GetGreatMatch(false);
                break;

            case COBSystem.enOBTab.Friend:
                COBSystem.GetFriendsState();
                break;

            case COBSystem.enOBTab.Guild:
                this.OBGuildList = Singleton <CGuildMatchSystem> .GetInstance().GetGuidMatchObInfo();

                Singleton <CGuildMatchSystem> .GetInstance().RequestGuildOBCount();

                break;

            case COBSystem.enOBTab.Local:
                this.OBLocalList = Singleton <GameReplayModule> .instance.ListReplayFiles(false);

                break;
            }
            this.curStatus = COBSystem.enStatus.Normal;
            this.UpdateView();
        }
Beispiel #3
0
        private void OnVideoEnterConfirm(CUIEvent cuiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "ContentList");

            if (componetInChild == null)
            {
                return;
            }
            int selectedIndex = componetInChild.GetSelectedIndex();

            COBSystem.enOBTab curTab = this.CurTab;
            if (curTab == COBSystem.enOBTab.Expert)
            {
                if (selectedIndex >= 0 && selectedIndex < this.OBExpertList.get_Count())
                {
                    Singleton <WatchController> .GetInstance().TargetUID = this.OBExpertList.get_Item(selectedIndex).heroLabel.ullUid;

                    COBSystem.SendOBServeGreat(this.OBExpertList.get_Item(selectedIndex).desk);
                }
                int count = this.OBExpertList.get_Count();
            }
            else if (curTab == COBSystem.enOBTab.Friend)
            {
                if (selectedIndex >= 0 && selectedIndex < this.OBFriendList.get_Count())
                {
                    Singleton <WatchController> .GetInstance().TargetUID = this.OBFriendList.get_Item(selectedIndex).uin.ullUid;

                    COBSystem.SendOBServeFriend(this.OBFriendList.get_Item(selectedIndex).uin);
                }
                int count = this.OBFriendList.get_Count();
            }
            else if (curTab == COBSystem.enOBTab.Guild)
            {
                if (selectedIndex >= 0 && selectedIndex < this.OBGuildList.get_Count())
                {
                    Singleton <WatchController> .GetInstance().TargetUID = this.OBGuildList.get_Item(selectedIndex).playerUid;

                    Singleton <CGuildMatchSystem> .GetInstance().RequestObGuildMatch(this.OBGuildList.get_Item(selectedIndex).obUid);
                }
                int count = this.OBGuildList.get_Count();
            }
            else if (curTab == COBSystem.enOBTab.Local)
            {
                Singleton <WatchController> .GetInstance().TargetUID = Singleton <CRoleInfoManager> .get_instance().masterUUID;

                if (selectedIndex >= 0 && selectedIndex < this.OBLocalList.get_Count())
                {
                    Singleton <WatchController> .GetInstance().StartReplay(this.OBLocalList.get_Item(selectedIndex).path);
                }
                int count = this.OBLocalList.get_Count();
            }
        }
Beispiel #4
0
        public void UpdateView()
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            GameObject    obj              = Utility.FindChild(form.gameObject, "ContentList/BtnEditor");
            Text          componetInChild  = Utility.GetComponetInChild <Text>(form.gameObject, "ContentList/BtnEditor/Text");
            CUIListScript componetInChild2 = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "ContentList");
            RectTransform component        = Utility.FindChild(componetInChild2.gameObject, "ScrollRect").GetComponent <RectTransform>();

            if (componetInChild2 == null)
            {
                return;
            }
            COBSystem.enOBTab curTab = this.CurTab;
            if (curTab == COBSystem.enOBTab.Expert)
            {
                obj.CustomSetActive(false);
                component.anchoredPosition = Vector2.zero;
                component.sizeDelta        = Vector2.zero;
                componetInChild2.SetElementAmount(this.OBExpertList.get_Count());
            }
            else if (curTab == COBSystem.enOBTab.Friend)
            {
                obj.CustomSetActive(false);
                component.anchoredPosition = Vector2.zero;
                component.sizeDelta        = Vector2.zero;
                componetInChild2.SetElementAmount(this.OBFriendList.get_Count());
            }
            else if (curTab == COBSystem.enOBTab.Guild)
            {
                obj.CustomSetActive(false);
                component.anchoredPosition = Vector2.zero;
                component.sizeDelta        = Vector2.zero;
                componetInChild2.SetElementAmount(this.OBGuildList.get_Count());
            }
            else if (curTab == COBSystem.enOBTab.Local)
            {
                obj.CustomSetActive(this.OBLocalList.get_Count() > 0);
                component.sizeDelta        = COBSystem.s_content_size;
                component.anchoredPosition = COBSystem.s_content_pos;
                componetInChild.text       = Singleton <CTextManager> .get_instance().GetText((this.curStatus != COBSystem.enStatus.Normal) ? "Common_Close" : "Common_Edit");

                componetInChild2.SetElementAmount(this.OBLocalList.get_Count());
            }
        }
Beispiel #5
0
 private void OnElementEnable(CUIEvent cuiEvent)
 {
     COBSystem.enOBTab curTab = this.CurTab;
     if (curTab == COBSystem.enOBTab.Expert)
     {
         this.UpdateElement(cuiEvent.m_srcWidget, this.OBExpertList.get_Item(cuiEvent.m_srcWidgetIndexInBelongedList));
     }
     else if (curTab == COBSystem.enOBTab.Friend)
     {
         this.UpdateElement(cuiEvent.m_srcWidget, this.OBFriendList.get_Item(cuiEvent.m_srcWidgetIndexInBelongedList));
     }
     else if (curTab == COBSystem.enOBTab.Guild)
     {
         this.UpdateElement(cuiEvent.m_srcWidget, this.OBGuildList.get_Item(cuiEvent.m_srcWidgetIndexInBelongedList));
     }
     else if (curTab == COBSystem.enOBTab.Local)
     {
         this.UpdateElement(cuiEvent.m_srcWidget, this.OBLocalList.get_Item(cuiEvent.m_srcWidgetIndexInBelongedList));
     }
 }
Beispiel #6
0
        private void OnVideoEnter(CUIEvent cuiEvent)
        {
            COBSystem.enOBTab curTab = this.CurTab;
            if (curTab == COBSystem.enOBTab.Local)
            {
                CUIFormScript form = Singleton <CUIManager> .instance.GetForm(COBSystem.OB_FORM_PATH);

                if (form == null)
                {
                    return;
                }
                CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "ContentList");
                if (componetInChild == null)
                {
                    return;
                }
                int selectedIndex = componetInChild.GetSelectedIndex();
                GameReplayModule.ReplayFileInfo replayFileInfo = this.OBLocalList[selectedIndex];
                if (replayFileInfo != null && replayFileInfo.isExpired)
                {
                    Singleton <CUIManager> .GetInstance().OpenTips(Singleton <CTextManager> .GetInstance().GetText("OB_Desc_CannotPlayExpiredFile"), false, 1.5f, null, new object[0]);

                    return;
                }
            }
            if (this.curStatus == COBSystem.enStatus.Editor)
            {
                return;
            }
            if (Singleton <CMatchingSystem> .GetInstance().IsInMatching)
            {
                Singleton <CUIManager> .GetInstance().OpenTips("PVP_Matching", true, 1.5f, null, new object[0]);

                return;
            }
            Singleton <CUIManager> .instance.OpenMessageBoxWithCancel(Singleton <CTextManager> .instance.GetText("OB_Desc_11"), enUIEventID.OB_Video_Enter_Confirm, enUIEventID.None, false);
        }
Beispiel #7
0
        private void UpdateElement(GameObject element, string name, string headUrl, byte bGrade, uint subGrade, uint heroId, COBSystem.enOBTab curTab, int onlineNum, COBSystem.enStatus status = COBSystem.enStatus.Normal, long localTicks = 0L, byte mapType = 0, uint mapId = 0u, string localName = "")
        {
            CUIFormScript form = Singleton <CUIManager> .get_instance().GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            CUIHttpImageScript componetInChild = Utility.GetComponetInChild <CUIHttpImageScript>(element, "HeadImg");
            Image      componetInChild2        = Utility.GetComponetInChild <Image>(element, "HeroImg");
            Image      componetInChild3        = Utility.GetComponetInChild <Image>(element, "RankImg");
            Image      componetInChild4        = Utility.GetComponetInChild <Image>(element, "RankImg/SubRankImg");
            Text       componetInChild5        = Utility.GetComponetInChild <Text>(element, "PlayerName");
            Text       componetInChild6        = Utility.GetComponetInChild <Text>(element, "HeroName");
            GameObject obj = Utility.FindChild(element, "WatchImg");
            Text       componetInChild7 = Utility.GetComponetInChild <Text>(element, "LocalTime");
            Text       componetInChild8 = Utility.GetComponetInChild <Text>(element, "LocalMap");
            Text       componetInChild9 = Utility.GetComponetInChild <Text>(element, "WatchImg/OnlineCount");
            GameObject obj2             = Utility.FindChild(element, "DeleteBtn");

            componetInChild.SetImageUrl(headUrl);
            if (bGrade > 0)
            {
                componetInChild3.gameObject.CustomSetActive(true);
                componetInChild3.SetSprite(CLadderView.GetRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
                componetInChild4.SetSprite(CLadderView.GetSubRankSmallIconPath(bGrade, subGrade), form, true, false, false, false);
            }
            else
            {
                componetInChild3.gameObject.CustomSetActive(false);
            }
            componetInChild5.text = name;
            ResHeroCfgInfo dataByKey = GameDataMgr.heroDatabin.GetDataByKey(heroId);

            if (dataByKey != null)
            {
                string prefabPath = string.Format("{0}{1}", CUIUtility.s_Sprite_Dynamic_BustHero_Dir, CSkinInfo.GetHeroSkinPic(heroId, 0u));
                componetInChild2.SetSprite(prefabPath, form, false, true, true, false);
                componetInChild6.text = dataByKey.szName;
            }
            else
            {
                componetInChild6.text = string.Empty;
                DebugHelper.Assert(false, string.Format("COBSystem UpdateElement hero cfg[{0}] can not be found!", heroId));
            }
            if (curTab != COBSystem.enOBTab.Local)
            {
                obj.CustomSetActive(true);
                componetInChild9.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_3", new string[]
                {
                    onlineNum.ToString()
                });

                componetInChild7.gameObject.SetActive(false);
                obj2.CustomSetActive(false);
                componetInChild8.gameObject.CustomSetActive(false);
            }
            else
            {
                obj.CustomSetActive(false);
                componetInChild7.gameObject.SetActive(true);
                DateTime dateTime = new DateTime(localTicks);
                componetInChild7.text = Singleton <CTextManager> .get_instance().GetText("OB_Desc_12", new string[]
                {
                    dateTime.get_Month().ToString(),
                    dateTime.get_Day().ToString(),
                    dateTime.get_Hour().ToString("D2"),
                    dateTime.get_Minute().ToString("D2")
                });

                obj2.CustomSetActive(status == COBSystem.enStatus.Editor);
                componetInChild8.gameObject.CustomSetActive(true);
                ResDT_LevelCommonInfo pvpMapCommonInfo = CLevelCfgLogicManager.GetPvpMapCommonInfo(mapType, mapId);
                if (pvpMapCommonInfo != null)
                {
                    componetInChild8.text = pvpMapCommonInfo.szName;
                }
                else
                {
                    componetInChild8.text = string.Empty;
                }
                componetInChild6.text = string.Empty;
            }
        }
Beispiel #8
0
        private void OnVideoEnterConfirm(CUIEvent cuiEvent)
        {
            CUIFormScript form = Singleton <CUIManager> .instance.GetForm(COBSystem.OB_FORM_PATH);

            if (form == null)
            {
                return;
            }
            CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "ContentList");

            if (componetInChild == null)
            {
                return;
            }
            int selectedIndex = componetInChild.GetSelectedIndex();

            COBSystem.enOBTab curTab = this.CurTab;
            if (curTab == COBSystem.enOBTab.Expert)
            {
                if (selectedIndex >= 0 && selectedIndex < this.OBExpertList.get_Count())
                {
                    Singleton <WatchController> .GetInstance().TargetUID = this.OBExpertList.get_Item(selectedIndex).heroLabel.ullUid;

                    COBSystem.SendOBServeGreat(this.OBExpertList.get_Item(selectedIndex).desk);
                    this.m_watchEntryData            = new WatchEntryData();
                    this.m_watchEntryData.headUrl    = StringHelper.UTF8BytesToString(ref this.OBExpertList.get_Item(selectedIndex).heroLabel.szHealUrl);
                    this.m_watchEntryData.name       = StringHelper.UTF8BytesToString(ref this.OBExpertList.get_Item(selectedIndex).heroLabel.szRoleName);
                    this.m_watchEntryData.rankClass  = this.OBExpertList.get_Item(selectedIndex).heroLabel.dwClass;
                    this.m_watchEntryData.rankGrade  = (byte)this.OBExpertList.get_Item(selectedIndex).heroLabel.dwGrade;
                    this.m_watchEntryData.time       = (long)CRoleInfo.GetCurrentUTCTime();
                    this.m_watchEntryData.usedHeroId = this.OBExpertList.get_Item(selectedIndex).heroLabel.dwHeroID;
                    this.m_watchEntryData.userUid    = this.OBExpertList.get_Item(selectedIndex).heroLabel.ullUid;
                }
                int count = this.OBExpertList.get_Count();
            }
            else if (curTab == COBSystem.enOBTab.Friend)
            {
                if (selectedIndex >= 0 && selectedIndex < this.OBFriendList.get_Count())
                {
                    Singleton <WatchController> .GetInstance().TargetUID = this.OBFriendList.get_Item(selectedIndex).uin.ullUid;

                    COBSystem.SendOBServeFriend(this.OBFriendList.get_Item(selectedIndex).uin, -1);
                    this.m_watchEntryData            = new WatchEntryData();
                    this.m_watchEntryData.headUrl    = this.OBFriendList.get_Item(selectedIndex).headUrl;
                    this.m_watchEntryData.name       = this.OBFriendList.get_Item(selectedIndex).friendName;
                    this.m_watchEntryData.rankClass  = this.OBFriendList.get_Item(selectedIndex).gameDetail.dwClass;
                    this.m_watchEntryData.rankGrade  = this.OBFriendList.get_Item(selectedIndex).gameDetail.bShowRankGrade;
                    this.m_watchEntryData.time       = (long)CRoleInfo.GetCurrentUTCTime();
                    this.m_watchEntryData.usedHeroId = this.OBFriendList.get_Item(selectedIndex).gameDetail.dwHeroID;
                    this.m_watchEntryData.userUid    = this.OBFriendList.get_Item(selectedIndex).uin.ullUid;
                }
                int count2 = this.OBFriendList.get_Count();
            }
            else if (curTab == COBSystem.enOBTab.Guild)
            {
                if (selectedIndex >= 0 && selectedIndex < this.OBGuildList.get_Count())
                {
                    Singleton <WatchController> .GetInstance().TargetUID = this.OBGuildList.get_Item(selectedIndex).playerUid;

                    Singleton <CGuildMatchSystem> .GetInstance().RequestObGuildMatch(this.OBGuildList.get_Item(selectedIndex).obUid);

                    this.m_watchEntryData            = new WatchEntryData();
                    this.m_watchEntryData.headUrl    = this.OBGuildList.get_Item(selectedIndex).headUrl;
                    this.m_watchEntryData.name       = this.OBGuildList.get_Item(selectedIndex).playerName;
                    this.m_watchEntryData.rankClass  = this.OBGuildList.get_Item(selectedIndex).dwClass;
                    this.m_watchEntryData.rankGrade  = this.OBGuildList.get_Item(selectedIndex).bGrade;
                    this.m_watchEntryData.time       = (long)CRoleInfo.GetCurrentUTCTime();
                    this.m_watchEntryData.usedHeroId = this.OBGuildList.get_Item(selectedIndex).dwHeroID;
                    this.m_watchEntryData.userUid    = this.OBGuildList.get_Item(selectedIndex).playerUid;
                }
                int count3 = this.OBGuildList.get_Count();
            }
            else if (curTab == COBSystem.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);
                }
                int count4 = this.OBLocalList.Count;
            }
        }