public void CancelMaskP(MsgInfoType info) { for (int i = 0; i < mMsgs.Count; i++) { if (mMsgs[i].mInfotype == info) { //lz-2016.05.25 按Esc隐藏的时候,调用No或者Ok事件 if (null != mMsgs[i].mNoFunc) { mMsgs[i].mNoFunc(); } if (null != mMsgs[i].mOkFunc) { mMsgs[i].mOkFunc(); } mMsgs.RemoveAt(i); if (i == 0) { ResetMsgBox(); } break; } } }
public static void CancelMask(MsgInfoType info) { if (mInstance) { mInstance.CancelMaskP(info); } }
public static Message ShowMaskBox(MsgInfoType type, string text, float waitTime = 600f, CallBackFunc timeOutFunc = null) { if (mInstance) { for (int i = 0; i < mInstance.mMsgs.Count; ++i) { if (mInstance.mMsgs[i].mInfotype == type) { return(null); } } Message msg = new Message(); msg.mType = MsgBoxType.Msg_Mask; msg.mInfotype = type; msg.mContent = text; msg.mTimeOutFunc = timeOutFunc; msg.mTimer = new UTimer(); msg.mTimer.Second = waitTime; msg.mTimer.ElapseSpeed = -1; mInstance.mMsgs.Add(msg); mInstance.ResetMsgBox(); return(msg); } return(null); }
private void Msg(string str, MsgInfoType infoType) { //lbTip.Content = str; //switch (infoType) //{ // case MsgInfoType.Error: // lbTip.Foreground = new SolidColorBrush(Colors.Red); // break; // case MsgInfoType.Info: // lbTip.Foreground = new SolidColorBrush(Colors.Black); // break; // default: // break; //} }
private void Msg(string str, MsgInfoType infoType) { lbTip.Content = str; switch (infoType) { case MsgInfoType.Error: lbTip.Foreground = new SolidColorBrush(Colors.Red); break; case MsgInfoType.Info: lbTip.Foreground = new SolidColorBrush(Colors.Black); break; default: break; } }
bool CloseFrontWnd() { if (UIStateMgr.Instance == null) { return(false); } if (GameUI.Instance == null) { return(false); } if (GameUI.Instance.mUIWorldMap.isShow) { GameUI.Instance.mUIWorldMap.Hide(); return(true); } else if (GameUI.Instance.mOption.isShow) { GameUI.Instance.mOption.Hide(); return(true); } else if (GameUI.Instance.mSaveLoad.isShow) { GameUI.Instance.mSaveLoad.Hide(); return(true); } else if (MessageBox_N.IsShowing) { if (MessageBox_N.Instance) { MsgInfoType _inftype = MessageBox_N.Instance.GetCurrentInfoTypeP(); if (!(_inftype == MsgInfoType.LobbyLoginMask || _inftype == MsgInfoType.ServerDeleteMask || _inftype == MsgInfoType.ServerLoginMask)) { MessageBox_N.CancelMask(_inftype); } return(true); } } List <UIBaseWnd> wnds = UIStateMgr.Instance.mBaseWndList; UIBaseWnd frontmost = null; foreach (UIBaseWnd wnd in wnds) { if (wnd == GameUI.Instance.mMissionTrackWnd || wnd == GameUI.Instance.mItemsTrackWnd || wnd == GameUI.Instance.mCustomMissionTrack.missionInterpreter.missionTrackWnd || wnd == GameUI.Instance.mRevive) //lz-2017.01.04 按esc退出的时候复活界面不关闭错误 #7975 { continue; } if (wnd.isShow && wnd.Active) { frontmost = wnd; frontmost.Hide(); return(true); } } // if (GameUIMode.Instance.curUIMode == GameUIMode.UIMode.um_building) // { // GameUI.Instance.mBuildBlock.QuitBuildMode(); // return true; // } return(false); }