/// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("A Game With A Piratey Title")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public PauseMenuScreen()
            : base("Paused")
        {
            // Create our menu entries.
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
            MenuEntry optionsGameMenuEntry = new MenuEntry("Options");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");

            // Hook up menu event handlers.
            resumeGameMenuEntry.Selected += OnCancel;
            optionsGameMenuEntry.Selected += OptionsGameMenuEntrySelected;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;

            // Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(optionsGameMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
        }
Example #3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            int resolutionIndex = AvailableResolutions.FindIndex(d => d.Width == GameSettingsManager.Default.ResolutionWidth &&
                                                              d.Height == GameSettingsManager.Default.ResolutionHeight);

            if (resolutionIndex != -1)
            {
                _CurrentResolution = resolutionIndex;
                _TemporaryResolution = resolutionIndex;
            }

            int localeIndex = _AvailableLocales.FindIndex(l => l == GameSettingsManager.Default.Locale);

            if (localeIndex != -1)
            {
                _CurrentLocale = localeIndex;
            }

            // Create our menu entries.
            _ResolutionMenuEntry = new MenuEntry(String.Empty);
            _FullscreenEntry = new MenuEntry(String.Empty);
            _BorderlessEntry = new MenuEntry(String.Empty);
            _MusicMenuEntry = new MenuEntry(String.Empty);
            _SfxMenuEntry = new MenuEntry(String.Empty);
            _LanguageMenuEntry = new MenuEntry(String.Empty);
            _InsultsMenuEntry = new MenuEntry(String.Empty);
            _OceanColorMenuEntry = new MenuEntry(String.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            _ResolutionMenuEntry.Selected += ResolutionMenuEntrySelected;
            _ResolutionMenuEntry.Right += ResolutionMenuEntryRight;
            _ResolutionMenuEntry.Left += ResolutionMenuEntryLeft;

            _FullscreenEntry.Selected += FullscreenMenuEntrySelected;

            _BorderlessEntry.Selected += BorderlessMenuEntrySelected;

            _MusicMenuEntry.Right += MusicMenuEntryRight;
            _MusicMenuEntry.StillRight += MusicMenuEntryRight;
            _MusicMenuEntry.RightReleased += MusicMenuEntryReleased;
            _MusicMenuEntry.Left += MusicMenuEntryLeft;
            _MusicMenuEntry.StillLeft += MusicMenuEntryLeft;
            _MusicMenuEntry.LeftReleased += MusicMenuEntryReleased;

            _SfxMenuEntry.Right += SfxMenuEntryRight;
            _SfxMenuEntry.StillRight += SfxMenuEntryRight;
            _SfxMenuEntry.RightReleased += SfxMenuEntryReleased;
            _SfxMenuEntry.Left += SfxMenuEntryLeft;
            _SfxMenuEntry.StillLeft += SfxMenuEntryLeft;
            _SfxMenuEntry.LeftReleased += SfxMenuEntryReleased;

            _LanguageMenuEntry.Selected += LanguageMenuEntrySelected;

            _InsultsMenuEntry.Selected += InsultsMenuEntrySelected;

            _OceanColorMenuEntry.Selected += OceanColorMenuEntrySelected;

            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(_ResolutionMenuEntry);
            MenuEntries.Add(_FullscreenEntry);
            MenuEntries.Add(_BorderlessEntry);
            MenuEntries.Add(_MusicMenuEntry);
            MenuEntries.Add(_SfxMenuEntry);
            MenuEntries.Add(_LanguageMenuEntry);
            MenuEntries.Add(_InsultsMenuEntry);
            MenuEntries.Add(_OceanColorMenuEntry);
            MenuEntries.Add(back);
        }
Example #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            int resolutionIndex = AvailableResolutions.FindIndex(d => d.Width == GameSettingsManager.Default.ResolutionWidth &&
                                                                 d.Height == GameSettingsManager.Default.ResolutionHeight);

            if (resolutionIndex != -1)
            {
                _CurrentResolution   = resolutionIndex;
                _TemporaryResolution = resolutionIndex;
            }

            int localeIndex = _AvailableLocales.FindIndex(l => l == GameSettingsManager.Default.Locale);

            if (localeIndex != -1)
            {
                _CurrentLocale = localeIndex;
            }

            // Create our menu entries.
            _ResolutionMenuEntry = new MenuEntry(String.Empty);
            _FullscreenEntry     = new MenuEntry(String.Empty);
            _BorderlessEntry     = new MenuEntry(String.Empty);
            _MusicMenuEntry      = new MenuEntry(String.Empty);
            _SfxMenuEntry        = new MenuEntry(String.Empty);
            _LanguageMenuEntry   = new MenuEntry(String.Empty);
            _InsultsMenuEntry    = new MenuEntry(String.Empty);
            _OceanColorMenuEntry = new MenuEntry(String.Empty);

            SetMenuEntryText();

            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            _ResolutionMenuEntry.Selected += ResolutionMenuEntrySelected;
            _ResolutionMenuEntry.Right    += ResolutionMenuEntryRight;
            _ResolutionMenuEntry.Left     += ResolutionMenuEntryLeft;

            _FullscreenEntry.Selected += FullscreenMenuEntrySelected;

            _BorderlessEntry.Selected += BorderlessMenuEntrySelected;

            _MusicMenuEntry.Right         += MusicMenuEntryRight;
            _MusicMenuEntry.StillRight    += MusicMenuEntryRight;
            _MusicMenuEntry.RightReleased += MusicMenuEntryReleased;
            _MusicMenuEntry.Left          += MusicMenuEntryLeft;
            _MusicMenuEntry.StillLeft     += MusicMenuEntryLeft;
            _MusicMenuEntry.LeftReleased  += MusicMenuEntryReleased;

            _SfxMenuEntry.Right         += SfxMenuEntryRight;
            _SfxMenuEntry.StillRight    += SfxMenuEntryRight;
            _SfxMenuEntry.RightReleased += SfxMenuEntryReleased;
            _SfxMenuEntry.Left          += SfxMenuEntryLeft;
            _SfxMenuEntry.StillLeft     += SfxMenuEntryLeft;
            _SfxMenuEntry.LeftReleased  += SfxMenuEntryReleased;

            _LanguageMenuEntry.Selected += LanguageMenuEntrySelected;

            _InsultsMenuEntry.Selected += InsultsMenuEntrySelected;

            _OceanColorMenuEntry.Selected += OceanColorMenuEntrySelected;

            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(_ResolutionMenuEntry);
            MenuEntries.Add(_FullscreenEntry);
            MenuEntries.Add(_BorderlessEntry);
            MenuEntries.Add(_MusicMenuEntry);
            MenuEntries.Add(_SfxMenuEntry);
            MenuEntries.Add(_LanguageMenuEntry);
            MenuEntries.Add(_InsultsMenuEntry);
            MenuEntries.Add(_OceanColorMenuEntry);
            MenuEntries.Add(back);
        }