public void HideDialog(GuiDialogBase dialog) { if (ActiveDialog == dialog) { Game.IsMouseVisible = false; RemoveScreen(ActiveDialog); } }
public void ShowDialog(GuiDialogBase dialog) { if (ActiveDialog != null) { RemoveScreen(ActiveDialog); } ActiveDialog = dialog; AddScreen(ActiveDialog); Game.IsMouseVisible = true; }
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; } }
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; } } } }