Exemplo n.º 1
0
 public bool EqualTo(IDialogData data)
 {
     return(GetType() == data.GetType() &&
            Title.Equals(data.Title) &&
            Content.Equals(data.Content) &&
            ButtonCallback == data.ButtonCallback);
 }
Exemplo n.º 2
0
 public bool EqualTo(IDialogData data)
 {
     return GetType() == data.GetType()
         && Title.Equals(data.Title)
         && Content.Equals(data.Content)
         && ButtonCallback == data.ButtonCallback;
 }
Exemplo n.º 3
0
        public Task Information(IDialogData dialogData)
        {
            var dialog = new InformationDialog {
                DataContext = new InformationViewModel(dialogData)
            };

            return(DialogHost.Show(dialog, _identifier));
        }
Exemplo n.º 4
0
        public async Task <bool> Question(IDialogData dialogData)
        {
            var dialog = new QuestionDialog {
                DataContext = new QuestionViewModel(dialogData)
            };

            return((bool)await DialogHost.Show(dialog, _identifier));
        }
Exemplo n.º 5
0
        public Task Error(IDialogData dialogData)
        {
            var dialog = new ErrorDialog {
                DataContext = new ErrorViewModel(dialogData)
            };

            return(DialogHost.Show(dialog, _identifier));
        }
        public PopupFormat(Popup lpPopup, string lptext, IDialogData data)
        {
            Command = 0x2F;
            Secured = true;
            {
                Text = lptext;
                Data = data;
            }

            _popup = lpPopup;
        }
Exemplo n.º 7
0
 public void ShowDialog(IDialogData dialog)
 {
     if (dialog != null)
     {
         StartCoroutine(_ShowDialog(dialog));
     }
     else
     {
         Logger.LogError("ERROR: Can't show dialog -> IDialogData is NULL");
     }
 }
Exemplo n.º 8
0
    public override bool UnRegisterObject(GameObject toUnRegister, IInteractionLogic id)
    {
        IUIData script = GetDesiredUIScript(toUnRegister, UIViewType.Dialog);

        if (script != null && script.UIType == UIViewType.Dialog)
        {
            IDialogData data = (IDialogData)script;
            data.EnableComponent(false);
            data.SetTitle(string.Empty);
            data.SetFormattedString(string.Empty);
        }
        return(base.UnRegisterObject(toUnRegister, id));
    }
Exemplo n.º 9
0
        bool ContainDialog(IDialogData dialog)
        {
            if (currentDialog == null)
            {
                return(false);
            }

            if (listDialog.Contains(dialog) || (currentDialog != null && currentDialog.EqualTo(dialog)))
            {
                return(true);
            }

            return(listDialog.Find(d => d.EqualTo(dialog)) != null);
        }
Exemplo n.º 10
0
 void CheckAndShow()
 {
     if (currentDialog == null && listDialog.Count > 0)
     {
         currentDialog = listDialog[0];
         currentDialog.ShowDialog();
         currentDialog.onDestroy = () =>
         {
             listDialog.RemoveAt(0);
             currentDialog = null;
             //Show Hide Animation
             Invoke("CheckAndShow", 0.3f);
         };
     }
 }
Exemplo n.º 11
0
    public override bool RegisterObject(GameObject toRegister, IInteractionLogic id)
    {
        bool wasSuccessFullRegister = base.RegisterObject(toRegister, id);

        if (wasSuccessFullRegister)
        {
            IUIData script = GetDesiredUIScript(toRegister, UIViewType.Dialog);
            if (script != null && script is IDialogData)
            {
                IDialogData data = (IDialogData)script;
                data.EnableComponent(true);
                data.SetTitle(this.Title);
                data.SetFormattedString(this.GetFormattedBulletPoints());
            }
        }
        return(wasSuccessFullRegister);
    }
Exemplo n.º 12
0
        IEnumerator _ShowDialog(IDialogData dialog)
        {
            //Chờ chờ chuyển cảnh xong và ổn định mới hiện dialog phần thưởng.
            if (dialog is DialogPromotion)
            {
                yield return(new WaitForSeconds(1.5f));
            }

            if (dialog.IsMessageDialog == false)
            {
                dialog.ShowDialog();
            }
            else if (!ContainDialog(dialog))
            {
                listDialog.Add(dialog);
                while (PuApp.Instance.changingScene)
                {
                    yield return(new WaitForEndOfFrame());
                }
                CheckAndShow();
            }
        }
Exemplo n.º 13
0
 public Task Information(IDialogData dialogData)
 {
     return(_dialogService.Information(dialogData));
 }
Exemplo n.º 14
0
 public bool IsShowing(IDialogData dialog)
 {
     return(currentDialog == dialog);
 }
Exemplo n.º 15
0
 public Task <bool> Question(IDialogData dialogData)
 {
     return(_dialogService.Question(dialogData));
 }
Exemplo n.º 16
0
 public ServerFormat2F(Mundane mundane, string text, IDialogData data)
 {
     Mundane = mundane;
     Text    = text;
     Data    = data;
 }
Exemplo n.º 17
0
 public Task Error(IDialogData dialogData)
 {
     return(_dialogService.Error(dialogData));
 }
 public InformationViewModel(IDialogData dialogData)
 {
     _caption = dialogData.Caption;
     _message = dialogData.Message;
 }
 public ErrorViewModel(IDialogData dialogData)
 {
     _caption = dialogData.Caption;
     _message = dialogData.Message;
 }