/// <summary>
        /// Constructor.
        /// </summary>
        public LevelSelectScreen()
            : base("Level Select")
        {
            // get save data
            saveGameData = new GameData();

            // Create our menu entries.
            level1MenuEntry = new VarSizeMenuEntry ( "1 - "+GameConstants.LEVELNAMES[0], 0.9f );
            level2MenuEntry = new VarSizeMenuEntry ( "2 - "+GameConstants.LEVELNAMES[1], 0.9f );
            level3MenuEntry = new VarSizeMenuEntry ( "3 - " + GameConstants.LEVELNAMES[2], 0.9f );
            level4MenuEntry = new VarSizeMenuEntry ( "4 - " + GameConstants.LEVELNAMES[3], 0.9f );
            level5MenuEntry = new VarSizeMenuEntry ( "5 - " + GameConstants.LEVELNAMES[4], 0.9f );
            level6MenuEntry = new VarSizeMenuEntry ( "6 - " + GameConstants.LEVELNAMES[5], 0.9f );

            MenuEntry back = new VarSizeMenuEntry ( "Back to Main Menu", 0.9f );

            // Hook up menu event handlers.
            level1MenuEntry.Selected += level1MenuEntrySelected;
            level2MenuEntry.Selected += level2MenuEntrySelected;
            level3MenuEntry.Selected += level3MenuEntrySelected;
            level4MenuEntry.Selected += level4MenuEntrySelected;
            level5MenuEntry.Selected += level5MenuEntrySelected;
            level6MenuEntry.Selected += level6MenuEntrySelected;
            back.Selected += OnCancel;

            // Add entries to the menu.

            MenuEntries.Add(level1MenuEntry);
            MenuEntries.Add(level2MenuEntry);
            MenuEntries.Add(level3MenuEntry);
            MenuEntries.Add(level4MenuEntry);
            MenuEntries.Add ( level5MenuEntry );
            MenuEntries.Add ( level6MenuEntry );
            MenuEntries.Add(back);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public StoryScreen( List<String> storytext, List<String> titletext, GameScreen DestScreen, GameData saveData)
            : base(titletext[0])
        {
            saveGameData = saveData;
            this.DestScreen = DestScreen;

            //SpriteFont font = ScreenManager.Font; //Get font of the ScreenManager
            // Create our menu entries.
            Storyline = storytext;
            StoryTitles = titletext;

            StorylineEntry = new VarSizeMenuEntry ( Storyline[0] , 0.7f);
            BlankEntry = new VarSizeMenuEntry ( " ", 0.7f);
            MenuEntry ContinueEntry = new VarSizeMenuEntry ( "Continue", 1f);

            // Hook up menu event handlers.
            ContinueEntry.Selected += continueSelected;

            // Add entries to the menu.
            MenuEntries.Add ( StorylineEntry );
            MenuEntries.Add ( BlankEntry );
            MenuEntries.Add ( ContinueEntry );

            //Select the first selectable entry
            while (menuEntries[selectedEntry].HasNoHandle)
            {
                selectedEntry++;
            }
        }