示例#1
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public PauseMenuScreen(Game game)
            : base("Paused")
        {
            // Create our menu entries.
            MenuEntry resumeGameMenuEntry = new MenuEntry("Resume Game");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");

            // Hook up menu event handlers.
            resumeGameMenuEntry.Selected += OnCancel;
            quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;
            this.game = game;
            // Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);
        }
示例#2
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen(Game game)
            : base("Main Menu")
        {
            // Create our menu entries.
            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");
            MenuEntry fileLocation = new MenuEntry("Pop file browser");
            MenuEntry fileBrowser = new MenuEntry("In game file browser");
               this.game = game;
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            // Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;
            fileLocation.Selected += SetFileLocation;
            fileBrowser.Selected += displayFileBrowser;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(fileLocation);
            MenuEntries.Add(fileBrowser);
            MenuEntries.Add(exitMenuEntry);
        }