public void OnTextComboEnable(CUIEvent evt) { if (evt == null || evt.m_srcWidgetBelongedListScript == null) { return; } if (evt.m_srcWidget == null) { return; } CUIListScript srcWidgetBelongedListScript = evt.m_srcWidgetBelongedListScript; string[] array = null; if (CUIUtility.s_textComboBoxContent.TryGetValue(srcWidgetBelongedListScript, ref array)) { Transform transform = evt.m_srcWidget.transform.FindChild("Text"); if (transform == null) { return; } Text component = transform.gameObject.GetComponent <Text>(); if (component != null) { int srcWidgetIndexInBelongedList = evt.m_srcWidgetIndexInBelongedList; if (srcWidgetIndexInBelongedList >= 0 && srcWidgetIndexInBelongedList < array.Length) { component.set_text(array[evt.m_srcWidgetIndexInBelongedList]); } } } }
public void OnTextComboTriggerBtnClick(CUIEvent evt) { if (evt == null || evt.m_srcWidget == null) { return; } CUIListScript cUIListScript = null; if (CUIUtility.s_textComboBoxBtnListMap.TryGetValue(evt.m_srcWidget, ref cUIListScript)) { bool flag = !cUIListScript.gameObject.activeSelf; if (flag) { using (Dictionary <CUIListScript, string[]> .KeyCollection.Enumerator enumerator = CUIUtility.s_textComboBoxContent.get_Keys().GetEnumerator()) { while (enumerator.MoveNext()) { CUIListScript current = enumerator.get_Current(); current.gameObject.CustomSetActive(false); } } if (cUIListScript.m_comboClickPanel != null) { cUIListScript.m_comboClickPanel.CustomSetActive(true); } } cUIListScript.gameObject.CustomSetActive(flag); } }
public void Clear() { this.m_srcFormScript = null; this.m_srcWidget = null; this.m_srcWidgetScript = null; this.m_srcWidgetBelongedListScript = null; this.m_srcWidgetIndexInBelongedList = -1; this.m_pointerEventData = null; this.m_eventID = enUIEventID.None; this.m_inUse = false; }
public void OnTexeComboCloseCombos(CUIEvent evt) { using (Dictionary <CUIListScript, string[]> .KeyCollection.Enumerator enumerator = CUIUtility.s_textComboBoxContent.get_Keys().GetEnumerator()) { while (enumerator.MoveNext()) { CUIListScript current = enumerator.get_Current(); current.gameObject.CustomSetActive(false); } } evt.m_srcWidget.CustomSetActive(false); }
public static void RegisterTextComboboxContent(GameObject triggerBtn, CUIListScript list, string[] content, CUIUtility.TextComboClickCallback clickcallback = null) { CUIUtility.s_textComboBoxContent.set_Item(list, content); list.SetElementAmount(content.Length); if (content.Length > 0) { list.SelectElement(0, true); } CUIUtility.s_textComboBoxBtnListMap.set_Item(triggerBtn, list); if (clickcallback != null) { CUIUtility.s_textComboBoxClickCallbackMap.set_Item(list, clickcallback); } }
public void Enable(CUIListScript belongedList, int index, string name, ref stRect rect, bool selected) { base.m_belongedListScript = belongedList; this.m_index = index; base.gameObject.name = name + "_" + index.ToString(); if (this.m_useSetActiveForDisplay) { base.gameObject.CustomSetActive(true); } else { this.m_canvasGroup.alpha = 1f; this.m_canvasGroup.blocksRaycasts = true; } this.SetComponentBelongedList(base.gameObject); this.SetRect(ref rect); this.ChangeDisplay(selected); this.DispatchOnEnableEvent(); }
public static void TextComboDealListChosen(CUIEvent evt) { if (evt == null || evt.m_srcWidget == null) { return; } CUIListScript component = evt.m_srcWidget.GetComponent <CUIListScript>(); if (component == null) { return; } string[] array = null; if (CUIUtility.s_textComboBoxContent.TryGetValue(component, ref array)) { int selectedIndex = component.GetSelectedIndex(); if (selectedIndex >= 0 && selectedIndex < array.Length) { Transform transform = component.gameObject.transform.parent.FindChild("Button_Down"); if (transform != null) { Transform transform2 = transform.FindChild("Text"); if (transform2 != null) { Text component2 = transform2.gameObject.GetComponent <Text>(); component2.set_text(array[selectedIndex]); } } } component.gameObject.CustomSetActive(false); } CUIUtility.TextComboClickCallback textComboClickCallback = null; if (CUIUtility.s_textComboBoxClickCallbackMap.TryGetValue(component, ref textComboClickCallback) && textComboClickCallback != null) { textComboClickCallback(evt); } }
public void OpenAwardTip(CUseable[] items, string title = null, bool playSound = false, enUIEventID eventID = 0, bool displayAll = false, bool forceNotGoToBag = false, string formPath = "Form_Award") { if (items != null) { int b = 10; int amount = Mathf.Min(items.Length, b); CUIFormScript formScript = Singleton <CUIManager> .GetInstance().OpenForm("UGUI/Form/Common/" + formPath, false, true); if (formScript != null) { formScript.transform.FindChild("btnGroup/Button_Back").GetComponent <CUIEventScript>().m_onClickEventID = eventID; if (title != null) { Utility.GetComponetInChild <Text>(formScript.gameObject, "bg/Title").text = title; } CUIListScript component = formScript.transform.FindChild("IconContainer").gameObject.GetComponent <CUIListScript>(); component.SetElementAmount(amount); for (int i = 0; i < amount; i++) { if ((component.GetElemenet(i) != null) && (items[i] != null)) { GameObject gameObject = component.GetElemenet(i).gameObject; CUICommonSystem.SetItemCell(formScript, gameObject, items[i], true, displayAll); gameObject.CustomSetActive(true); gameObject.transform.FindChild("ItemName").GetComponent <Text>().text = items[i].m_name; if (playSound) { COM_REWARDS_TYPE mapRewardType = items[i].MapRewardType; if (mapRewardType != COM_REWARDS_TYPE.COM_REWARDS_TYPE_COIN) { if (mapRewardType == COM_REWARDS_TYPE.COM_REWARDS_TYPE_AP) { goto Label_0162; } if (mapRewardType == COM_REWARDS_TYPE.COM_REWARDS_TYPE_DIAMOND) { goto Label_014C; } } else { Singleton <CSoundManager> .GetInstance().PostEvent("UI_hall_add_coin", null); } } } continue; Label_014C: Singleton <CSoundManager> .GetInstance().PostEvent("UI_hall_add_diamond", null); continue; Label_0162: Singleton <CSoundManager> .GetInstance().PostEvent("UI_hall_add_physical_power", null); } CUIEventScript script3 = formScript.transform.Find("btnGroup/Button_Use").GetComponent <CUIEventScript>(); script3.gameObject.CustomSetActive(false); if ((!forceNotGoToBag && (amount == 1)) && (items[0].m_type == COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP)) { CItem item = items[0] as CItem; if (((item.m_itemData.bType == 4) || (item.m_itemData.bType == 1)) || (item.m_itemData.bType == 11)) { CUseable useableByBaseID = Singleton <CRoleInfoManager> .GetInstance().GetMasterRoleInfo().GetUseableContainer(enCONTAINER_TYPE.ITEM).GetUseableByBaseID(COM_ITEM_TYPE.COM_OBJTYPE_ITEMPROP, item.m_baseID); if (useableByBaseID != null) { script3.gameObject.CustomSetActive(true); script3.m_onClickEventParams.iconUseable = useableByBaseID; script3.m_onClickEventParams.tag = Mathf.Min(item.m_stackCount, useableByBaseID.m_stackCount); } } } } } }
public void SetBelongedList(CUIListScript belongedListScript, int index) { this.m_belongedListScript = belongedListScript; this.m_indexInlist = index; }
protected virtual void OnDestroy() { this.m_belongedFormScript = null; this.m_belongedListScript = null; this.m_widgets = null; }