Exemplo n.º 1
0
        public static MessageViewWindow CreateMessageViewWindow(
            MessageViewType type,
            Dictionary <string, object> argument)
        {
            MessageViewWindow viewWindow = new MessageViewWindow();

            viewWindow.messageView.Type     = type;
            viewWindow.messageView.Argument = argument;
            return(viewWindow);
        }
Exemplo n.º 2
0
 public MyTreeViewItem(string header,
                       bool showMessageWindow = false,
                       MessageViewType type   = MessageViewType.Home,
                       Dictionary <string, object> argument = null) : base()
 {
     this.Header            = header;
     this.MessageType       = type;
     this.Argument          = argument;
     this.ShowMessageWindow = showMessageWindow;
 }
Exemplo n.º 3
0
    public void Show(string title, string message, MessageViewType type = MessageViewType.Ok, Action OnOKBtnClickHandler = null, Action OnCancelBtnClickHandler = null)
    {
        this.titleTxt.text           = title;
        this.message.text            = message;
        this.OnOKBtnClickHandler     = OnOKBtnClickHandler;
        this.OnCancelBtnClickHandler = OnCancelBtnClickHandler;

        btnCancle.gameObject.SetActive(type != MessageViewType.Ok);
        btnOK.gameObject.SetActive(type == MessageViewType.Ok);

        if (type == MessageViewType.OkAndCancel)
        {
            return;
        }
        btnOK.transform.localPosition = new Vector3(0, -36, transform.localPosition.z);
    }
Exemplo n.º 4
0
    /// <summary>
    /// 显示消息窗口
    /// </summary>
    /// <param name="title">标题</param>
    /// <param name="message">内容</param>
    /// <param name="type">类型</param>
    /// <param name="okAction">确定回调</param>
    /// <param name="cancelAction">取消回调</param>
    public void ShowMessage(string title, string message, MessageViewType type = MessageViewType.Ok, Action okAction = null, Action cancelAction = null, float countDown = 0.0f, AutoClickType autoType = AutoClickType.None)
    {
        if (m_MessageView == null)
        {
            GameObject go = ResourcesManager.Instance.Load(ResourceType.UIWindow, "pan_Message");
            m_MessageView = go.GetOrCreatComponent <UIMessageView>();
        }
        m_MessageView.gameObject.SetParent(CurrentUIScene.Container_Center, true);
        m_MessageView.gameObject.transform.localPosition = Vector3.zero;
        m_MessageView.gameObject.transform.localScale    = Vector3.one;
        m_MessageView.gameObject.GetComponent <RectTransform>().sizeDelta = Vector2.zero;

        Canvas canvas = m_MessageView.GetComponent <Canvas>();

        canvas.overrideSorting = true;
        canvas.sortingOrder    = 1000;
        LogSystem.Log("显示消息窗口:" + message);
        m_MessageView.Show(title, message, countDown, autoType, type, okAction, cancelAction);
    }
Exemplo n.º 5
0
    /// <summary>
    /// 显示窗口
    /// </summary>
    /// <param name="title"></param>
    /// <param name="message"></param>
    /// <param name="type"></param>
    /// <param name="okAction"></param>
    /// <param name="cancelAction"></param>
    public void Show(string title, string message, MessageViewType type = MessageViewType.Ok, Action okAction = null, Action cancelAction = null)
    {
        GameObject @object = ResourcesMgr.Instance.Load(ResourcesMgr.ResourceType.UIWindow, "Pan_Message", false);

        @object.transform.parent        = UISceneCtr.Instance.CurrentUIScene.Container_Center;
        @object.transform.localPosition = Vector3.zero;
        @object.transform.localScale    = Vector3.one;

        UIMessageView messageView = @object.GetComponent <UIMessageView>();

        messageView.Show(title, message, type, okAction, cancelAction);
        if (okAction != null)
        {
            okAction();
        }

        if (cancelAction == null ? false:true)
        {
            cancelAction.Invoke();
        }
    }
Exemplo n.º 6
0
    /// <summary>
    /// 显示窗口
    /// </summary>
    /// <param name="title">标题</param>
    /// <param name="message">内容</param>
    /// <param name="type">类型</param>
    /// <param name="okAction">确定回调</param>
    /// <param name="cancelAction">取消回调</param>
    public void Show(string title, string message, MessageViewType type = MessageViewType.Ok, Action okAction = null, Action cancelAction = null)
    {
        gameObject.transform.localPosition = Vector3.zero;
        lblTitle.text   = title;
        lblMessage.text = message;

        switch (type)
        {
        case MessageViewType.Ok:
            btnOk.transform.localPosition = Vector3.zero;
            btnCancel.gameObject.SetActive(false);
            break;

        case MessageViewType.OkAndCancel:
            btnOk.transform.localPosition = new Vector3(-70, 0, 0);
            btnCancel.gameObject.SetActive(true);
            break;
        }

        OnOkClickHandler = okAction;
        OnCancelHandler  = cancelAction;
    }
Exemplo n.º 7
0
    /// <summary>
    /// 显示窗口
    /// </summary>
    /// <param name="title">标题</param>
    /// <param name="message">内容</param>
    /// <param name="type">类型</param>
    /// <param name="okAction">确定回调</param>
    /// <param name="cancelAction">取消回调</param>
    public void Show(string title, string message, float countDown = 0f, AutoClickType autoType = AutoClickType.None, MessageViewType type = MessageViewType.Ok, Action okAction = null, Action cancelAction = null)
    {
        gameObject.transform.localPosition = Vector3.zero;
        lblTitle.text   = title;
        lblMessage.text = message;

        switch (type)
        {
        case MessageViewType.Ok:
            btnOk.transform.localPosition = new Vector3(0, btnOk.transform.localPosition.y, 0);
            btnCancel.gameObject.SetActive(false);
            btnOk.gameObject.SetActive(true);
            break;

        case MessageViewType.OkAndCancel:
            btnOk.transform.localPosition = new Vector3(-218, btnOk.transform.localPosition.y, 0);
            btnCancel.gameObject.SetActive(true);
            btnOk.gameObject.SetActive(true);
            break;

        case MessageViewType.None:
            btnCancel.gameObject.SetActive(false);
            btnOk.gameObject.SetActive(false);
            break;
        }
        m_AutoType   = autoType;
        m_fCountDown = countDown;
        switch (autoType)
        {
        case AutoClickType.None:
            m_TextOk.SafeSetText("确定");
            m_TextCancel.SafeSetText("取消");
            break;

        case AutoClickType.Cancel:
            m_TextOk.SafeSetText("确定");
            break;

        case AutoClickType.Ok:
            m_TextCancel.SafeSetText("取消");
            break;
        }

        OnOkClickHandler = okAction;
        OnCancelHandler  = cancelAction;
    }
Exemplo n.º 8
0
 /// <summary>
 /// 显示窗口
 /// </summary>
 /// <param name="title">标题</param>
 /// <param name="message">内容</param>
 /// <param name="type">类型</param>
 /// <param name="okAction">确定回调</param>
 /// <param name="cancelAction">取消回调</param>
 protected void ShowMessage(string title, string message, MessageViewType type = MessageViewType.Ok, Action okAction = null, Action cancelAction = null, float countDown = 0.0f, AutoClickType autoType = AutoClickType.None)
 {
     UIViewManager.Instance.ShowMessage(title, message, type, okAction, cancelAction, countDown, autoType);
 }
Exemplo n.º 9
0
 protected void ShowMessage(string title, string message, MessageViewType type = MessageViewType.Ok, Action okAction = null, Action cancelAction = null)
 {
     UIMessageCtr.Instance.Show(title, message, type, okAction, cancelAction);
 }