public override void updateMe(GameManager gameManager, MouseState MouseState) { if (!_closed) { base.updateMe(gameManager, MouseState); if (_lBox.SelectedItem != null) { _selectedLabel = _lBox.SelectedItem.Text; if (_selectedLabel == "Resume Game") { this.Close(); } if (_selectedLabel == "Switch Team") { if (gameManager.MatchController.Match != MatchType.DM) { _teamMenu.Open(); } else { gameManager.LocalCharacter.State = ActorState.Dying; } this.Close(); } if (_selectedLabel == "Leave Match") { endGame(gameManager); } if (_selectedLabel == "Close Game") { gameManager.SessionManager.Dispose(); _game.Exit(); this.Close(); } _lBox.SelectedItem = null; } } }
public void updateUI(Game1 Game, GameManager GameManager) { _score = GameManager.LocalCharacter.Score; _scoreLimit = GameManager.MatchController.ScoreLimit; _capLimit = GameManager.MatchController.CapLimit; _Health = GameManager.LocalCharacter.Health; if (GameManager.LocalCharacter.CurrentWeapon != null) { _ammo = GameManager.LocalCharacter.CurrentWeapon.AmmoCount; } _player = GameManager.LocalCharacter; colourStats(_ammo, out _ammoColour); colourStats(_Health, out _healthColour); if (GameManager == null) { _initDone = false; _teamMenu.Close(); _escMenu.Close(); _endGame.Close(); } if (!_initDone) { if (GameManager.MatchController.Match != MatchType.DM) { _teamMenu.Open(); _initDone = true; } } if (_teamMenu.Showing) { _teamMenu.updateMe(GameManager, Game.MouseState); _game.IsMouseVisible = true; } else if (_escMenu.Showing) { _escMenu.updateMe(GameManager, Game.MouseState); _game.IsMouseVisible = true; } else if (_endGame.Showing) { _endGame.updateMe(GameManager, Game.MouseState); _game.IsMouseVisible = true; } else { _game.IsMouseVisible = false; } doEscMenuUI(); if (GameManager.MatchController.MatchDone) { _endGame.Open(); } oldMouse = _game.MouseState; }