示例#1
0
 public override void ActivateItem(Game1 game)
 {
     if (this.items[GetCurrentItemX(), GetCurrentItemY()] is PowerUpMenuItem)
     {
         PowerUpMenuItem newSelected = (PowerUpMenuItem)items[GetCurrentItemX(), GetCurrentItemY()];
         if (selected != newSelected &&
             game.GetPowerUpManager().GetUnlockedPowerUps().Contains(newSelected.GetPowerUp()) &&
             !game.GetPowerUpManager().AbilityUsed(newSelected.GetPowerUp()) &&
             newSelected.GetPowerUp() != PowerUps.NULL)
         {
             selected.SetIsSelected(false);
             selected = newSelected;
             base.ActivateItem(game);
         }
     }
     else
     {
         base.ActivateItem(game);
     }
 }
示例#2
0
 public override void UpdateMenu(Game1 game)
 {
     foreach (IMenuItem i in items)
     {
         if (i is PowerUpMenuItem)
         {
             PowerUpMenuItem i2 = (PowerUpMenuItem)i;
             if (!i2.GetIsSelected() && game.GetPowerUpManager().AbilityUsed(i2.GetPowerUp()))
             {
                 i2.SetAbilityUsed(true);
             }
             else
             {
                 i2.SetAbilityUsed(false);
             }
         }
     }
     base.UpdateMenu(game);
 }