/// <summary> /// 显示不能更新的错误提示 /// </summary> void ShowCannotUpdateFaildMessageBox() { MessageBoxData boxData = new MessageBoxData(); boxData.Title = "更新失败"; boxData.Content = "客户端更新失败,请重新下载游戏包!"; boxData.OKButtonName = "重新下载"; boxData.CancelButtonName = "退出游戏"; boxData.Style = MessageBoxStyle.OKCancel; boxData.CallBack = (result) => { switch (result) { case MessageBoxResult.OK: Application.OpenURL(string.Format("{0}?GameID={1}", AppDefine.GameUrl, AppDefine.GameID)); Application.Quit(); break; case MessageBoxResult.Cancel: default: Application.Quit(); break; } }; MessageBoxUI.Show(boxData, null); }
/// <summary> /// 显示提示框 /// </summary> /// <param name="uiData"></param> /// <param name="parent"></param> public static void Show(MessageBoxData uiData, WindowNode parent = null) { WindowNodeInitParam initParam = new WindowNodeInitParam(UIAssetName); if (uiData.LuaCallBack != null) { System.Action <MessageBoxResult> luaCallBack = (result) => { uiData.LuaCallBack((int)result); }; if (uiData.CallBack != null) { uiData.CallBack += luaCallBack; } else { uiData.CallBack = luaCallBack; } } if (parent != null) { initParam.ParentNode = parent; } else { initParam.NodeType = BaseNodeType.Propmt; } initParam.WindowData = uiData; WindowManager.Instance.OpenWindow(initParam); }
void ShowRetryUpdaterFaildMessageBox() { MessageBoxData boxData = new MessageBoxData(); boxData.Title = "错误"; boxData.Content = "更新资源错误,是否重试?"; boxData.OKButtonName = "重试"; boxData.CancelButtonName = "关闭"; boxData.Style = MessageBoxStyle.OKCancel; boxData.CallBack = (result) => { switch (result) { case MessageBoxResult.OK: if (this.m_UpdateFaildRetryTimes >= 3) { ShowCannotUpdateFaildMessageBox(); } else { m_UpdateFaildRetryTimes++; TryStartUpdateRemoteAssetsToLocal(); } break; case MessageBoxResult.Cancel: default: Application.Quit(); break; } }; MessageBoxUI.Show(boxData, null); }
public MessageBoxFactory(TES5ObjectCallFactory objectCallFactory, TES5ObjectCallArgumentsFactory objectCallArgumentsFactory, TES5ReferenceFactory referenceFactory, MetadataLogService metadataLogService) { this.objectCallArgumentsFactory = objectCallArgumentsFactory; this.referenceFactory = referenceFactory; this.metadataLogService = metadataLogService; this.objectCallFactory = objectCallFactory; this.messageBoxData = new MessageBoxData(); }
void OnFirstBtnClick() { if (currentData.BtnCallBack != null) { currentData.BtnCallBack(); } transform.DOScale(Vector3.zero, 0.2f).onComplete = () => { currentData = null; input.text = ""; input.gameObject.SetActive(false); }; }
public void Show(MessageBoxData boxData = null) { currentData = boxData; if (currentData.type == MessageBoxType.INPUT) { input.gameObject.SetActive(true); } gameObject.SetActive(true); Notice.text = currentData.notice; transform.DOScale(Vector3.one, 0.2f); }
/// <summary> /// 刷新数据 /// </summary> /// <param name="windowData"></param> public override void RefreshWindowData(object windowData) { base.RefreshWindowData(windowData); MessageBoxData uiData = windowData as MessageBoxData; if (uiData == null) { return; } currentCountDownSecond = -1; m_CountDown = uiData.LastTime; m_UseCountDown = uiData.LastTime > 0; if (m_TitleText != null) { m_TitleText.text = uiData.Title; } if (m_ContentText != null) { m_ContentText.text = uiData.Content; m_ContentText.rectTransform.sizeDelta = new Vector2(m_ContentText.rectTransform.sizeDelta.x, Mathf.Max(ContentMinHeight - 60, m_ContentText.preferredHeight)); m_ContentArea.sizeDelta = new Vector2(m_ContentArea.sizeDelta.x, Mathf.Max(ContentMinHeight, m_ContentText.preferredHeight + 60)); } if (m_CancelButtonText != null) { m_CancelButtonText.text = uiData.CancelButtonName; } m_OkButtonName = uiData.OKButtonName; if (m_OKButtonText != null) { if (m_UseCountDown) { UpdateCountDownDisplay(m_CountDown); } else { m_OKButtonText.text = m_OkButtonName; } } this.CallBack = uiData.CallBack; this.m_EnableCloseArea = uiData.EnableCloseArea; SetUIButtonActiveByStyle(uiData.Style); }
/// <summary> /// 显示提示框 /// </summary> /// <param name="uiData"></param> /// <param name="parent"></param> public static void Show(MessageBoxData uiData, WindowNode parent = null) { string UIAssetName_X = "MessageBoxUI"; Vector2 screenSize = new Vector2(Screen.width, Screen.height); if (screenSize.x == 1125 && screenSize.y == 2436) { UIAssetName_X = "MessageBoxUI_X"; } WindowNodeInitParam initParam = new WindowNodeInitParam(UIAssetName_X); if (uiData.LuaCallBack != null) { System.Action <MessageBoxResult> luaCallBack = (result) => { uiData.LuaCallBack((int)result); }; if (uiData.CallBack != null) { uiData.CallBack += luaCallBack; } else { uiData.CallBack = luaCallBack; } } if (parent != null) { initParam.ParentNode = parent; } else { initParam.NodeType = BaseNodeType.Propmt; } initParam.WindowData = uiData; WindowManager.Instance.OpenWindow(initParam); }
public void AddMessageBox(MessageBoxData messageBoxData) { MessageBoxes.Add(messageBoxData); logger.Debug($"Added new entry to {nameof(MessageBoxes)}: {messageBoxData.ToStringTabbed()}"); }
public void ShowMessageBox(MessageBoxData data) { mb.Show(data); }