private void OnConsoleClosed(MDScreen Screen) { if (Screen == Console) { Console.OnScreenClosed -= OnConsoleClosed; Console = null; } }
// Opens and focuses the console UI private void ToggleConsole() { if (Console == null) { Console = OpenScreen <MDConsole>(ConsoleName, MDScreenLayer.Console); Console.OnScreenClosed += OnConsoleClosed; } else { Console.CloseScreen(); } }