Exemple #1
0
        // Audio audioHelper)
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public MainMenuScreen()
            : base(Resources.MainMenu, false)
        {
            // Create our menu entries.
            MenuEntry trainingMenuEntry = new MenuEntry(Resources.Training);
            MenuEntry multiplayerMenuEntry = new MenuEntry(Resources.Multiplayer);
            MenuEntry theatherMenuEntry = new MenuEntry(Resources.Theather);
            MenuEntry assemblerMenuEntry = new MenuEntry(Resources.Assembler);
            MenuEntry optionsMenuEntry = new MenuEntry(Resources.Options);
            MenuEntry exitMenuEntry = new MenuEntry(Resources.Exit);

            // Hook up menu event handlers.
            trainingMenuEntry.Selected += TrainingMenuEntrySelected;
            multiplayerMenuEntry.Selected += MultiplayerMenuEntrySelected;
            theatherMenuEntry.Selected += TheatherMenuEntrySelected;
            assemblerMenuEntry.Selected += AssemblerMenuEntrySelected;
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            exitMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(trainingMenuEntry);
            MenuEntries.Add(multiplayerMenuEntry);
            MenuEntries.Add(theatherMenuEntry);
            MenuEntries.Add(assemblerMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
            MenuEntries.Add(exitMenuEntry);
        }
        //Audio audioHelper, Cue mystery)
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public CreateOrFindSessionScreen(ScreenManager screenManager, NetworkSessionType sessionType, AudioManager audioManager)
            : base(GetMenuTitle(sessionType), false)
        {
            networkHelper = new NetworkHelper();
            networkInterface = new NetworkInterface();
            networkInterface.InitNetwork(screenManager.Game);
            this.audioManager = audioManager;
            //this.audioHelper = audioHelper;
            //this.mystery = mystery;
            this.sessionType = sessionType;

            // Create our menu entries.
            MenuEntry createSessionMenuEntry = new MenuEntry(Resources.CreateSession);
            MenuEntry findSessionsMenuEntry = new MenuEntry(Resources.FindSessions);
            MenuEntry backMenuEntry = new MenuEntry(Resources.Back);

            // Hook up menu event handlers.
            createSessionMenuEntry.Selected += CreateSessionMenuEntrySelected;
            findSessionsMenuEntry.Selected += FindSessionsMenuEntrySelected;
            backMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(createSessionMenuEntry);
            MenuEntries.Add(findSessionsMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }
Exemple #3
0
        //Audio audioHelper,Cue mystery)
        /// <summary>
        /// Constructs a menu screen listing the available network sessions.
        /// </summary>
        public JoinSessionScreen(AvailableNetworkSessionCollection availableSessions)
            : base(Resources.JoinSession, false)
        {
            this.availableSessions = availableSessions;
            //this.audioHelper = audioHelper;
            //this.mystery = mystery;

            foreach (AvailableNetworkSession availableSession in availableSessions)
            {
                // Create menu entries for each available session.
                MenuEntry menuEntry = new AvailableSessionMenuEntry(availableSession);
                menuEntry.Selected += AvailableSessionMenuEntrySelected;
                MenuEntries.Add(menuEntry);

                // Matchmaking can return up to 25 available sessions at a time, but
                // we don't have room to fit that many on the screen. In a perfect
                // world we should make the menu scroll if there are too many, but it
                // is easier to just not bother displaying more than we have room for.
                if (MenuEntries.Count >= MaxSearchResults)
                    break;
            }

            // Add the Back menu entry.
            MenuEntry backMenuEntry = new MenuEntry(Resources.Back);
            backMenuEntry.Selected += BackMenuEntrySelected;
            MenuEntries.Add(backMenuEntry);
        }
Exemple #4
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public RespawnScreen(NetworkSession networkSession)
            : base(Resources.Respawn, true)
        {
            this.networkSession = networkSession;

            // Flag that there is no need for the game to transition
            // off when the pause menu is on top of it.
            IsPopup = true;

            // Add the Resume Game menu entry.
            MenuEntry resumeGameMenuEntry = new MenuEntry(Resources.ResumeGame);
            resumeGameMenuEntry.Selected += OnCancel;
        }
Exemple #5
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public PauseMenuScreen(NetworkSession networkSession)
            : base(Resources.Paused, false)
        {
            this.networkSession = networkSession;

            // Flag that there is no need for the game to transition
            // off when the pause menu is on top of it.
            IsPopup = true;

            // Add the Resume Game menu entry.
            MenuEntry resumeGameMenuEntry = new MenuEntry(Resources.ResumeGame);
            resumeGameMenuEntry.Selected += OnCancel;
            MenuEntry optionsMenuEntry = new MenuEntry(Resources.Options);
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);

            if (networkSession == null)
            {
                // If this is a single player game, add the Quit menu entry.
                MenuEntry quitGameMenuEntry = new MenuEntry(Resources.QuitGame);
                quitGameMenuEntry.Selected += QuitGameMenuEntrySelected;
                MenuEntries.Add(quitGameMenuEntry);
            }
            else
            {
                // If we are hosting a network game, add the Return to Lobby menu entry.
                if (networkSession.IsHost)
                {
                    MenuEntry lobbyMenuEntry = new MenuEntry(Resources.ReturnToLobby);
                    lobbyMenuEntry.Selected += ReturnToLobbyMenuEntrySelected;
                    MenuEntries.Add(lobbyMenuEntry);
                }

                // Add the End/Leave Session menu entry.
                string leaveEntryText = networkSession.IsHost ? Resources.EndSession :
                                                                Resources.LeaveSession;

                MenuEntry leaveSessionMenuEntry = new MenuEntry(leaveEntryText);
                leaveSessionMenuEntry.Selected += LeaveSessionMenuEntrySelected;
                MenuEntries.Add(leaveSessionMenuEntry);
            }
        }
        /// <summary>
        /// Constructor.
        /// </summary>
        public SessionPropertiesPopUpScreen(NetworkSession networkSession)
            : base(Resources.Paused, false)
        {
            this.networkSession = networkSession;
            GetVariables();

            // Flag that there is no need for the game to transition
            // off when the pause menu is on top of it.
            IsPopup = true;

            MenuEntry levelMenuEntry = new MenuEntry(Resources.Level);
            MenuEntry gameModeMenuEntry = new MenuEntry(Resources.GameMode);
            MenuEntry weaponsMenuEntry = new MenuEntry(Resources.Weapons);
            MenuEntry scoreToWinMenuEntry = new MenuEntry(Resources.ScoreToWin);
            MenuEntry noofbotsMenuEntry = new MenuEntry(Resources.NumberOfBots);
            MenuEntry lobbyMenuEntry = new MenuEntry(Resources.ReturnToLobby);

            levelMenuEntry.Selected += LevelMenuEntrySelected;
            gameModeMenuEntry.Selected += GameModeMenuEntrySelected;
            weaponsMenuEntry.Selected += WeaponsMenuEntrySelected;
            scoreToWinMenuEntry.Selected += ScoreToWinMenuEntrySelected;
            noofbotsMenuEntry.Selected += NoOfBotsMenuEntrySelected;
            lobbyMenuEntry.Selected += ReturnToLobbyMenuEntrySelected;

            MenuEntries.Add(levelMenuEntry);
            MenuEntries.Add(gameModeMenuEntry);
            MenuEntries.Add(weaponsMenuEntry);
            MenuEntries.Add(scoreToWinMenuEntry);
            MenuEntries.Add(noofbotsMenuEntry);
            //MenuEntries.Add(lobbyMenuEntry);

            // Add the Resume Game menu entry.
            MenuEntry resumeGameMenuEntry = new MenuEntry(Resources.ResumeGame);
            resumeGameMenuEntry.Selected += OnCancel;
            MenuEntry optionsMenuEntry = new MenuEntry(Resources.Options);
            optionsMenuEntry.Selected += OptionsMenuEntrySelected;
            MenuEntries.Add(resumeGameMenuEntry);
            MenuEntries.Add(optionsMenuEntry);
        }
        /// <summary>
        /// Constructor fills in the menu contents.
        /// </summary>
        public SessionPropertiesScreen(ScreenManager screenManager, NetworkSessionType sessionType, //Audio audioHelper, Cue mystery
            bool createSession, NetworkHelper networkHelper)
            : base(Resources.SessionProperties + GetMenuTitle(sessionType), false)
        {
            if (networkHelper != null)
                this.networkHelper = networkHelper;
            else
                this.networkHelper = new NetworkHelper();
            networkInterface = new NetworkInterface();
            networkInterface.InitNetwork(screenManager.Game);

            //this.audioHelper = audioHelper;
            //this.mystery = mystery;
            this.sessionType = sessionType;
            //famas_1 = audioHelper.GetCue("famas-1");

            this.createSession = createSession;

            // Create our menu entries.
            MenuEntry levelMenuEntry = new MenuEntry(Resources.Level);
            MenuEntry gameModeMenuEntry = new MenuEntry(Resources.GameMode);
            MenuEntry weaponsMenuEntry = new MenuEntry(Resources.Weapons);
            MenuEntry scoreToWinMenuEntry = new MenuEntry(Resources.ScoreToWin);
            MenuEntry createSessionMenuEntry = new MenuEntry(Resources.CreateSession);
            MenuEntry searchSessionMenuEntry = new MenuEntry(Resources.SearchSessions);
            MenuEntry StartGameMenuEntry = new MenuEntry(Resources.StartGame);
            MenuEntry noofbotsMenuEntry = new MenuEntry(Resources.NumberOfBots);
            MenuEntry backMenuEntry = new MenuEntry(Resources.Back);

            if (createSession)
            {
                level = NetworkSessionComponent.Level.shipMap;
                gameModeType = NetworkSessionComponent.GameMode.DeathMatch;
                weaponsType = NetworkSessionComponent.Weapons.Normal;
                scoreToWinType = NetworkSessionComponent.ScoreToWin.One;
                noOfBots = NetworkSessionComponent.NoOfBots.Ten;
            }
            else
            {
                level = NetworkSessionComponent.Level.Any;
                gameModeType = NetworkSessionComponent.GameMode.Any;
                weaponsType = NetworkSessionComponent.Weapons.Any;
                scoreToWinType = NetworkSessionComponent.ScoreToWin.Any;
                noOfBots = NetworkSessionComponent.NoOfBots.Any;
            }

            // Hook up menu event handlers.
            levelMenuEntry.Selected += LevelMenuEntrySelected;
            gameModeMenuEntry.Selected += GameModeMenuEntrySelected;
            weaponsMenuEntry.Selected += WeaponsMenuEntrySelected;
            scoreToWinMenuEntry.Selected += ScoreToWinMenuEntrySelected;
            createSessionMenuEntry.Selected += CreateSessionMenuEntrySelected;
            searchSessionMenuEntry.Selected += SearchSessionsMenuEntrySelected;
            StartGameMenuEntry.Selected += StartGameMenuEntrySelected;
            noofbotsMenuEntry.Selected += NoOfBotsMenuEntry;
            backMenuEntry.Selected += OnCancel;

            // Add entries to the menu.
            MenuEntries.Add(levelMenuEntry);
            MenuEntries.Add(gameModeMenuEntry);
            MenuEntries.Add(weaponsMenuEntry);
            MenuEntries.Add(scoreToWinMenuEntry);
            MenuEntries.Add(noofbotsMenuEntry);

            if (sessionType != NetworkSessionType.Local)
                if (createSession)
                    MenuEntries.Add(createSessionMenuEntry);
                else
                    MenuEntries.Add(searchSessionMenuEntry);
            else
                MenuEntries.Add(StartGameMenuEntry);
            MenuEntries.Add(backMenuEntry);
        }