本文整理汇总了C#中InputManager.IsMenuDelete方法的典型用法代码示例。如果您正苦于以下问题:C# InputManager.IsMenuDelete方法的具体用法?C# InputManager.IsMenuDelete怎么用?C# InputManager.IsMenuDelete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类InputManager
的用法示例。
在下文中一共展示了InputManager.IsMenuDelete方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: HandleInput
public override void HandleInput(GameTime gameTime, InputManager input)
{
PlayerIndex dummyPlayerIndex;
if (input.IsMenuCancel(ControllingPlayer, out dummyPlayerIndex))
{
ExitScreen();
return;
}
// handle selecting a save game
if (input.IsMenuSelect(ControllingPlayer, out dummyPlayerIndex) &&
(mSaveGameDescriptions != null))
{
switch (mMode)
{
case SaveLoadScreenMode.Load:
if ((mCurrentSlot >= 0) &&
(mCurrentSlot < mSaveGameDescriptions.Count) &&
(mSaveGameDescriptions[mCurrentSlot] != null))
{
if (GameResources.GameDossier != null)
{
MessageBoxScreen messageBoxScreen = new MessageBoxScreen("Are you sure you want to load this game?");
messageBoxScreen.Accepted += ConfirmLoadMessageBoxAccepted;
ScreenManager.AddScreen(messageBoxScreen, ControllingPlayer);
}
else
{
ConfirmLoadMessageBoxAccepted(null, EventArgs.Empty);
}
}
break;
case SaveLoadScreenMode.Save:
if ((mCurrentSlot >= 0) &&
(mCurrentSlot <= mSaveGameDescriptions.Count))
{
if (mCurrentSlot == mSaveGameDescriptions.Count)
{
ConfirmSaveMessageBoxAccepted(null, EventArgs.Empty);
}
else
{
MessageBoxScreen messageBoxScreen = new MessageBoxScreen("Are you sure you want to overwrite this save game?");
messageBoxScreen.Accepted += ConfirmSaveMessageBoxAccepted;
ScreenManager.AddScreen(messageBoxScreen, ControllingPlayer);
}
}
break;
}
}
// handle deletion
else if (input.IsMenuDelete(ControllingPlayer) &&
(mSaveGameDescriptions != null))
{
if ((mCurrentSlot >= 0) &&
(mCurrentSlot < mSaveGameDescriptions.Count) &&
(mSaveGameDescriptions[mCurrentSlot] != null))
{
MessageBoxScreen messageBoxScreen = new MessageBoxScreen(
"Are you sure you want to delete this save game?");
messageBoxScreen.Accepted += ConfirmDeleteMessageBoxAccepted;
ScreenManager.AddScreen(messageBoxScreen, ControllingPlayer);
}
}
// handle cursor-down
else if (input.IsMenuDown(ControllingPlayer) &&
(mSaveGameDescriptions != null))
{
int maximumSlot = mSaveGameDescriptions.Count;
if (mMode == SaveLoadScreenMode.Save)
{
maximumSlot = Math.Min(maximumSlot + 1,
MaximumSaveGameDescriptions);
}
if (mCurrentSlot < maximumSlot - 1)
{
mCurrentSlot++;
}
}
// handle cursor-up
else if (input.IsMenuUp(ControllingPlayer) &&
(mSaveGameDescriptions != null))
{
if (mCurrentSlot >= 1)
{
mCurrentSlot--;
}
}
}