private void OnOBVideoTabClick(CUIEvent cuiEvent) { switch (this.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> .get_instance().ListReplayFiles(true); break; } this.curStatus = COBSystem.enStatus.Normal; this.UpdateView(); }
private void OnEditorClick(CUIEvent cuiEvent) { if (this.CurTab == COBSystem.enOBTab.Local) { if (this.curStatus == COBSystem.enStatus.Normal) { this.curStatus = COBSystem.enStatus.Editor; } else { this.curStatus = COBSystem.enStatus.Normal; } this.UpdateView(); } }
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; } }