Ejemplo n.º 1
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MultiplayerMenuScreen()
            : base("Multiplayer")
        {
            // Create our menu entries.
            MenuEntry hostGameMenuEntry = new MenuEntry("Host Game");
            MenuEntry joinGameMenuEntry = new MenuEntry("Join Game");
            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            hostGameMenuEntry.Selected += HostGameMenuEntrySelected;
            joinGameMenuEntry.Selected += JoinGameMenuEntrySelected;
            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(hostGameMenuEntry);
            MenuEntries.Add(joinGameMenuEntry);
            MenuEntries.Add(back);
            return;
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public ResolutionsMenuScreen()
            : base("Resolutions")
        {
            for (int i = 0; i < resolutions.Length; i += 1) // Add an option for each resolution
            {
                MenuEntry resolution = new MenuEntry(resolutions[i]);
                resolution.Selected += ResolutionMenuEntrySelected;
                MenuEntries.Add(resolution);

                if (string.Compare(resolutions[i], currentResolution) == 0) // Select the most recent entry
                {
                    SelectedEntry = i;
                }
            }

            // Set up the back menu option
            MenuEntry back = new MenuEntry("Back");
            back.Selected += OnCancel;
            MenuEntries.Add(back);
            return;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public PauseMenuScreen()
            : base("Paused")
        {
            MediaPlayer.Pause();

            // Create our menu entries.
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");

            // Hook up menu event handlers.
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;
            resumeGameMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
            return;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base("Main Menu")
        {
            // Create our menu entries.
            MenuEntry newGameMenuEntry = new MenuEntry("New Game");
            MenuEntry multiplayerMenuEntry = new MenuEntry("Multiplayer");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            newGameMenuEntry.Selected += NewGameMenuEntrySelected;
            multiplayerMenuEntry.Selected += MultiplayerMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(newGameMenuEntry);
            MenuEntries.Add(multiplayerMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
            return;
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public OptionsMenuScreen()
            : base("Options")
        {
            // Create our menu entries
            fullScreenOnMenuEntry = new MenuEntry(string.Empty, true);
            borderlessOnMenuEntry = new MenuEntry(string.Empty, true, fullScreenOn == OnOff.Off);
            resolutionMenuEntry = new MenuEntry(string.Empty, false, fullScreenOn == OnOff.Off);
            vsyncOnMenuEntry = new MenuEntry(string.Empty, true);
            musicOnMenuEntry = new MenuEntry(string.Empty, true);
            musicVolumeMenuEntry = new MenuEntry(string.Empty, true, musicOn == OnOff.On);
            soundFXOnMenuEntry = new MenuEntry(string.Empty, true);
            soundFXVolumeMenuEntry = new MenuEntry(string.Empty, true, soundFXOn == OnOff.On);

            SetMenuEntryText();
            MenuEntry back = new MenuEntry("Back");

            // Hook up menu event handlers.
            fullScreenOnMenuEntry.Selected += FullScreenOnMenuEntrySelected;
            borderlessOnMenuEntry.Selected += BorderlessOnMenuEntrySelected;
            resolutionMenuEntry.Selected += ResolutionMenuEntrySelected;
            vsyncOnMenuEntry.Selected += VsyncOnMenuEntrySelected;
            musicOnMenuEntry.Selected += MusicOnMenuEntrySelected;
            musicVolumeMenuEntry.Selected += MusicVolumeMenuEntrySelected;
            soundFXOnMenuEntry.Selected += SoundFXOnEntrySelected;
            soundFXVolumeMenuEntry.Selected += SoundFXVolumeMenuEntrySelected;
            back.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(fullScreenOnMenuEntry);
            MenuEntries.Add(borderlessOnMenuEntry);
            MenuEntries.Add(resolutionMenuEntry);
            MenuEntries.Add(vsyncOnMenuEntry);
            MenuEntries.Add(musicOnMenuEntry);
            MenuEntries.Add(musicVolumeMenuEntry);
            MenuEntries.Add(soundFXOnMenuEntry);
            MenuEntries.Add(soundFXVolumeMenuEntry);
            MenuEntries.Add(back);
            return;
        }