Exemple #1
0
        void Start()
        {
            var arg = new UIMsgBox.UIMsgBoxArg();

            arg.title   = "megbox Test";
            arg.content = "it works! lol";
            arg.btnText = "OK|Cancel|Close";
            //UIManager.Instance.OpenWindow("Common/UIMsgBox", arg);
            MsgBoxAPI.ShowMsgBox("I am a msg box", "MsgBox with title", "OK|cancle|close", OnMsgBoxClick);
        }
Exemple #2
0
        /// <summary>
        /// 对MsgBox的调用封装
        /// </summary>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="btnText">如果有多个按钮,用|分割,例如:确定|取消|关闭</param>
        /// <param name="onCloseEvent"></param>
        /// <returns></returns>
        public static UIWindow ShowMsgBox(string title, string content, string btnText, Action <object> onCloseEvent = null)
        {
            UIMsgBox.UIMsgBoxArg arg = new UIMsgBox.UIMsgBoxArg();
            arg.content = content;
            arg.title   = title;
            arg.btnText = btnText;
            UIWindow wnd = UIManager.Instance.OpenWindow(UIDef.UIMsgBox, arg);

            if (wnd != null && onCloseEvent != null)
            {
                wnd.onClose.AddListener((closeArg) => { onCloseEvent(closeArg); });
            }

            return(wnd);
        }
Exemple #3
0
        /// <summary>
        /// 对MsgBox的调用封装
        /// </summary>
        /// <param name="title"></param>
        /// <param name="content"></param>
        /// <param name="btnText">如果有多个按钮,用|分割,例如:确定|取消|关闭</param>
        /// <param name="onCloseEvent"></param>
        /// <returns></returns>
        public static UIWindow ShowMsgBox(string title, string content, string btnText, UIWindow.CloseEvent onCloseEvent = null)
        {
            UIMsgBox.UIMsgBoxArg arg = new UIMsgBox.UIMsgBoxArg();
            arg.content = content;
            arg.title   = title;
            arg.btnText = btnText;
            UIWindow msgBox = UIManager.Instance.OpenWindow(UIConst.UIMsgBox, arg);

            if (msgBox != null && onCloseEvent != null)
            {
                msgBox.onClose += closeArg =>
                {
                    onCloseEvent(closeArg);
                };
            }

            return(msgBox);
        }
Exemple #4
0
        /// <summary>
        /// 打开一个MsgBox
        /// </summary>
        /// <param name="title">MsgBox的标题</param>
        /// <param name="content">MsgBox的内容</param>
        /// <param name="btnText">MagBox的按钮内容,格式为 "确定|取消"</param>
        /// <param name="onCloseEvent">当按钮关闭时调用的事件</param>
        /// <returns></returns>
        public static Kurisu.Service.UIManager.UIWindow ShowMsgBox(string title, string content, string btnText, Kurisu.Service.UIManager.UIWindow.CloseEvent onCloseEvent = null)
        {
            UIMsgBox.UIMsgBoxArg arg = new UIMsgBox.UIMsgBoxArg();
            arg.content = content;
            arg.title   = title;
            arg.btnText = btnText;

            Kurisu.Service.UIManager.UIWindow wnd = UIManager.Instance.OpenWindow(UIDef.UIMsgBox, arg);

            if (wnd != null && onCloseEvent != null)
            {
                wnd.OnCloseEvent += closeArg =>
                {
                    onCloseEvent(closeArg);
                };
            }

            return(wnd);
        }