public void SetTimerEventId(enTimerEventType eventType, enUIEventID eventId) { if (eventType >= enTimerEventType.TimeStart && eventType < (enTimerEventType)this.m_eventIDs.Length) { this.m_eventIDs[(int)eventType] = eventId; } }
public void DispatchUIEvent(enUIEventID eventID) { UIEvent uiEvent = GetUIEvent(); uiEvent.eventID = eventID; DispatchUIEvent(uiEvent); }
public static void TryToValidate(enOpPurpose purpose, enUIEventID confirmEventID, stUIEventParams confirmEventParams = default(stUIEventParams)) { CSecurePwdSystem instance = Singleton <CSecurePwdSystem> .GetInstance(); if (instance.EnableStatus == PwdStatus.Enable) { CUIFormScript cUIFormScript = Singleton <CUIManager> .GetInstance().OpenForm(CSecurePwdSystem.sValidatePwdFormPath, false, true); if (cUIFormScript == null) { return; } Transform transform = cUIFormScript.transform.Find("pnlBg/Panel_Main/BtnConfirm"); Transform transform2 = cUIFormScript.transform.Find("pnlBg/Panel_Main/BtnCancel"); if (transform == null || transform2 == null) { return; } CUIEventScript component = transform.GetComponent <CUIEventScript>(); CUIEventScript component2 = transform2.GetComponent <CUIEventScript>(); if (component == null || component2 == null) { return; } confirmEventParams.srcUIEventID = confirmEventID; component.SetUIEvent(enUIEventType.Up, enUIEventID.SecurePwd_OnValidateConfirm, confirmEventParams); } else { confirmEventParams.srcUIEventID = confirmEventID; string text = Singleton <CTextManager> .GetInstance().GetText(CSecurePwdSystem.s_OpRiskNameKeys[(int)purpose]); Singleton <CUIManager> .GetInstance().OpenMessageBoxWithCancel(text, enUIEventID.SecurePwd_OnValidateConfirm, enUIEventID.SecurePwd_OpenSetPwdForm, confirmEventParams, "暂时不用", "前往设置", true); } }
public void OpenSmallMessageBox(string strContent, bool isHaveCancelBtn, enUIEventID confirmID, enUIEventID cancelID, stUIEventParams par, int autoCloseTime = 0, enUIEventID closeTimeID = 0, string confirmStr = "", string cancelStr = "", bool isContentLeftAlign = false) { CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm("UGUI/Form/Common/Form_SmallMessageBox.prefab", false, false); if (script != null) { GameObject gameObject = script.gameObject; if (gameObject != null) { if (string.IsNullOrEmpty(confirmStr)) { confirmStr = Singleton <CTextManager> .GetInstance().GetText("Common_Confirm"); } if (string.IsNullOrEmpty(cancelStr)) { cancelStr = Singleton <CTextManager> .GetInstance().GetText("Common_Cancel"); } GameObject obj3 = gameObject.transform.Find("Panel/Panel/btnGroup/Button_Confirm").gameObject; obj3.GetComponentInChildren <Text>().text = confirmStr; GameObject obj4 = gameObject.transform.Find("Panel/Panel/btnGroup/Button_Cancel").gameObject; obj4.GetComponentInChildren <Text>().text = cancelStr; Text component = gameObject.transform.Find("Panel/Panel/Text").GetComponent <Text>(); component.text = strContent; if (!isHaveCancelBtn) { obj4.CustomSetActive(false); } else { obj4.CustomSetActive(true); } CUIEventScript script2 = obj3.GetComponent <CUIEventScript>(); CUIEventScript script3 = obj4.GetComponent <CUIEventScript>(); script2.SetUIEvent(enUIEventType.Click, confirmID, par); script3.SetUIEvent(enUIEventType.Click, cancelID, par); if (isContentLeftAlign) { component.alignment = TextAnchor.MiddleLeft; } if (autoCloseTime != 0) { Transform transform = script.transform.Find("closeTimer"); if (transform != null) { CUITimerScript script4 = transform.GetComponent <CUITimerScript>(); if (script4 != null) { if (closeTimeID > enUIEventID.None) { script4.m_eventIDs[1] = closeTimeID; } script4.SetTotalTime((float)autoCloseTime); script4.StartTimer(); } } } this.CloseSendMsgAlert(); } } }
public void DispatchUIEvent(enUIEventID eventID) { CUIEvent uIEvent = this.GetUIEvent(); uIEvent.m_eventID = eventID; this.DispatchUIEvent(uIEvent); }
public void DispatchUIEvent(enUIEventID eventID, stUIEventParams par) { UIEvent uiEvent = GetUIEvent(); uiEvent.eventID = eventID; uiEvent.eventParams = par; DispatchUIEvent(uiEvent); }
public void DispatchUIEvent(enUIEventID eventID, stUIEventParams par) { CUIEvent uIEvent = this.GetUIEvent(); uIEvent.m_eventID = eventID; uIEvent.m_eventParams = par; this.DispatchUIEvent(uIEvent); }
public void RemoveUIEventListener(enUIEventID eventID, CUIEventManager.OnUIEventHandler onUIEventHandler) { if (this.m_uiEventHandlerMap[(int)((UIntPtr)eventID)] != null) { CUIEventManager.OnUIEventHandler[] expr_1B_cp_0 = this.m_uiEventHandlerMap; UIntPtr expr_1B_cp_1 = (UIntPtr)eventID; expr_1B_cp_0[(int)expr_1B_cp_1] = (CUIEventManager.OnUIEventHandler)Delegate.Remove(expr_1B_cp_0[(int)expr_1B_cp_1], onUIEventHandler); } }
public void RemoveUIEventListener(enUIEventID eventID, CUIEventManager.OnUIEventHandler onUIEventHandler) { if (this.m_uiEventHandlerMap[(int)((uint)((UIntPtr)((ulong)((long)eventID))))] != null) { CUIEventManager.OnUIEventHandler[] uiEventHandlerMap = this.m_uiEventHandlerMap; UIntPtr uIntPtr = (UIntPtr)((ulong)((long)eventID)); uiEventHandlerMap[(int)((uint)uIntPtr)] = (CUIEventManager.OnUIEventHandler)Delegate.Remove(uiEventHandlerMap[(int)((uint)uIntPtr)], onUIEventHandler); } }
public void SetTimerEventId(enTimerEventType eventType, enUIEventID eventId) { int index = (int)eventType; if ((index >= 0) && (index < this.m_eventIDs.Length)) { this.m_eventIDs[index] = eventId; } }
public void RemoveUIEventListener(enUIEventID eventID, UIEventManager.OnUIEventHandler onUIEventHandler) { if (m_uiEventHandlerMap[(int)((UIntPtr)eventID)] != null) { UIEventManager.OnUIEventHandler[] onUIEventHandlerMap = m_uiEventHandlerMap; UIntPtr ptr = (UIntPtr)eventID; onUIEventHandlerMap[(int)ptr] = (UIEventManager.OnUIEventHandler)Delegate.Remove(onUIEventHandlerMap[(int)ptr], onUIEventHandler); } }
public void SetUIEvent(enUIEventType eventType, enUIEventID eventID, stUIEventParams eventParams) { switch (eventType) { case enUIEventType.Down: this.m_onDownEventID = eventID; this.m_onDownEventParams = eventParams; break; case enUIEventType.Click: this.m_onClickEventID = eventID; this.m_onClickEventParams = eventParams; break; case enUIEventType.HoldStart: this.m_onHoldStartEventID = eventID; this.m_onHoldStartEventParams = eventParams; break; case enUIEventType.Hold: this.m_onHoldEventID = eventID; this.m_onHoldEventParams = eventParams; break; case enUIEventType.HoldEnd: this.m_onHoldEndEventID = eventID; this.m_onHoldEndEventParams = eventParams; break; case enUIEventType.DragStart: this.m_onDragStartEventID = eventID; this.m_onDragStartEventParams = eventParams; break; case enUIEventType.Drag: this.m_onDragEventID = eventID; this.m_onDragEventParams = eventParams; break; case enUIEventType.DragEnd: this.m_onDragEndEventID = eventID; this.m_onDragEndEventParams = eventParams; break; case enUIEventType.Drop: this.m_onDropEventID = eventID; this.m_onDropEventParams = eventParams; break; case enUIEventType.Up: this.m_onUpEventID = eventID; this.m_onUpEventParams = eventParams; break; } }
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; }
private static void GetActionBtnNameAndDesc(enUIEventID uiEventID, out string btnName, out string btnDesc) { btnName = null; btnDesc = null; if (uiEventID == enUIEventID.Guild_JoinPlatformGroup) { btnName = Singleton <CTextManager> .GetInstance().GetText("Guild_Platform_Remind_Join_Chat_Btn_Text"); btnDesc = Singleton <CTextManager> .GetInstance().GetText("Guild_Platform_Remind_Join_Chat_Text"); } }
public void Clear() { srcFormScript = null; srcWidget = null; srcWidgetScript = null; srcWidgetBelongedListScript = null; SrcWidgetIndexInBelongedList = -1; pointerEventData = null; eventID = enUIEventID.None; inUse = false; }
public void OpenSendMsgAlert(int autoCloseTime = 5, enUIEventID timeUpEventId = enUIEventID.None) { UIEvent uiEvent = new UIEvent(); uiEvent.eventID = enUIEventID.Common_SendMsgAlertOpen; uiEvent.eventParams = new stUIEventParams { tag = autoCloseTime, tag2 = (int)timeUpEventId }; Singleton <UIEventManager> .GetInstance().DispatchUIEvent(uiEvent); }
public void OpenSendMsgAlert(int autoCloseTime = 5, enUIEventID timeUpEventId = 0) { CUIEvent uiEvent = new CUIEvent { m_eventID = enUIEventID.Common_SendMsgAlertOpen }; stUIEventParams @params = new stUIEventParams { tag = autoCloseTime, tag2 = (int)timeUpEventId }; uiEvent.m_eventParams = @params; Singleton <CUIEventManager> .GetInstance().DispatchUIEvent(uiEvent); }
public void SetUIEvent(enUIEventType eventType, enUIEventID eventID) { switch (eventType) { case enUIEventType.Down: this.m_onDownEventID = eventID; break; case enUIEventType.Click: this.m_onClickEventID = eventID; break; case enUIEventType.Up: this.m_onUpEventID = eventID; break; } }
public void OpenEditForm(string title, string editContent, enUIEventID confirmEventId = 0) { CUIFormScript script = this.OpenForm("UGUI/Form/Common/Form_Edit.prefab", false, true); DebugHelper.Assert(script != null, "CUIManager.OpenEditForm(): form == null!!!"); if (script != null) { if (title != null) { script.GetWidget(0).GetComponent <Text>().text = title; } if (editContent != null) { script.GetWidget(1).GetComponent <Text>().text = editContent; } script.GetWidget(2).GetComponent <CUIEventScript>().SetUIEvent(enUIEventType.Click, confirmEventId); } }
public void SetUIEvent(enUIEventType eventType, enUIEventID eventID) { if (eventType != enUIEventType.Down) { if (eventType != enUIEventType.Click) { if (eventType == enUIEventType.Up) { this.m_onUpEventID = eventID; } } else { this.m_onClickEventID = eventID; } } else { this.m_onDownEventID = eventID; } }
public void AddUIEventListener(enUIEventID eventID, CUIEventManager.OnUIEventHandler onUIEventHandler) { if (this.m_uiEventHandlerMap[(int)((uint)((UIntPtr)((ulong)((long)eventID))))] == null) { this.m_uiEventHandlerMap[(int)((uint)((UIntPtr)((ulong)((long)eventID))))] = delegate { }; CUIEventManager.OnUIEventHandler[] uiEventHandlerMap = this.m_uiEventHandlerMap; UIntPtr uIntPtr = (UIntPtr)((ulong)((long)eventID)); uiEventHandlerMap[(int)((uint)uIntPtr)] = (CUIEventManager.OnUIEventHandler)Delegate.Combine(uiEventHandlerMap[(int)((uint)uIntPtr)], onUIEventHandler); } else { CUIEventManager.OnUIEventHandler[] uiEventHandlerMap2 = this.m_uiEventHandlerMap; UIntPtr uIntPtr2 = (UIntPtr)((ulong)((long)eventID)); uiEventHandlerMap2[(int)((uint)uIntPtr2)] = (CUIEventManager.OnUIEventHandler)Delegate.Remove(uiEventHandlerMap2[(int)((uint)uIntPtr2)], onUIEventHandler); CUIEventManager.OnUIEventHandler[] uiEventHandlerMap3 = this.m_uiEventHandlerMap; UIntPtr uIntPtr3 = (UIntPtr)((ulong)((long)eventID)); uiEventHandlerMap3[(int)((uint)uIntPtr3)] = (CUIEventManager.OnUIEventHandler)Delegate.Combine(uiEventHandlerMap3[(int)((uint)uIntPtr3)], onUIEventHandler); } }
public void AddUIEventListener(enUIEventID eventID, CUIEventManager.OnUIEventHandler onUIEventHandler) { if (this.m_uiEventHandlerMap[(int)((UIntPtr)eventID)] == null) { this.m_uiEventHandlerMap[(int)((UIntPtr)eventID)] = delegate { }; CUIEventManager.OnUIEventHandler[] expr_41_cp_0 = this.m_uiEventHandlerMap; UIntPtr expr_41_cp_1 = (UIntPtr)eventID; expr_41_cp_0[(int)expr_41_cp_1] = (CUIEventManager.OnUIEventHandler)Delegate.Combine(expr_41_cp_0[(int)expr_41_cp_1], onUIEventHandler); } else { CUIEventManager.OnUIEventHandler[] expr_61_cp_0 = this.m_uiEventHandlerMap; UIntPtr expr_61_cp_1 = (UIntPtr)eventID; expr_61_cp_0[(int)expr_61_cp_1] = (CUIEventManager.OnUIEventHandler)Delegate.Remove(expr_61_cp_0[(int)expr_61_cp_1], onUIEventHandler); CUIEventManager.OnUIEventHandler[] expr_7C_cp_0 = this.m_uiEventHandlerMap; UIntPtr expr_7C_cp_1 = (UIntPtr)eventID; expr_7C_cp_0[(int)expr_7C_cp_1] = (CUIEventManager.OnUIEventHandler)Delegate.Combine(expr_7C_cp_0[(int)expr_7C_cp_1], onUIEventHandler); } }
public void AddUIEventListener(enUIEventID eventID, UIEventManager.OnUIEventHandler onUIEventHandler) { if (m_uiEventHandlerMap[(int)((UIntPtr)eventID)] == null) { m_uiEventHandlerMap[(int)((UIntPtr)eventID)] = delegate { }; UIEventManager.OnUIEventHandler[] onUIEventHandlerMap = m_uiEventHandlerMap; UIntPtr intPtr = (UIntPtr)eventID; onUIEventHandlerMap[(int)intPtr] = (UIEventManager.OnUIEventHandler)Delegate.Combine(onUIEventHandlerMap[(int)intPtr], onUIEventHandler); } else { UIEventManager.OnUIEventHandler[] onUIEventHandlerMap1 = m_uiEventHandlerMap; UIntPtr intPtr1 = (UIntPtr)eventID; onUIEventHandlerMap1[(int)intPtr1] = (UIEventManager.OnUIEventHandler)Delegate.Remove(onUIEventHandlerMap1[(int)intPtr1], onUIEventHandler); UIEventManager.OnUIEventHandler[] onUIEventHandlerMap2 = m_uiEventHandlerMap; UIntPtr intPtr2 = (UIntPtr)eventID; onUIEventHandlerMap2[(int)intPtr2] = (UIEventManager.OnUIEventHandler)Delegate.Combine(onUIEventHandlerMap2[(int)intPtr2], onUIEventHandler); } }
private void OpenInputBoxBase(string title, string inputTip, enUIEventID confirmID, enUIEventID cancelID, stUIEventParams par, string confirmStr = "确定", string cancelStr = "取消") { CUIFormScript script = Singleton <CUIManager> .GetInstance().OpenForm("UGUI/Form/Common/Form_InputBox.prefab", false, false); GameObject gameObject = null; if (script != null) { gameObject = script.gameObject; } if (gameObject != null) { GameObject obj3 = gameObject.transform.Find("Panel/btnGroup/Button_Confirm").gameObject; obj3.GetComponentInChildren <Text>().text = confirmStr; GameObject obj4 = gameObject.transform.Find("Panel/btnGroup/Button_Cancel").gameObject; obj4.GetComponentInChildren <Text>().text = cancelStr; gameObject.transform.Find("Panel/title/Text").GetComponent <Text>().text = title; gameObject.transform.Find("Panel/inputText/Placeholder").GetComponent <Text>().text = inputTip; CUIEventScript component = obj3.GetComponent <CUIEventScript>(); CUIEventScript script3 = obj4.GetComponent <CUIEventScript>(); component.SetUIEvent(enUIEventType.Click, confirmID, par); script3.SetUIEvent(enUIEventType.Click, cancelID, par); } }
public void SetUIEvent(enUIEventType eventType, enUIEventID eventID, stUIEventParams eventParams) { if (eventType != enUIEventType.Down) { if (eventType != enUIEventType.Click) { if (eventType == enUIEventType.Up) { onUpEventID = eventID; onUpEventParams = eventParams; } } else { onClickEventID = eventID; onClickEventParams = eventParams; } } else { onDownEventID = eventID; onDownEventParams = eventParams; } }
public void SetElementSelectChangedEvent(enUIEventID eventID, stUIEventParams eventParams) { listSelectChangedEventID = eventID; listSelectChangedEventParams = eventParams; }
public void SetElementSelectChangedEvent(enUIEventID eventID) { listSelectChangedEventID = eventID; }
private void OpenMessageBoxBase(string strContent, bool isHaveCancelBtn, enUIEventID confirmID, enUIEventID cancelID, stUIEventParams par, bool isContentLeftAlign = false, string confirmStr = "", string cancelStr = "", string titleStr = "", int autoCloseTime = 0, enUIEventID timeUpID = enUIEventID.None) { UIFormScript uiFormScript = Singleton <UIManager> .GetInstance().OpenForm("UGUI/Form/Common/Form_MessageBox.prefab", false, false); if (uiFormScript == null) { return; } GameObject gameObject = uiFormScript.gameObject; if (gameObject == null) { return; } if (confirmStr == string.Empty) { confirmStr = Singleton <TextManager> .GetInstance().GetText("Common_Confirm"); } if (cancelStr == string.Empty) { cancelStr = Singleton <TextManager> .GetInstance().GetText("Common_Cancel"); } if (titleStr == string.Empty) { titleStr = Singleton <TextManager> .GetInstance().GetText("Common_MsgBox_Title"); } GameObject obj3 = gameObject.transform.Find("Panel/Panel/btnGroup/Button_Confirm").gameObject; obj3.GetComponentInChildren <Text>().text = confirmStr; GameObject obj4 = gameObject.transform.Find("Panel/Panel/btnGroup/Button_Cancel").gameObject; obj4.GetComponentInChildren <Text>().text = cancelStr; gameObject.transform.Find("Panel/Panel/title/Text").gameObject.GetComponentInChildren <Text>().text = titleStr; Text component = gameObject.transform.Find("Panel/Panel/Text").GetComponent <Text>(); component.text = strContent; if (!isHaveCancelBtn) { obj4.SetActive(false); } else { obj4.SetActive(true); } UIEventScript script2 = obj3.GetComponent <UIEventScript>(); UIEventScript script3 = obj4.GetComponent <UIEventScript>(); script2.SetUIEvent(enUIEventType.Click, confirmID, par); script3.SetUIEvent(enUIEventType.Click, cancelID, par); if (isContentLeftAlign) { component.alignment = TextAnchor.MiddleLeft; } if (autoCloseTime != 0) { Transform transform = uiFormScript.transform.Find("closeTimer"); if (transform != null) { UITimerScript script4 = transform.GetComponent <UITimerScript>(); if (script4 != null) { script4.SetTotalTime((float)autoCloseTime); script4.StartTimer(); script4.eventIDs[1] = timeUpID; script4.eventParamsArry[1] = par; } } } CloseSendMsgAlert(); }
public void OpenMessageBoxWithCancelAndAutoClose(string strContent, enUIEventID confirmID, enUIEventID cancelID, stUIEventParams par, bool isContentLeftAlign = false, int autoCloseTime = 0, enUIEventID timeUpID = enUIEventID.None) { OpenMessageBoxBase(strContent, true, confirmID, cancelID, par, isContentLeftAlign, string.Empty, string.Empty, string.Empty, autoCloseTime, timeUpID); }
public void OpenMessageBoxWithCancel(string strContent, enUIEventID confirmID, enUIEventID cancelID, stUIEventParams param, string confirmStr, string cancelStr, bool isContentLeftAlign = false) { OpenMessageBoxBase(strContent, true, confirmID, cancelID, param, isContentLeftAlign, confirmStr, cancelStr, string.Empty, 0, enUIEventID.None); }