示例#1
0
        //--------------------//

        #region Initialize Menu
        /// <summary>
        /// Creates the <see cref="_menuPresenter"/> if necessary, sets it as the <see cref="CurrentPresenter"/> and configures the GUI for the main menu
        /// </summary>
        private void InitializeMenuMode()
        {
            Loading = true;

            using (new TimedLogEvent("Initialize menu"))
            {
                // Switch mode
                CurrentState = GameState.Menu;

                // Clean previous presenter
                //CleanupPresenter();

                // Load menu scene
                if (_menuPresenter == null)
                {
                    _menuPresenter = new MenuPresenter(Engine, _menuUniverse);
                }
                _menuPresenter.Initialize();
                CurrentPresenter = _menuPresenter;

                // Activate new view
                CurrentPresenter.HookIn();
                if (Settings.Current.Graphics.Fading)
                {
                    Engine.FadeIn();
                }

                // Show game GUI
                GuiManager.CloseAll();
                LoadDialog("MainMenu");
            }

            Loading = false;
        }