using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.GamerServices;

namespace FredriksdalAssault2
{
    /// <summary>
    /// This menu screen gives the user information about the game and
    /// about the controls in the game.
    /// </summary>
    class OptionScreen : MenuScreen
    {
        #region Constructors

        /// <summary>
        /// Create a new option screen.
        /// </summary>
        public OptionScreen()
            : base(Resources.Options)
        {

            // Create our menu entries.
            MenuEntry gamePadControlMenuEntry = new MenuEntry(Resources.GamePadControl);
            //MenuEntry keyboardControlMenuEntry = new MenuEntry(Resources.KeyboardControl);
            MenuEntry controllerSettingsMenuEntry = new MenuEntry(Resources.ControllerSettings);
            MenuEntry aboutTheGameMenuEntry = new MenuEntry(Resources.AboutTheGame);
            MenuEntry backMenuEntry = new MenuEntry(Resources.Back);

            // Hook up menu event handlers.
            gamePadControlMenuEntry.Selected += GamePadControlMenuEntrySelected;
            //keyboardControlMenuEntry.Selected += KeyboardControlMenuEntrySelected;
            controllerSettingsMenuEntry.Selected += ControllerSettingsMenuEntrySelected;
            aboutTheGameMenuEntry.Selected += AboutTheGameMenuEntrySelected;
            backMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(gamePadControlMenuEntry);
            //MenuEntries.Add(keyboardControlMenuEntry);
            MenuEntries.Add(controllerSettingsMenuEntry);
            MenuEntries.Add(aboutTheGameMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }

        #endregion

        #region Event Handlers

        /// <summary>
        /// Event handler for when the System Link menu entry is selected.
        /// </summary>
        private void GamePadControlMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            // Add a game pad control screen.
            ScreenManager.AddScreen(new GamePadControlScreen(), e.PlayerIndex);
        }

        /// <summary>
        /// Event handler for when the System Link menu entry is selected.
        /// </summary>
        private void KeyboardControlMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            // Add a keyboard control screen.
            ScreenManager.AddScreen(new KeyboardControlScreen(), e.PlayerIndex);
        }

        /// <summary>
        /// Event handler for when the Controller Settings menu entry is selected.
        /// </summary>
        private void ControllerSettingsMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            // Add a game pad control screen.
            ScreenManager.AddScreen(new ControllerSettingsScreen(e.PlayerIndex), e.PlayerIndex);
        }

        /// <summary>
        /// Event handler for when the System Link menu entry is selected.
        /// </summary>
        private void AboutTheGameMenuEntrySelected(object sender, PlayerIndexEventArgs e)
        {
            // Add a about the game screen.
            ScreenManager.AddScreen(new AboutTheGameScreen(), e.PlayerIndex);
        }

        #endregion
    }
}
