Exemplo n.º 1
0
        public MainMenuScreen()
            : base(string.Empty)
        {
            MenuEntry play = new MenuEntry("Play!");
            MenuEntry options = new MenuEntry("Options");
            MenuEntry help = new MenuEntry("Help");
            MenuEntry credits = new MenuEntry("Credits");
#if PC
            MenuEntry exit = new MenuEntry("Exit");
#endif

            play.Selected += new EventHandler<PlayerIndexEventArgs>(play_Selected);
            options.Selected += new EventHandler<PlayerIndexEventArgs>(options_Selected);
            help.Selected += new EventHandler<PlayerIndexEventArgs>(help_Selected);
            credits.Selected += new EventHandler<PlayerIndexEventArgs>(credits_Selected);
#if PC
            exit.Selected += new EventHandler<PlayerIndexEventArgs>(exit_Selected);
#endif

            MenuEntries.Add(play);
            MenuEntries.Add(options);
            MenuEntries.Add(help);
            MenuEntries.Add(credits);
#if PC
            MenuEntries.Add(exit);
#endif
        }
Exemplo n.º 2
0
        public PauseMenuScreen(GameType gameType)
            : base ("Paused")
        {
            myGameType = gameType;

            // Instantiate menu entries.
            resume = new MenuEntry("Resume Game");

            if (gameType == GameType.Campaign)
            {
                loadGame = new MenuEntry("Load Game");
                saveGame = new MenuEntry("Save Game");
            }

            options = new MenuEntry("Options");
            quitToMenu = new MenuEntry("Quit to Main Menu");
#if PC
			quitToOS = new MenuEntry("Exit Game");
#endif

            // Attach event hooks to entry selected handler.
            resume.Selected += OnCancel;

			if (myGameType == GameType.Campaign)
            {
				// implement load and save game menu entries. :)
            }

            options.Selected += new EventHandler<PlayerIndexEventArgs>(options_Selected);
            quitToMenu.Selected += new EventHandler<PlayerIndexEventArgs>(quitToMenu_Selected);

            // Add entries to stack.
            MenuEntries.Add(resume);

            if (gameType == GameType.Campaign)
            {
                MenuEntries.Add(loadGame);
                MenuEntries.Add(saveGame);
            }

            MenuEntries.Add(options);
            MenuEntries.Add(quitToMenu);

#if PC
			quitToOS.Selected += new EventHandler<PlayerIndexEventArgs>(quitToOS_Selected);
			MenuEntries.Add(quitToOS);
#endif
        }
Exemplo n.º 3
0
        /// <summary>
        /// Creates new PlayGameMenuScreen
        /// </summary>
        public PlayGameMenuScreen()
            : base("Play Game")
        {
            MenuEntry campaign = new MenuEntry("Campaign");
            MenuEntry arcade = new MenuEntry("Arcade Mode");
            MenuEntry practice = new MenuEntry("Training");
            MenuEntry back = new MenuEntry("Back");

            campaign.Selected += new EventHandler<PlayerIndexEventArgs>(campaign_Selected);
            arcade.Selected += new EventHandler<PlayerIndexEventArgs>(arcade_Selected);
            practice.Selected += new EventHandler<PlayerIndexEventArgs>(practice_Selected);
            back.Selected += OnCancel;

            MenuEntries.Add(campaign);
            MenuEntries.Add(arcade);
            MenuEntries.Add(practice);
            MenuEntries.Add(back);
        }
Exemplo n.º 4
0
        public OptionsMenuScreen()
            : base("Game Options")
        {
            options = new Options();

#if PC
            options.ChangeSetting(Options.Setting.Fullscreen, DarkHavocGame.GameOptions.IsFullscreen);
#endif
            options.ChangeSetting(Options.Setting.Music, DarkHavocGame.GameOptions.IsMusic);
            options.ChangeSetting(Options.Setting.Sound, DarkHavocGame.GameOptions.IsSound);

#if PC
            fullscreen = new MenuEntry(string.Empty);
#endif
            music = new MenuEntry(string.Empty);
            sound = new MenuEntry(string.Empty);
            save = new MenuEntry("Save");
            back = new MenuEntry("Back");

#if PC
            fullscreen.Selected += new EventHandler<PlayerIndexEventArgs>(fullscreen_Selected);
#endif
            music.Selected += new EventHandler<PlayerIndexEventArgs>(music_Selected);
            sound.Selected += new EventHandler<PlayerIndexEventArgs>(sound_Selected);
            save.Selected += new EventHandler<PlayerIndexEventArgs>(save_Selected);
            back.Selected += OnCancel;

            SetMenuText();

#if PC
            MenuEntries.Add(fullscreen);
#endif
            MenuEntries.Add(music);
            MenuEntries.Add(sound);
            MenuEntries.Add(save);
            MenuEntries.Add(back);
        }