protected override void init() { base.init(); Handler.AddBtnClick((int)idx.BtnL, _onBtnClick); Handler.AddBtnClick((int)idx.BtnM, _onBtnClick); Handler.AddBtnClick((int)idx.BtnR, _onBtnClick); mInfo = MsgBoxMgr.Instance.MsgInfo; if (null == mInfo || null == Handler) { Close(); return; } Handler.SetTextString((int)idx.Title, mInfo.Title); Handler.SetTextString((int)idx.Msg, mInfo.Msg); Handler.SetUIActive((int)idx.BtnL, !string.IsNullOrEmpty(mInfo.BtnTxtL)); Handler.SetTextString((int)idx.BtnTxtL, mInfo.BtnTxtL); Handler.SetUIActive((int)idx.BtnM, !string.IsNullOrEmpty(mInfo.BtnTxtM)); Handler.SetTextString((int)idx.BtnTxtM, mInfo.BtnTxtM); Handler.SetUIActive((int)idx.BtnR, !string.IsNullOrEmpty(mInfo.BtnTxtR)); Handler.SetTextString((int)idx.BtnTxtR, mInfo.BtnTxtR); }
public void ShowMsg(LuaTable table) { var info = new MsgBoxInfo(table); mStack.Push(info); _showMsg(); }
void _showDownloadErrMsg() { var info = new MsgBoxInfo() { Title = LM.GetStr("提示"), BtnTxtM = LM.GetStr("确定"), Msg = LM.GetStr("资源下载失败,请检查网络"), ClickCallback = _onDownlaodErrMsgBox, }; MsgBoxMgr.Instance.ShowMsg(info); }
void _showDownloadMsg(long size) { var info = new MsgBoxInfo() { Title = LM.GetStr("提示"), BtnTxtM = LM.GetStr("确定"), Msg = LM.GetStr("检测到更新资源,共计<color=blue>{0}</color>,推荐使用Wifi下载。", Tools.FormatMeroySize(size)), ClickCallback = _onDownloadMsgBox, }; MsgBoxMgr.Instance.ShowMsg(info); }
public void ShowNext() { MsgBoxInfo info = mStack.Pop(); if (null != info) { info.Dispose(); } if (mStack.Count > 0) { _showMsg(); } }
/// <summary> /// 显示默认的确认对话框 /// </summary> /// <param name="title">标题</param> /// <param name="msg">消息内容</param> /// <param name="call">回调</param> /// <param name="luaCall">lua回调</param> public void ShowMsg(string title, string msg, Action <int> call) { var info = new MsgBoxInfo() { Title = title, Msg = msg, BtnTxtM = LanguageManager.GetStr("确定"), ClickCallback = call, }; mStack.Push(info); _showMsg(); }
void _showCheckErrMsg() { //更新检测失败 var info = new MsgBoxInfo() { Title = LM.GetStr("提示"), BtnTxtL = LM.GetStr("退出游戏"), BtnTxtR = LM.GetStr("强制进入"), Msg = LM.GetStr("获取更新信息失败,是否强制进入游戏?\n<color=red>强制进入可能引起程序异常。</color>"), ClickCallback = _onCheckUpErrMsgBox, }; MsgBoxMgr.Instance.ShowMsg(info); }
public void ShowMsg(MsgBoxInfo info) { mStack.Push(info); _showMsg(); }