Exemple #1
0
 public static void Show(DialogCloseDelegate callback, string message, string title, MessageBoxButtons buttons, Sprite icon, MessageBoxUI ui)
 {
     if (ui != null)
     {
         new MessageBox(callback, message, title, buttons, icon, ui);
     }
     else
     {
         Debug.LogError("Missing message box UI");
     }
 }
Exemple #2
0
 protected MessageBox(DialogCloseDelegate callback, string message, string title, MessageBoxButtons buttons, Sprite icon, MessageBoxUI ui)
 {
     _closeDelegate += callback;
     Message         = message;
     Title           = title;
     Buttons         = buttons;
     Icon            = icon;
     UI              = ui;
     UI.Owner        = this;
     UI.gameObject.SetActive(true);
     ShowMessageOn(UI);
 }
 /// <summary>
 /// Call to show the dialog.
 /// </summary>
 /// <param name="closeEvent">Delegate to invoke on closing the dialog.</param>
 /// <remarks>
 /// When <see cref="CanShowNative"/> is <c>true</c>, a call is made to <see cref="ShowNative()"/>.
 /// Otherwise the <see cref="DialogPanel"/> is made active then <see cref="OnShow()"/> is called.
 /// </remarks>
 public void ShowDialog(DialogCloseDelegate closeEvent)
 {
     Reset();
     _closeDelegate += closeEvent;
     if (CanShowNative)
     {
         OnShowNative();
     }
     else
     {
         DialogPanel.gameObject.SetActive(true);
         OnShow();
     }
 }
Exemple #4
0
 public static void Hide(DialogState state, DialogCloseDelegate m = null)
 {
     if (Dialog.mTargetDialog == null)
     {
         if (m != null)
         {
             m(null, state);
         }
         return;
     }
     if (m != null)
     {
         Dialog.mTargetDialog.hideCallback += m;
     }
     Dialog.mTargetDialog.Hide(state);
 }
Exemple #5
0
 public static void Show(DialogCloseDelegate callback, string message, string title, MessageBoxButtons buttons, Sprite icon)
 {
     Show(callback, message, title, buttons, icon, MessageBoxUI.DefaultUI);
 }
Exemple #6
0
 public static void Show(DialogCloseDelegate callback, string message, string title, MessageBoxButtons buttons, MessageBoxUI ui)
 {
     Show(callback, message, title, buttons, null, ui);
 }
Exemple #7
0
 public static void Show(DialogCloseDelegate callback, string message, string title)
 {
     Show(callback, message, title, MessageBoxButtons.OK, null, MessageBoxUI.DefaultUI);
 }
Exemple #8
0
 public static void Show(DialogCloseDelegate callback, string message, MessageBoxUI ui)
 {
     Show(callback, message, "", MessageBoxButtons.OK, null, ui);
 }
Exemple #9
0
 public static void Hide(DialogCloseDelegate m)
 {
     Hide(DialogState.OK, m);
 }