private void OnShowMainPanel(HeadIconSys.enHeadImgTab curTab) { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(HeadIconSys.s_headImgChgForm); if (form != null) { ListView <ResHeadImage> curHeadImgList = this.GetCurHeadImgList(curTab); int count = curHeadImgList.Count; CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "pnlBg/Panel_Main/List"); componetInChild.SetElementAmount(count); int index = 0; for (int i = 0; i < count; i++) { if (this.IsHeadIconInUse(curHeadImgList[i].dwID)) { index = i; break; } } if (count > 0) { componetInChild.SelectElement(index, true); } else { this.OnShowDetailPanel(-1); } } }
private void InitTab(CUIListScript list) { if (list == null) { return; } bool flag = Singleton <CGuildSystem> .GetInstance().IsInNormalGuild(); int num = Enum.GetValues(typeof(COBSystem.enOBTab)).get_Length() - 1; if (!flag) { num--; } list.SetElementAmount(num); string[] array = new string[] { "OB_Expert", "OB_Freind", "OB_Guild", "OB_Local" }; for (int i = 0; i < num; i++) { CUIListElementScript elemenet = list.GetElemenet(i); int num2 = (i + 1 < 3 || flag) ? i : (i + 1); elemenet.m_onEnableEventParams.tag = num2; Utility.GetComponetInChild <Text>(elemenet.gameObject, "Text").text = Singleton <CTextManager> .get_instance().GetText(array[num2]); } list.SelectElement(0, true); }
private void OnShowMainPanel(enHeadImgTab curTab) { CUIFormScript form = Singleton <CUIManager> .instance.GetForm(s_headImgChgForm); if (form != null) { int count = this.GetCurHeadImgList(curTab).Count; CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(form.gameObject, "pnlBg/Panel_Main/List"); CUIListElementScript elemenet = null; componetInChild.SetElementAmount(count); for (int i = 0; i < count; i++) { elemenet = componetInChild.GetElemenet(i); if ((elemenet != null) && (elemenet.gameObject != null)) { this.OnUpdateElement(elemenet.gameObject, i, curTab); } } if (count > 0) { componetInChild.SelectElement(0, true); } else { this.OnShowDetailPanel(-1); } } }
private void InitTab(CUIListScript list) { if (list != null) { int amount = Enum.GetValues(typeof(enOBTab)).Length - 1; list.SetElementAmount(amount); string text = string.Empty; for (int i = 0; i < amount; i++) { switch (((enOBTab)(i + 1))) { case enOBTab.Expert: text = Singleton <CTextManager> .instance.GetText("OB_Expert"); break; case enOBTab.Friend: text = Singleton <CTextManager> .instance.GetText("OB_Freind"); break; case enOBTab.Local: text = Singleton <CTextManager> .instance.GetText("OB_Local"); break; } Utility.GetComponetInChild <Text>(list.GetElemenet(i).gameObject, "Text").text = text; } list.SelectElement(0, true); } }
protected override void Update() { if (base.isInitialize) { base.Update(); return; } CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CTaskSys.TASK_FORM_PATH); if (form != null) { CTaskView taskView = Singleton <CTaskSys> .GetInstance().GetTaskView(); if (taskView != null) { taskView.On_Tab_Change(0); CUIListScript component = form.GetWidget(2).GetComponent <CUIListScript>(); component.SelectElement(0, true); GameObject widget = form.GetWidget(13); if (widget != null) { base.AddHighLightGameObject(widget, true, form, true); base.Initialize(); } } } }
private void OnBag_MenuSelect(CUIEvent uiEvent) { GameObject gameObject = uiEvent.m_srcFormScript.gameObject; GameObject obj3 = gameObject.transform.Find("Panel_Left").gameObject; int selectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetSelectedIndex(); int lastSelectedIndex = uiEvent.m_srcWidget.GetComponent <CUIListScript>().GetLastSelectedIndex(); this.m_selectUseableType = (enItemMenuType)selectedIndex; CUseableContainer useableContainer = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM); if (useableContainer != null) { CUseableContainer containerBySelectType = this.GetContainerBySelectType(useableContainer); if (containerBySelectType != null) { containerBySelectType.SortItemBag(); } this.m_selectUseableContainer = containerBySelectType; CUIListScript component = gameObject.transform.Find("Panel_Right/List").gameObject.GetComponent <CUIListScript>(); component.SetElementAmount(this.m_selectUseableContainer.GetCurUseableCount()); if (component.m_elementAmount == 0) { obj3.CustomSetActive(false); } else { int index = component.GetSelectedIndex(); if (((index < 0) || (index >= component.m_elementAmount)) || (selectedIndex != lastSelectedIndex)) { component.SelectElement(0, true); this.RefreshSelectItem(uiEvent.m_srcFormScript, uiEvent.m_srcFormScript.gameObject, 0); component.MoveElementInScrollArea(0, true); } else { component.SelectElement(index, true); this.RefreshSelectItem(uiEvent.m_srcFormScript, uiEvent.m_srcFormScript.gameObject, index); component.MoveElementInScrollArea(index, true); } } } }
public static void ShowRankGodDetailPanel() { CUIFormScript cUIFormScript = Singleton <CUIManager> .get_instance().OpenForm(RankingSystem.s_rankingGodDetailForm, false, true); GameObject widget = cUIFormScript.GetWidget(0); RankingView.InitRankGodDetailTab(); CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(widget, "TitleTab"); componetInChild.SelectElement(0, true); }
public static void InitListTab(CUIFormScript form) { CUIListScript component = form.GetWidget(7).GetComponent <CUIListScript>(); int tabCount = GetTabCount(); component.SetElementAmount(tabCount); for (int i = 0; i < component.GetElementAmount(); i++) { component.GetElemenet(i).transform.Find("txtName").GetComponent <Text>().text = GetTabName(i); } component.SelectElement(0, true); }
public void RefreshBagForm() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_bagFormPath); if (form != null) { CUIListScript component = form.gameObject.transform.Find("TopCommon/Panel_Menu/List").gameObject.GetComponent <CUIListScript>(); component.m_alwaysDispatchSelectedChangeEvent = true; component.SelectElement((int)this.m_selectUseableType, true); component.m_alwaysDispatchSelectedChangeEvent = false; } }
private void On_HeadIcon_Form_Open(CUIEvent uiEvent) { CUIFormScript cUIFormScript = Singleton <CUIManager> .instance.OpenForm(HeadIconSys.s_headImgChgForm, false, true); if (cUIFormScript != null) { CUIListScript componetInChild = Utility.GetComponetInChild <CUIListScript>(cUIFormScript.gameObject, "pnlBg/Panel_Menu/List"); componetInChild.SetElementAmount(5); for (int i = 0; i < 5; i++) { componetInChild.GetElemenet(i).GetComponentInChildren <Text>().set_text(Singleton <CTextManager> .instance.GetText(string.Format("HeadImg_Tab_Txt_{0}", i + 1))); } componetInChild.SelectElement(0, true); } }
private int GetDropListSelectIdx(int searchType) { CUIListScript component = this.m_searchTypeNodes[searchType].transform.FindChild("List").GetComponent <CUIListScript>(); if (component != null) { int num = component.GetSelectedIndex(); if (num < 0) { num = 0; component.SelectElement(0, true); } return(num); } return(0); }
private void OnClickRank(CUIEvent uiEvt) { CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm(UNION_RANK_PATH, false, true); if (script != null) { this.Clear(); this.initWidget(); CUIListScript component = script.GetWidget(2).GetComponent <CUIListScript>(); if ((component != null) && (component.GetElementAmount() > 0)) { component.SelectElement(0, true); CUIEventScript script3 = component.GetElemenet(0).GetComponent <CUIEventScript>(); Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(script3.m_onClickEventID, script3.m_onClickEventParams); } } }
public static void SetTabList(List <string> titles, int start_index, CUIListScript tablistScript) { if (tablistScript == null) { return; } DebugHelper.Assert(start_index < titles.get_Count(), "SetTabList, should start_index < titles.Count"); tablistScript.SetElementAmount(titles.get_Count()); for (int i = 0; i < tablistScript.m_elementAmount; i++) { CUIListElementScript elemenet = tablistScript.GetElemenet(i); Text component = elemenet.gameObject.transform.FindChild("Text").GetComponent <Text>(); component.text = titles.get_Item(i); } tablistScript.m_alwaysDispatchSelectedChangeEvent = true; tablistScript.SelectElement(start_index, true); tablistScript.m_alwaysDispatchSelectedChangeEvent = false; }
private void InitMaps(CUIFormScript rootFormScript) { this.mapList = new ListView <ResAcntBattleLevelInfo>(); uint[] numArray = new uint[10]; uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_1"), out numArray[0]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_2"), out numArray[1]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_3"), out numArray[2]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_4"), out numArray[3]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_5"), out numArray[4]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_6"), out numArray[5]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_7"), out numArray[6]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_8"), out numArray[7]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_9"), out numArray[8]); uint.TryParse(Singleton <CTextManager> .instance.GetText("MapID_Room_10"), out numArray[9]); for (int i = 0; i < numArray.Length; i++) { if (numArray[i] != 0) { ResAcntBattleLevelInfo dataByKey = GameDataMgr.pvpLevelDatabin.GetDataByKey(numArray[i]); if (dataByKey != null) { this.mapList.Add(dataByKey); } } } CUIListScript component = rootFormScript.transform.Find("Panel_Main/List").gameObject.GetComponent <CUIListScript>(); component.SetElementAmount(this.mapList.Count); for (int j = 0; j < component.m_elementAmount; j++) { Image image = component.GetElemenet(j).transform.GetComponent <Image>(); string prefabPath = CUIUtility.s_Sprite_Dynamic_PvpEntry_Dir + this.mapList[j].dwMapId; image.SetSprite(prefabPath, rootFormScript, true, false, false); } component.SelectElement(-1, true); if (CSysDynamicBlock.bLobbyEntryBlocked) { Transform transform = rootFormScript.transform.Find("panelGroup5"); if (transform != null) { transform.gameObject.CustomSetActive(false); } } }
private void OnSharePVPDefeatAddBarrage(CUIEvent uiEvent) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(PvpAchievementForm.s_formSharePVPDefeatPath); if (form == null) { return; } GameObject widget = form.GetWidget(1); if (widget != null && !widget.activeSelf) { widget.CustomSetActive(true); } GameObject gameObject = Utility.FindChild(widget, "BarrageList"); if (gameObject == null) { return; } CUIListScript component = gameObject.GetComponent <CUIListScript>(); if (component == null) { return; } component.SetElementAmount(this.barrageList.Count); component.MoveElementInScrollArea(0, true); for (int i = 0; i < this.barrageList.Count; i++) { if (component.GetElemenet(i) != null && component.IsElementInScrollArea(i)) { this.UpdateOneBarrageElement(component.GetElemenet(i).gameObject, i, false); } } if (component.GetSelectedIndex() == -1) { component.SelectElement(0, true); } if (!gameObject.activeSelf) { gameObject.CustomSetActive(true); } }
public void RefreshGuildListPanel(bool isHideListExtraContent = false) { if (!this.IsShow()) { return; } GameObject widget = this.m_form.GetWidget(5); widget.CustomSetActive(true); switch (Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().m_baseGuildInfo.guildState) { case 0: case 1: case 2: case 7: { int guildInfoCount = this.m_Model.GetGuildInfoCount(); CUIListScript component = this.m_form.GetWidget(30).GetComponent <CUIListScript>(); component.SetElementAmount(guildInfoCount); GameObject widget2 = this.m_form.GetWidget(36); GameObject widget3 = this.m_form.GetWidget(37); GameObject widget4 = this.m_form.GetWidget(31); if (guildInfoCount > 0) { component.SelectElement(0, true); widget2.CustomSetActive(true); widget3.CustomSetActive(true); widget4.CustomSetActive(true); } else { widget2.CustomSetActive(false); widget3.CustomSetActive(false); widget4.CustomSetActive(false); } if (isHideListExtraContent) { component.HideExtraContent(); } break; } } }
private void OnOpenMentorPage(CUIEvent uievt) { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath); if (form == null) { Singleton <CFriendContoller> .GetInstance().view.OpenForm(uievt); form = Singleton <CUIManager> .GetInstance().GetForm(CFriendContoller.FriendFormPath); } if (form == null) { return; } GameObject gameObject = form.transform.Find("TopCommon/Panel_Menu/List").gameObject; CUIListScript component = gameObject.GetComponent <CUIListScript>(); component.SelectElement(Singleton <CFriendContoller> .GetInstance().view.tabMgr.GetIndex(CFriendView.Tab.Mentor), true); uievt.m_srcFormScript.Close(); Singleton <CUIManager> .GetInstance().CloseForm(RankingSystem.s_rankingForm); }
public static void InitDifficultList(CUIFormScript form, int currentChapter, int levelNo, int difficulty) { CRoleInfo masterRoleInfo = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo(); if (masterRoleInfo == null) { return; } CUIListScript component = form.transform.FindChild("DifficultList").GetComponent <CUIListScript>(); string text = string.Empty; string prefabPath = string.Empty; int lEVEL_DIFFICULT_OPENED = CAdventureSys.LEVEL_DIFFICULT_OPENED; component.SetElementAmount(lEVEL_DIFFICULT_OPENED); for (int i = 0; i < lEVEL_DIFFICULT_OPENED; i++) { bool flag = CAdventureSys.IsDifOpen(currentChapter, i + 1); prefabPath = CAdventureView.GetDifficultIcon(i + 1); CUIListElementScript elemenet = component.GetElemenet(i); Image component2 = elemenet.transform.FindChild("DifficultImg").GetComponent <Image>(); component2.SetSprite(prefabPath, form, true, false, false, false); component2.color = ((!flag) ? CAdventureView.s_Adv_Difficulty_Gray_Color : Color.white); elemenet.transform.FindChild("SelectedFrame").GetComponent <Image>().SetSprite(prefabPath, form, true, false, false, false); text = Singleton <CTextManager> .get_instance().GetText(string.Format("Adventure_Level_{0}", i + 1)); elemenet.transform.FindChild("DifficultImg/DifficultText").GetComponent <Text>().text = text; elemenet.transform.FindChild("SelectedFrame/DifficultText").GetComponent <Text>().text = text; elemenet.GetComponent <CUIEventScript>().m_onClickEventID = enUIEventID.Adv_SelectDifficult; elemenet.GetComponent <CUIEventScript>().m_onClickEventParams.tag = i + 1; elemenet.transform.FindChild("SelectedFrame/Frame_circle").GetComponent <Image>().color = CAdventureView.s_Adv_Difficult_Circle_Color[i]; PVE_ADV_COMPLETE_INFO pVE_ADV_COMPLETE_INFO = masterRoleInfo.pveLevelDetail[i]; PVE_CHAPTER_COMPLETE_INFO pVE_CHAPTER_COMPLETE_INFO = pVE_ADV_COMPLETE_INFO.ChapterDetailList[currentChapter - 1]; int chapterTotalStar = CAdventureSys.GetChapterTotalStar(pVE_CHAPTER_COMPLETE_INFO); elemenet.transform.FindChild("SelectedFrame/RewardBox").gameObject.CustomSetActive(chapterTotalStar == CAdventureSys.LEVEL_PER_CHAPTER * CAdventureSys.STAR_PER_LEVEL && pVE_CHAPTER_COMPLETE_INFO.bIsGetBonus == 0); elemenet.transform.FindChild("Lock").gameObject.CustomSetActive(!flag); } component.SelectElement(difficulty - 1, true); }