void DifficultyMenuEntrySelected(object sender, PlayerIndexEventArgs e) { currentDifficulty++; if (currentDifficulty > Difficulties.Hard) currentDifficulty = 0; ScreenManager.DiffucultyLevel = (int)currentDifficulty; SetMenuEntryText(); }
void OnNetworkGameSelected(object sender, PlayerIndexEventArgs e) { /* ScreenManager.netManager = new NetworkManager(); ScreenManager.isNetworkGame = true; //if (ScreenManager.netManager.currentState == NetworkState.SignIn) ScreenManager.netManager.LogInUser(); LoadingScreen.Load(ScreenManager, new BackgroundScreenGame(), new GameplayScreen()); * */ ScreenManager.AddScreen(new NetworkGameMenu(e.PlayerIndex)); ExitScreen(); }
void ConfirmQuitAccepted(object sender, PlayerIndexEventArgs e) { // notify the other player that the game is ending if (isNetworkGame) { netManager.SendEndGameMessage(); netManager.CleanUpNetwork(); isNetworkGame = false; } // reload the main menu since all other screens have quit ScreenManager.AddScreen(new BackgroundScreen()); ScreenManager.AddScreen(new MainMenuScreen()); ExitScreen(); }
void UnpauseGame(object sender, PlayerIndexEventArgs e) { if (isNetworkGame) { ready = true; netManager.SendUnPauseMessage(); if (!netManager.RemoteReady) { resumeGameMenuEntry.DisplayText = "Ready to eat, awaiting opposing pasta..."; return; } } ExitScreen(); }
void SoundMenuEntrySelected(object sender, PlayerIndexEventArgs e) { sound = !sound; ScreenManager.SoundEnabled = sound; SetMenuEntryText(); }
void OnOptionsSelected(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new OptionsScreen()); ExitScreen(); }
void ConfirmExitSelected(object sender, PlayerIndexEventArgs e) { ScreenManager.Game.Exit(); }
void changeWinningScore(object sender, PlayerIndexEventArgs e) { //go through enumeration }
void JoinSession(object sender, PlayerIndexEventArgs e) { ScreenManager.AddScreen(new LocalNetworkGameMenu(currentPlayer, NetworkSession.Join(currentSessionSelected))); ScreenManager.RemoveScreen(this); }
void GoBack(object sender, PlayerIndexEventArgs e) { ExitScreen(); }
void FindLocalGame(object sender, PlayerIndexEventArgs e) { //ADD: pop up a window with games and info on them if (currentGamer != null) { AvailableNetworkSessionCollection sessions = NetworkSession.Find(NetworkSessionType.SystemLink, 1, netSessionProperties); ScreenManager.AddScreen(new SearchLocalNetworkScreen(currentPlayerIndex, sessions)); } else { Guide.ShowSignIn(1, false); if (currentGamer != null) { AvailableNetworkSessionCollection sessions = NetworkSession.Find(NetworkSessionType.SystemLink, 1, netSessionProperties); ScreenManager.AddScreen(new SearchLocalNetworkScreen(currentPlayerIndex, sessions)); } } }
void LiveSignIn(object sender, PlayerIndexEventArgs e) { currentGamer = SignedInGamer.SignedInGamers[currentPlayerIndex]; if (currentGamer != null) { opt1.DisplayText = "Currently signed in"; SetMenuEntryText(); } else { Guide.ShowSignIn(1, false); } }
void HostLocalGame(object sender, PlayerIndexEventArgs e) { if (currentGamer != null) { netSessionProperties[(int)SessionProperty.GameMode] = (int)GameMode.HeadToHead; netSessionProperties[(int)SessionProperty.WinningScore] = (int)HighScore.FiftyThousand; NetworkSession newSession = NetworkSession.Create(NetworkSessionType.Local, 1, 2, 0, netSessionProperties); ScreenManager.AddScreen(new LocalNetworkGameMenu(currentPlayerIndex, newSession)); } else { Guide.ShowSignIn(1, false); if (currentGamer != null) { netSessionProperties[(int)SessionProperty.GameMode] = (int)GameMode.HeadToHead; netSessionProperties[(int)SessionProperty.WinningScore] = 50000; NetworkSession newSession = NetworkSession.Create(NetworkSessionType.Local, 1, 2, 0, netSessionProperties); ScreenManager.AddScreen(new LocalNetworkGameMenu(currentPlayerIndex, newSession)); } } }
void startGame(object sender, PlayerIndexEventArgs e) { if (netSession.IsHost) { if (netSession.IsEveryoneReady) { netSession.StartGame(); foreach (SignedInGamer signedInGamer in SignedInGamer.SignedInGamers) { signedInGamer.Presence.PresenceMode = GamerPresenceMode.InCombat; } } } }
void setReady(object sender, PlayerIndexEventArgs e) { foreach (LocalNetworkGamer g in netSession.LocalGamers) { g.IsReady = true; opt3.DisplayText = "Ready! Waiting..."; } //set the ready flag for }
// Event handler for when the Play Game menu entry is selected. void PlayGameSelected(object sender, PlayerIndexEventArgs e) { LoadingScreen.Load(ScreenManager, new BackgroundScreenGame(),new GameplayScreen()); }
// Event handler for when the Quit Game menu entry is selected. void QuitGameSelected(object sender, PlayerIndexEventArgs e) { MessageBoxScreen confirmQuitMessageBox = new MessageBoxScreen(promptMessage, acceptMessage); confirmQuitMessageBox.Accepted += ConfirmQuitAccepted; ScreenManager.AddScreen(confirmQuitMessageBox); }
void changeGameType(object sender, PlayerIndexEventArgs e) { //implement different network gameplay }