public GameObject GetGuideItem() { CUIFormScript form = Singleton <CUIManager> .GetInstance().GetForm(s_bagFormPath); if (form == null) { return(null); } CUseableContainer selectUseableContainer = this.m_selectUseableContainer; for (int i = 0; i < selectUseableContainer.GetCurUseableCount(); i++) { CUseable useableByIndex = selectUseableContainer.GetUseableByIndex(i); if (useableByIndex.m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP) { CItem item = useableByIndex as CItem; if ((item.m_itemData.bClass == 1) && (item.m_itemData.bType == 1)) { CUIListScript component = form.gameObject.transform.Find("Panel_Right/List").gameObject.GetComponent <CUIListScript>(); if (component.GetElementAmount() > i) { return(component.GetElemenet(i).gameObject.transform.Find("itemCell").gameObject); } } } } return(null); }
private void SetTeamFightDisplay(CUIListScript list, List <HeroKDA> kdaContaienr, int[] result, int totalResult, bool isBlue) { list.SetElementAmount(kdaContaienr.get_Count()); int[] array = CBattleStatCompetitionSystem.BubbleSort(result); for (int i = 0; i < list.GetElementAmount(); i++) { int num = array[i]; CUIListElementScript elemenet = list.GetElemenet(i); this.SetHead(elemenet, kdaContaienr.get_Item(num)); elemenet.transform.FindChild("Num").GetComponent <Text>().set_text(result[num].ToString()); GameObject gameObject = elemenet.transform.FindChild("Bar/BarFill").gameObject; GameObject gameObject2 = elemenet.transform.FindChild("Bar/BarFillRed").gameObject; gameObject.CustomSetActive(isBlue); gameObject2.CustomSetActive(!isBlue); Image component = gameObject.GetComponent <Image>(); if (!isBlue) { component = gameObject2.GetComponent <Image>(); } float num2 = 0f; if (totalResult != 0) { num2 = (float)result[num] / (float)totalResult; } component.set_fillAmount(num2); elemenet.transform.FindChild("Bar/FillText").GetComponent <Text>().set_text((int)(num2 * 100f) + "%"); } }
private void AutoMoveBannerImage() { if (this.m_UIListScript) { CUIListScript uIListScript = this.m_UIListScript; if (uIListScript) { int elementAmount = uIListScript.GetElementAmount(); if (this.m_CurIdxImagePage < 0) { this.m_CurIdxImagePage = 0; this.m_fAdd = 1; } this.m_CurIdxImagePage += this.m_fAdd; if (this.m_CurIdxImagePage >= elementAmount) { this.m_CurIdxImagePage = elementAmount - 1; } if (this.m_CurIdxImagePage == elementAmount - 1) { this.m_fAdd = -1; } if (this.m_CurIdxImagePage < 0) { this.m_CurIdxImagePage = 0; } if (this.m_CurIdxImagePage == 0) { this.m_fAdd = 1; } } uIListScript.MoveElementInScrollArea(this.m_CurIdxImagePage, false); this.EnablePickObj(this.m_CurIdxImagePage); } }
public static void InitListTab(CUIFormScript form) { CUIListScript component = form.GetWidget(7).GetComponent <CUIListScript>(); int amount = !Singleton <CGuildSystem> .GetInstance().IsInNormalGuild() ? 1 : 2; component.SetElementAmount(amount); for (int i = 0; i < component.GetElementAmount(); i++) { component.GetElemenet(i).transform.Find("txtName").GetComponent <Text>().text = TabName[i]; } component.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 static void UpdateGodFindBtns(CUIListScript uiList, int index) { if (uiList != null) { int elementAmount = uiList.GetElementAmount(); for (int i = 0; i < elementAmount; i++) { if (((uiList.GetElemenet(i) != null) && (uiList.GetElemenet(i).gameObject != null)) && uiList.IsElementInScrollArea(i)) { Utility.FindChild(uiList.GetElemenet(i).gameObject, "FindBtn/Select").CustomSetActive(index == i); } } } }
private void On_Guild_Request_More_Guild_List(CUIEvent uiEvent) { CUIFormScript srcFormScript = uiEvent.m_srcFormScript; if (srcFormScript == null) { return; } CUIListScript component = srcFormScript.GetWidget(30).GetComponent <CUIListScript>(); int elementAmount = component.GetElementAmount(); if (elementAmount > 0) { Singleton <EventRouter> .GetInstance().BroadCastEvent <int, int>("Request_Guild_List", elementAmount + 1, 20); } }
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); } } }
private void On_Guild_Requesst_More_Prepare_Guild_List(CUIEvent uiEvent) { CUIFormScript srcFormScript = uiEvent.m_srcFormScript; if (srcFormScript == null) { return; } CUIListScript component = srcFormScript.GetWidget(27).GetComponent <CUIListScript>(); int elementAmount = component.GetElementAmount(); if (elementAmount > 0) { Text component2 = srcFormScript.GetWidget(38).GetComponent <Text>(); int num = int.Parse(component2.text) + 1; Singleton <EventRouter> .GetInstance().BroadCastEvent <int>("Request_PrepareGuild_List", num); } }
private void OnClickRank(CUIEvent uiEvt) { CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CUnionBattleRankSystem.UNION_RANK_PATH, false, true); if (cUIFormScript == null) { return; } this.Clear(); this.initWidget(); CUIListScript component = cUIFormScript.GetWidget(2).GetComponent <CUIListScript>(); if (component && component.GetElementAmount() > 0) { component.SelectElement(0, true); CUIEventScript component2 = component.GetElemenet(0).GetComponent <CUIEventScript>(); Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(component2.m_onClickEventID, component2.m_onClickEventParams); } }
private void OnBttleMatchInfoTabChange(CUIEvent uiEvent) { CUIListScript component = uiEvent.m_srcWidget.GetComponent <CUIListScript>(); if (component == null) { return; } int selectedIndex = component.GetSelectedIndex(); if (selectedIndex < 0 || selectedIndex >= component.GetElementAmount()) { return; } this._defaultSelectIndex = selectedIndex; CUIFormScript statViewFormScript = this.m_statViewFormScript; if (statViewFormScript == null) { return; } if (statViewFormScript != null) { if (this.heroView == null && this.matchInfo == null && this.valueInfo == null) { return; } this.SortHeroAndPlayer(); if (this._defaultSelectIndex == 0) { this.heroView.CustomSetActive(true); this.matchInfo.CustomSetActive(true); this.valueInfo.CustomSetActive(false); this.sortByCoinBtn.CustomSetActive(true); this.UpdateKDAView(); if (this.chartView != null) { this.chartView.Hide(); } } else if (this._defaultSelectIndex == 1) { this.heroView.CustomSetActive(true); this.matchInfo.CustomSetActive(false); this.valueInfo.CustomSetActive(true); this.sortByCoinBtn.CustomSetActive(true); this.m_battleHeroPropertyChange = true; this.UpdateBattleState(null); if (this.chartView != null) { this.chartView.Hide(); } } else { this.heroView.CustomSetActive(false); this.matchInfo.CustomSetActive(false); this.valueInfo.CustomSetActive(false); this.sortByCoinBtn.CustomSetActive(false); this.m_battleHeroPropertyChange = false; WatchForm watchForm = Singleton <CBattleSystem> .GetInstance().WatchForm; if (watchForm != null && this.chartView != null) { this.chartView.Show((this._defaultSelectIndex != 2) ? BattleStatView.ChartView.ChartType.MoneyTrend : BattleStatView.ChartView.ChartType.ExpTrend, (this._defaultSelectIndex != 2) ? watchForm.moneySample : watchForm.expSample, Singleton <CUIManager> .GetInstance().GetForm(BattleStatView.s_battleStateViewUIForm)); } } } }