Ejemplo n.º 1
0
        /// <summary>
        /// Default constructor fills in the menu contents
        /// </summary>
        public MainMenuScreen()
            : base()
        {
            //New Game menu entry
            mNewGameMenuEntry = new MenuEntry("New Game");
            mNewGameMenuEntry.Description = "Start a New Game";
            mNewGameMenuEntry.Font = Fonts.HeaderFont;
            mNewGameMenuEntry.Position = new Vector2(715, 0f);
            mNewGameMenuEntry.Selected += NewGameMenuEntrySelected;
            MenuEntries.Add(mNewGameMenuEntry);

            //Save Game menu entry
            //Only show if the game has started
            if (Session.IsActive)
            {
                mSaveGameMenuEntry = new MenuEntry("Save Game");
                mSaveGameMenuEntry.Description = "Save the Game";
                mSaveGameMenuEntry.Font = Fonts.HeaderFont;
                mSaveGameMenuEntry.Position = new Vector2(730, 0f);
                mSaveGameMenuEntry.Selected += SaveGameMenuEntrySelected;
                MenuEntries.Add(mSaveGameMenuEntry);
            }
            else
            {
                mSaveGameMenuEntry = null;
            }

            //Load game menu entry
            mLoadGameMenuEntry = new MenuEntry("Load Game");
            mLoadGameMenuEntry.Description = "Load the Game";
            mLoadGameMenuEntry.Font = Fonts.HeaderFont;
            mLoadGameMenuEntry.Position = new Vector2(700,0f);
            mLoadGameMenuEntry.Selected += LoadGameMenuEntrySelected;
            MenuEntries.Add(mLoadGameMenuEntry);

            //Controls menu entry
            mControlsMenuEntry = new MenuEntry("Controls");
            mControlsMenuEntry.Description = "View Game Controls";
            mControlsMenuEntry.Font = Fonts.HeaderFont;
            mControlsMenuEntry.Position = new Vector2(720, 0f);
            mControlsMenuEntry.Selected += ControlsMenuEntrySelected;
            MenuEntries.Add(mControlsMenuEntry);

            //Help menu entry
            mHelpMenuEntry = new MenuEntry("Help");
            mHelpMenuEntry.Description = "View Game Help";
            mHelpMenuEntry.Font = Fonts.HeaderFont;
            mHelpMenuEntry.Position = new Vector2(700, 0f);
            mHelpMenuEntry.Selected += HelpMenuEntrySelected;
            MenuEntries.Add(mHelpMenuEntry);

            //Exit menu entry
            mExitGameMenuEntry = new MenuEntry("Exit");
            mExitGameMenuEntry.Description = "Quit the Game";
            mExitGameMenuEntry.Font = Fonts.HeaderFont;
            mExitGameMenuEntry.Position = new Vector2(720, 0f);
            mExitGameMenuEntry.Selected += OnCancel;
            MenuEntries.Add(mExitGameMenuEntry);

            //TODO: Audio
            //AudioManager.PushMusic("MainTheme");
        }