本文整理汇总了C#中MainMenu.AddMenuItem方法的典型用法代码示例。如果您正苦于以下问题:C# MainMenu.AddMenuItem方法的具体用法?C# MainMenu.AddMenuItem怎么用?C# MainMenu.AddMenuItem使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MainMenu
的用法示例。
在下文中一共展示了MainMenu.AddMenuItem方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Update
protected override void Update(GameTime gameTime)
{
if (metaState == MetaState.InitialLoad)
{
splashScreen = new SplashScreen();
metaState = MetaState.SplashScreen;
}
// Controls
//if (GamePad.GetState(Game.playerIndex).Buttons.Back == ButtonState.Pressed)
// this.Exit();
if (HighScoreTracker.device!=null && Keyboard.GetState().IsKeyDown(Keys.Escape))
{
HighScoreData data = HighScoreTracker.LoadHighScores();
data.soundEffectsEnabled = gameSettings.soundEffectsEnabled;
data.musicEnabled = gameSettings.musicEnabled;
data.displayHelp = gameSettings.displayControls;
data.wideScreen = gameSettings.wideScreen;
data.keyboardControls = gameSettings.keyboardControls;
HighScoreTracker.SaveHighScores(data);
Logger.CloseLogger();
this.Exit();
}
if (metaState == MetaState.SplashScreen)
{
if (MenuResult.GoToMainMenu == splashScreen.Update(gameTime))
{
base.Initialize();
try
{
if (Guide.IsVisible == true)
splashScreen.stillActive = true;
else
StorageDevice.BeginShowSelector(this.GetDevice, "Select Storage Device");
}
catch
{
splashScreen.stillActive = true;
}
}
}
if (HighScoreTracker.device != null && HighScoreTracker.device.IsConnected == true)
{
showRetry = false;
}
if (backToRetry == true || (HighScoreTracker.device != null && showRetry == false && HighScoreTracker.device.IsConnected == false))
{
if (Guide.IsVisible == false)
{
try
{
StorageDevice.BeginShowSelector(this.RetryDevice, "Select Storage Device");
backToRetry = false;
showRetry = true;
}
catch
{
}
}
}
if (metaState == MetaState.SplashScreen && deviceSelected==true)
{
HighScoreData data = HighScoreTracker.LoadHighScores();
gameSettings = new GameSettings();
gameSettings.displayControls = data.displayHelp;
gameSettings.musicEnabled = data.musicEnabled;
gameSettings.soundEffectsEnabled = data.soundEffectsEnabled;
gameSettings.fullScreen = data.fullScreen;
gameSettings.wideScreen = data.wideScreen;
gameSettings.keyboardControls = data.keyboardControls;
currentSettings = new Settings();
p1engine = new Engine(-1);
mainMenu = new MainMenu();
pauseMenu = new PauseMenu();
summaryMenu = new SummaryMenu(false);
gameOverMenu = new GameOverMenu();
selectMenu = new LevelSelectMenu();
tutorialLauncher = new TutorialLauncher();
settingsMenu = new Menu(MenuClass.SettingsMenu);
currentSettings = new Settings();
p1engine = new Engine(-1);
mainMenu = new MainMenu();
pauseMenu = new PauseMenu();
summaryMenu = new SummaryMenu(false);
gameOverMenu = new GameOverMenu();
selectMenu = new LevelSelectMenu();
tutorialLauncher = new TutorialLauncher();
settingsMenu = new Menu(MenuClass.SettingsMenu);
if(Guide.IsTrialMode)
mainMenu.AddMenuItem(MenuResult.GoToTutorial, "Tutorial", "Learn to play Jellyfish, MD");
mainMenu.AddMenuItem(MenuResult.GoToTimeAttack, "Emergency Room", "Score as many points as you can within the \ntime limit.");
mainMenu.AddMenuItem(MenuResult.GoToMoveChallenge, "Operation", "Score as many points as you can with a \nlimited number of moves.");
mainMenu.AddMenuItem(MenuResult.GoToPuzzle, "Challenge", "Solve a series of unique challenges.");
if(Guide.IsTrialMode==false)
mainMenu.AddMenuItem(MenuResult.GoToTutorial, "Tutorial", "Learn to play Jellyfish, MD");
mainMenu.AddMenuItem(MenuResult.BuyFullGame, "Unlock Full Game", "Purchase the full version of Jellyfish, MD");
mainMenu.AddMenuItem(MenuResult.GoToJellyfishCity, "Jellyfish Parade", "Check in on your former patients!");
//.........这里部分代码省略.........