public ReconnectControllerScreen()
            : base("")
        {
            okayEntry = new MenuEntry("Done");

            okayEntry.Selected += select;

            MenuEntries.Add(okayEntry);
        }
Ejemplo n.º 2
0
        public StartScreen()
            : base("")
        {
            menuCancel = new InputAction(new Buttons[] { }, new Keys[] { }, true);

            MenuEntry enter = new MenuEntry("Press A");

            enter.Selected += entry;

            MenuEntries.Add(enter);
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen(string text, bool music)
            : base(text)
        {
            //Create our menu entries.
            if (music)
                MusicManager.PlaySong("Title");

            MenuEntry playGameMenuEntry = new MenuEntry("Play Game");

            MenuEntry highScoresMenuEntry = new MenuEntry("High Scores");
            MenuEntry bossEntry = new MenuEntry("Bosses");

            MenuEntry howtospacehordes = new MenuEntry("How To Play");

            MenuEntry introEntry = new MenuEntry("Intro");

            MenuEntry creditsEntry = new MenuEntry("Credits");

            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry exitMenuEntry = new MenuEntry("Exit");

            //Hook up menu event handlers.
            playGameMenuEntry.Selected += PlayGameMenuEntrySelected;

            highScoresMenuEntry.Selected += HighScoresMenuEntrySelected;
            bossEntry.Selected += BossMenuEntrySelected;
            howtospacehordes.Selected += HowToSelected;
            introEntry.Selected += IntroMenuEntrySelected;
            creditsEntry.Selected += CreditEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            //Add entries to the menu.
            MenuEntries.Add(playGameMenuEntry);
            MenuEntries.Add(highScoresMenuEntry);

            #if !DEMO
            MenuEntries.Add(bossEntry);
            #endif
            MenuEntries.Add(howtospacehordes);
            MenuEntries.Add(introEntry);
            MenuEntries.Add(creditsEntry);

            //MenuEntries.Add(tutorialEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);

            SelectionChangeSound = "SelectChanged";
            SelectionSound = "Selection";
            CancelSound = "MenuCancel";
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Constructor
        /// </summary>
        public PauseMenuScreen()
            : base("Paused")
        {
            //Create our menu entries.
            resumeGameMenuEntry = new MenuEntry("Resume Game");
            MenuEntry optionsMenuEntry = new MenuEntry("Options");
            MenuEntry quitGameMenuEntry = new MenuEntry("Quit Game");

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

            //Add entries to the menu.
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(quitGameMenuEntry);

            SelectionChangeSound = "SelectChanged";
            SelectionSound = "Selection";
            CancelSound = "MenuCancel";
        }
        public override void Activate()
        {
            base.Activate();

#if XBOX
            if (StorageHelper.CheckStorage())
            {
                levels = ReadData();
            }
            else
            {
                levels = new bool[levelCount];
                levels[0] = true;
                levels[levelCount] = true;
            }
#endif
#if WINDOWS
            levels = ReadData();
#endif

           

            for (int i = 0; i < levelCount; ++i)
            {
                string text = "???";
                if (levels[i])
                {
                    text = levelTitles[i];
                }

                MenuEntry entry = new MenuEntry(text);

                if (levels[i])
                {
                    entry.Selected += new EventHandler<PlayerIndexEventArgs>(select);
                }
                MenuEntries.Add(entry);
            }
        }
        /// <summary>
        /// Reads the current saved settings.
        /// </summary>
        /// <param name="sound"></param>
        /// <param name="music"></param>
        public static void ReadSettings(out int sound, out int music, out bool fullscreen, out bool rumbleOn)
        {
            UpToDate();

            #if WINDOWS

            using (TextReader tr = new StreamReader(FilePath))
            {
                while (tr.ReadLine() != "[Sound]")
                {
                }

                sound = int.Parse(tr.ReadLine());

                while (tr.ReadLine() != "[Music]")
                {
                }

                music = int.Parse(tr.ReadLine());

                while (tr.ReadLine() != "[FullScreen]")
                {
                }

                switch (tr.ReadLine())
                {
                    case "On":
                        fullscreen = true;
                        break;

                    case "Off":
                        fullscreen = false;
                        break;

                    default:
                        fullscreen = false;
                        break;
                }

                while (tr.ReadLine() != "[Rumble]")
                { }

                switch (tr.ReadLine())
                {
                    case "On":
                        rumbleOn = true;
                        break;

                    case "Off":
                        rumbleOn = false;
                        break;

                    default:
                        rumbleOn = false;
                        break;
                }
            }
            #endif

            #if XBOX
            if (!StorageHelper.FileExists("settings.txt"))
            {
                WriteInitialSettings();
            }

            TextReader tr = new StreamReader(StorageHelper.OpenFile("settings.txt", FileMode.Open));

            while (tr.ReadLine() != "[Sound]")
            {
            }

            sound = int.Parse(tr.ReadLine());

            while (tr.ReadLine() != "[Music]")
            {
            }

            music = int.Parse(tr.ReadLine());

            while (tr.ReadLine() != "[FullScreen]")
            {
            }

            switch (tr.ReadLine())
            {
                case "On":
                    fullscreen = true;
                    break;

                case "Off":
                    fullscreen = false;
                    break;

                default:
                    fullscreen = false;
                    break;
            }

            while (tr.ReadLine() != "[Rumble]")
            {
            }

            switch (tr.ReadLine())
            {
                case "On":
                    rumbleOn = true;
                    break;

                case "Off":
                    rumbleOn = false;
                    break;

                default:
                    rumbleOn = false;
                    break;
            }

            fullscreen = true;

            tr.Close();
            #endif
        }