Exemple #1
0
 public void HideDialog(GuiDialogBase dialog)
 {
     if (ActiveDialog == dialog)
     {
         Game.IsMouseVisible = false;
         RemoveScreen(ActiveDialog);
     }
 }
Exemple #2
0
        public void ShowDialog(GuiDialogBase dialog)
        {
            if (ActiveDialog != null)
            {
                RemoveScreen(ActiveDialog);
            }
            ActiveDialog = dialog;
            AddScreen(ActiveDialog);

            Game.IsMouseVisible = true;
        }
Exemple #3
0
        public void HideDialog(GuiDialogBase dialog)
        {
            if (ActiveDialog == dialog)
            {
                Game.IsMouseVisible = false;
                Mouse.SetPosition(Game.Window.ClientBounds.Width / 2, Game.Window.ClientBounds.Height / 2);

                RemoveScreen(ActiveDialog);

                ActiveDialog = null;
            }
        }
Exemple #4
0
 public void HideDialog <TGuiDialog>() where TGuiDialog : GuiDialogBase
 {
     foreach (var screen in Screens.ToArray())
     {
         if (screen is TGuiDialog dialog)
         {
             Screens.Remove(dialog);
             if (ActiveDialog == dialog)
             {
                 ActiveDialog = Screens.ToArray().LastOrDefault(e => e is TGuiDialog) as GuiDialogBase;
             }
         }
     }
 }