void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { List<GameScreen> screensToLoad = new List<GameScreen>(); screensToLoad.Add(new GameplayScreen(leveli)); //screensToLoad.Add(new TowerScreen(5)); LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, screensToLoad.ToArray()); }
/// <summary> /// Event handler for when an available session menu entry is selected. /// </summary> void AvailableSessionMenuEntrySelected(object sender, PlayerIndexEventArgs e) { // Which menu entry was selected? AvailableSessionMenuEntry menuEntry = (AvailableSessionMenuEntry)sender; AvailableNetworkSession availableSession = menuEntry.AvailableSession; try { // Begin an asynchronous join network session operation. IAsyncResult asyncResult = NetworkSession.BeginJoin(availableSession, null, null); // Activate the network busy screen, which will display // an animation until this operation has completed. NetworkBusyScreen busyScreen = new NetworkBusyScreen(asyncResult); busyScreen.OperationCompleted += JoinSessionOperationCompleted; ScreenManager.AddScreen(busyScreen, ControllingPlayer); } catch (Exception exception) { NetworkErrorScreen errorScreen = new NetworkErrorScreen(exception); ScreenManager.AddScreen(errorScreen, ControllingPlayer); } }
void ControlsMenuEntrySelected(object sender, PlayerIndexEventArgs e) { if (e.PlayerIndex == ControllingPlayer) { ScreenManager.AddScreen(new ControlsScreen(), ControllingPlayer); } }
/// <summary> /// Event handler for when the Play Game menu entry is selected. /// </summary> void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { // Tell all the current screens to transition off. foreach (GameScreen screen in ScreenManager.GetScreens()) screen.ExitScreen(); ScreenManager.AddScreen(new GameplayScreen(), e.PlayerIndex); }
/// <summary> /// Event handler for when the Play Game menu entry is selected. /// </summary> void HighScoresEntrySelected(object sender, PlayerIndexEventArgs e) { //LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, // new GameplayScreen()); if (e.PlayerIndex == ControllingPlayer) { ScreenManager.AddScreen(new HighScoreScreen(), ControllingPlayer); } }
/// <summary> /// Event handler for when the Hard menu entry is selected. /// </summary> void hardMenuEntrySelected(object sender, PlayerIndexEventArgs e) { if (ControllingPlayer == e.PlayerIndex) { NarlyGame.difficulty = NarlyGame.Difficulty.Hard; LoadingScreen.Load(ScreenManager, true, ControllingPlayer, new GameplayScreen(song)); } }
void player_Selected(object sender, PlayerIndexEventArgs e) { //this is the correct way //towersmash.players[(int)e.PlayerIndex] = !towersmash.players[(int)e.PlayerIndex]; //need to be able to test out code solo, this is broken code to be used only for testing towersmash.players[i] = true; i++; SetText(); }
private void SoundMenuEntrySelected(object sender, PlayerIndexEventArgs e) { _soundVolme++; if (_soundVolme > 10) _soundVolme = 0; MediaPlayer.Volume = (float) _soundVolme/10; SetMenuEntryText(); }
/// <summary> /// Event handler for when the Quit Game menu entry is selected. /// </summary> void QuitGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { const string message = "Are you sure you want to quit this game?"; MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(message); confirmQuitMessageBox.Accepted += ConfirmQuitMessageBoxAccepted; ScreenManager.AddScreen(confirmQuitMessageBox, ControllingPlayer); }
/// <summary> /// Event handler for when the Easy menu entry is selected. /// </summary> void easyMenuEntrySelected(object sender, PlayerIndexEventArgs e) { if (e.PlayerIndex == ControllingPlayer) { NarlyGame.difficulty = NarlyGame.Difficulty.Easy; //ScreenManager.AddScreen(new SongSelectionScreen(), e.PlayerIndex); LoadingScreen.Load(ScreenManager, true, ControllingPlayer, new GameplayScreen(song)); } }
/// <summary> /// Event handler for when the Play Game menu entry is selected. /// </summary> void PlayMenuEntrySelected(object sender, PlayerIndexEventArgs e) { const string message = "PlayBack Functionality is not implemented yet."; MessageBoxScreen playMessageBox = new MessageBoxScreen(message); playMessageBox.Accepted += PlayMessageBoxAccepted; ScreenManager.AddScreen(playMessageBox, e.PlayerIndex); // LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, // new GameplayScreen()); }
void saveEntry_Selected(object sender, PlayerIndexEventArgs e) { Screen[] screens = ScreenManager.GetScreens(); foreach (Screen screen in screens) { if (screen is PinEditScreen) { ((PinEditScreen)screen).SavePins(); } } OnCancel(sender, e); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to quit" message box. This uses the loading screen to /// transition from the game back to the main menu screen. /// </summary> void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { Screen[] screens = ScreenManager.GetScreens(); foreach (Screen screen in screens) { if (screen is PinEditScreen) { ScreenManager.RemoveScreen(screen); } } ScreenManager.AddScreen(new PhotoSetMenuScreen(), null); this.ExitScreen(); }
void start_Selected(object sender, PlayerIndexEventArgs e) { towersmash.updatenumberofplayers(); //if (counter > 1) { base.OnCancel(sender, e); LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new pvp(ScreenManager)); } //else //{ // MessageBoxScreen messagebox = new MessageBoxScreen("Must have at least 2 players ready for battle!"); // ScreenManager.AddScreen(messagebox, null); //} }
void exitMenuEntrySelected(object sender, PlayerIndexEventArgs e) { if (!(this.keyboardEnabled || this.kinectEnabled)) { QuestionMenuScreen question = new QuestionMenuScreen("At least one input must be enabled.", new string[] { "Ok" }); ScreenManager.AddScreen(question, null); } else { ProgramSettings.ChangeSetting(Setting.KeyboardEnabled, this.keyboardEnabled.ToString()); ProgramSettings.ChangeSetting(Setting.KinectEnabled, this.kinectEnabled.ToString()); this.ExitScreen(); } }
/// <summary> /// Event handler for when the levelSelector entry is selected /// </summary> void SelectLevelEntrySelected(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new MenuBackgroundScreen("LevelSelectionIcons_SD//LevelSelectionBackground1_SD"), new LevelSelector()); }
/// <summary> /// Event handler for when the Play Game menu entry is selected. /// </summary> void ArtistMenuEntrySelected(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, Global.artistModeScreen); }
/// <summary> /// Event handler for when the Frobnicate menu entry is selected. /// </summary> void FrobnicateMenuEntrySelected(object sender, PlayerIndexEventArgs e) { frobnicate = !frobnicate; SetMenuEntryText(); }
/// <summary> /// Event handler for when the Options menu entry is selected. /// </summary> void OptionsMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new OptionsMenuScreen(), e.PlayerIndex); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to quit" message box. This uses the loading screen to /// transition from the game back to the main menu screen. /// </summary> void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }
/// <summary> /// Event handler for when the Frobnicate menu entry is selected. /// </summary> void fullScreenMenuEntrySelected(object sender, PlayerIndexEventArgs e) { fullScreen = !fullScreen; ScreenManager.Graphics.IsFullScreen = fullScreen; ScreenManager.Graphics.ApplyChanges(); DefaultSettings.FullScreen = fullScreen; DefaultSettings.Save(); SetMenuEntryText(); }
void nextLevelMenuEntrySelected(object sender, PlayerIndexEventArgs e) { OptionsMenuScreen.SwitchToNextBoard(); LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen()); }
void LvL10(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen()); Debug.WriteLine("lvl10"); }
/// <summary> /// Event handler for when the Play Game menu entry is selected. /// </summary> void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, true, e.PlayerIndex, new GameplayScreen()); }
private void LevelMenuEntrySelected(object sender, PlayerIndexEventArgs e) { string levelFileName = MenuEntries[SelectedEntry].Text + ".lvl"; string gunFileName = MenuEntries[SelectedEntry].Text.Split(' ')[0] + ".gun"; WeaponChallenge challenge = ActivePlayer.Profile.GetWeaponChallenge(levelFileName); // Load the level selected if (challenge.Status != GameObjects.LevelStatus.Locked) { if (Guide.IsTrialMode && SelectedEntry > 1) { if (ActivePlayer.Profile.IsXboxLiveEnabled() && !Guide.IsVisible) { // Trial mode players can only play first two levels. Offer purchase Guide.ShowMarketplace(ActivePlayer.PlayerIndex); } else { // Play failed sound effect failedSFX.Play(); } } else { ShooterGameType gameType = challenge.GameType; float targetScoreOrTime = challenge.TargetScoreOrTime; // Create message string string message = string.Empty; if (gameType == ShooterGameType.Targets) { message = "Shoot all of the targets."; } else if (gameType == ShooterGameType.TargetScore) { message = "Get a High Score over " + (int)targetScoreOrTime + "."; } else if (gameType == ShooterGameType.TimeTrial) { message = "Complete level in under " + targetScoreOrTime.ToString("F") + " secs."; } else if (gameType == ShooterGameType.Collection) { message = "Find and collect the Grenade."; } else if (gameType == ShooterGameType.BullseyeChallenge) { message = "Get a Bullseye on every target."; } else if (gameType == ShooterGameType.HeadshotChallenge) { message = "Get a Headshot on every target."; } ShooterGameScreen.originalGunName = ActivePlayer.Profile.SelectedWeaponName; LoadingScreen.Load(ScreenManager, true, message, ActivePlayer.PlayerIndex, new ShooterGameScreen(levelFileName, gunFileName, gameType, targetScoreOrTime)); } } else { // Play failed sound effect failedSFX.Play(); } }
void MenuEntry3Selected(object sender, PlayerIndexEventArgs e) { Global.currentAnswerPos = 3; ScreenManager.AddScreen(new ArtistAnswerModeScreen(), e.PlayerIndex); }
/// <summary> /// Event handler for when the Elf menu entry is selected. /// </summary> void ElfMenuEntrySelected(object sender, PlayerIndexEventArgs e) { elf++; SetMenuEntryText(); }
/// <summary> /// Event handler for when the About Game menu entry is selected. /// </summary> private void AboutGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new AboutGameScreen(), e.PlayerIndex); }
void ExitMenuEntrySelected(object sender, PlayerIndexEventArgs e) { this.ExitScreen(); }
/// <summary> /// Event handler for when the Ungulate menu entry is selected. /// </summary> void UngulateMenuEntrySelected(object sender, PlayerIndexEventArgs e) { currentUngulate++; if (currentUngulate > Ungulate.Llama) currentUngulate = 0; SetMenuEntryText(); }
void inputMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new InputMenuScreen(), null); }
/// <summary> /// Event handler for when the sound menu entry is selected. /// </summary> void FrobnicateMenuEntrySelected(object sender, PlayerIndexEventArgs e) { sound = !sound; SetMenuEntryText(); }
/// <summary> /// Event handler for when the Elf menu entry is selected. /// </summary> void resolutionMenuEntrySelected(object sender, PlayerIndexEventArgs e) { SelectedMode++; if (SelectedMode > supportedModes.Count - 1) SelectedMode = 0; DefaultSettings.ScreenWidth = supportedModes[SelectedMode].Width; DefaultSettings.ScreenHeight = supportedModes[SelectedMode].Height; DefaultSettings.Save(); ScreenManager.Graphics.PreferredBackBufferWidth = DefaultSettings.ScreenWidth; ScreenManager.Graphics.PreferredBackBufferHeight = DefaultSettings.ScreenHeight; ScreenManager.Graphics.ApplyChanges(); SetMenuEntryText(); }
/// <summary> /// Event handler for when the Ungulate menu entry is selected. /// </summary> void computerlevelMenuEntrySelected(object sender, PlayerIndexEventArgs e) { currentLevel++; if (currentLevel > Difficulty.Hard) currentLevel = 0; DefaultSettings.Difficulty = (int)currentLevel; DefaultSettings.Save(); SetMenuEntryText(); }
/// <summary> /// Event handler for when the Highscore menu entry is selected. /// </summary> void HighscoreMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new HighscoreMenuScreen(), e.PlayerIndex); }
/// <summary> /// Event handler for when the Language menu entry is selected. /// </summary> void multisamplingtypeMenuEntrySelected(object sender, PlayerIndexEventArgs e) { int level = (int)multisamplingType; if (level == 0 || level == 1 || level == 2 || level == 4 || level == 8 || level == 16) { // ok multisample } else { multisamplingType = 0; } if (multisamplingType == 0) multisamplingType++; else multisamplingType = (MultiSampleType)((int)multisamplingType * 2); if (multisamplingType > MultiSampleType.SixteenSamples) multisamplingType = 0; SurfaceFormat format = GraphicsAdapter.DefaultAdapter.CurrentDisplayMode.Format; // Check for 4xAA if (GraphicsAdapter.DefaultAdapter.CheckDeviceMultiSampleType(DeviceType.Hardware, format, false, multisamplingType)) { // it supports!!!! } else { multisamplingType = 0; } if (multisamplingType == 0) DefaultSettings.MultiSampleAntiAlias = false; else DefaultSettings.MultiSampleAntiAlias = true; DefaultSettings.MultiSamplingLevel = multisamplingType; DefaultSettings.Save(); SetMenuEntryText(); }
/// <summary> /// Event handler for when the Language menu entry is selected. /// </summary> void LanguageMenuEntrySelected(object sender, PlayerIndexEventArgs e) { currentLanguage = (currentLanguage + 1) % languages.Length; SetMenuEntryText(); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to exit" message box. /// </summary> void ConfirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { ScreenManager.Game.Exit(); }
/// <summary> /// Helper overload makes it easy to use OnCancel as a MenuEntry event handler. /// </summary> protected void OnCancel(object sender, PlayerIndexEventArgs e) { OnCancel(e.PlayerIndex); }
/// <summary> /// Event handler for when the Play Game menu entry is selected. /// </summary> void PlayGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new DifficultyMenuScreen(), e.PlayerIndex); }
private void SettingsGameMenuEntrySelected(object sender, PlayerIndexEventArgs e) { // Add options screen ScreenManager.AddScreen(new OptionsMenuScreen(), ActivePlayer.PlayerIndex); }
private void MedalsMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new MedalsMenuScreen(0, MedalsMenuScreen.TRANSITION_ON_TIME), ActivePlayer.PlayerIndex); }
void dissectionRotationMenuEntrySelected(object sender, PlayerIndexEventArgs e) { QuestionMenuScreen questionMenu = new QuestionMenuScreen("Dissection rotations should be", new string[] { DissectionStepSize.Slow.ToString(), DissectionStepSize.Medium.ToString(), DissectionStepSize.Fast.ToString(), "Back" }); questionMenu.OptionSelected += new OptionSelectedEventHandler(dissectionRotationQuestionMenuOptionSelected); ScreenManager.AddScreen(questionMenu, null); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to quit" message box. This uses the loading screen to /// transition from the game back to the main menu screen. /// </summary> void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, false, ActivePlayer.PlayerIndex, new BackgroundScreen(), new MainMenuScreen()); }
void graphicsMenuEntrySelected(object sender, PlayerIndexEventArgs e) { ResolutionMenuScreen resolutionMenu = new ResolutionMenuScreen(); ScreenManager.AddScreen(resolutionMenu, null); }
/// <summary> /// Event handler for when the user selects ok on the "are you sure /// you want to quit" message box. This uses the loading screen to /// transition from the game back to the main menu screen. /// </summary> void ConfirmQuitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { MediaPlayer.Stop(); LoadingScreen.Load(ScreenManager, false, null, new BackgroundScreen(), new MainMenuScreen()); }
void ConfirmExitMessageBoxAccepted(object sender, PlayerIndexEventArgs e) { ScreenManager.Game.Exit(); }