Пример #1
0
        private void ReturnToMainMenu(object sender, EventArgs eventArgs)
        {
            mDirector.GetStoryManager.Level.GameScreen.Unload();
            mDirector.GetClock       = new Clock();
            mDirector.GetIdGenerator = new IdGenerator();
            mDirector.GetInputManager.RemoveEverythingFromInputManager();
            mDirector.GetStoryManager = new StoryManager(mDirector);
            mDirector.GetStoryManager.SetScreenManager(mScreenManager);
            mDirector.GetPathManager          = new PathManager();
            mDirector.GetDistributionDirector = new DistributionDirector(mDirector);
            mDirector.GetMilitaryManager      = new MilitaryManager(mDirector);
            mDirector.GetDeathManager         = new DeathManager();
            mDirector.GetActionManager        = new ActionManager();

            for (var i = 0; i < mScreenManager.GetScreenCount() - 1; i++)
            {
                mScreenManager.RemoveScreen();
            }
            LoadGameManagerScreen.OnReturnToMainMenuClicked(sender, eventArgs);
        }
Пример #2
0
        private void OnSaveReleased(Object sender, EventArgs eventArgs)
        {
            int width;
            int height;

            if (GlobalVariables.IsFullScreen)
            {
                width  = mGame.mGraphicsAdapter.CurrentDisplayMode.Width;
                height = mGame.mGraphicsAdapter.CurrentDisplayMode.Height;
            }
            else
            {
                width  = GlobalVariables.ResolutionList[GlobalVariables.ChosenResolution].Item1;
                height = GlobalVariables.ResolutionList[GlobalVariables.ChosenResolution].Item2;
            }

            mGame.mGraphics.PreferredBackBufferWidth  = width;
            mGame.mGraphics.PreferredBackBufferHeight = height;
            mGame.mGraphics.ApplyChanges();
            MainMenuManagerScreen.SetResolution(new Vector2(width, height));
            LoadGameManagerScreen.SetResolution(new Vector2(width, height));
        }