Beispiel #1
0
 public override void HandleInput(UIManager manager) {
     if (manager.Right.Pressed) {
         MenuGrid.X += 1;
     }
     if (manager.Left.Pressed) {
         MenuGrid.X -= 1;
     }
     if (manager.Down.Pressed) {
         MenuGrid.Y += 1;
     }
     if (manager.Up.Pressed) {
         MenuGrid.Y -= 1;
     }
     for (var i = 0; i < MenuItems.Count; i++) {
         if (MenuGrid == i) {
             MenuItems[i].Highlight();
         }
         else {
             MenuItems[i].Dim();
         }
     }
     if (manager.A.Pressed) {
         if (CurrentMenuItem is UIMenu) {
             manager.Activate(CurrentMenuItem);
         }
         else {
             Trigger();
         }
     }
     else if (manager.B.Pressed) {
         CancelAndDeactivate(manager);
     }
 }
Beispiel #2
0
 public override void HandleInput(UIManager manager)
 {
     if (manager.Right.Pressed)
     {
         MenuGrid.X += 1;
     }
     if (manager.Left.Pressed)
     {
         MenuGrid.X -= 1;
     }
     if (manager.Down.Pressed)
     {
         MenuGrid.Y += 1;
     }
     if (manager.Up.Pressed)
     {
         MenuGrid.Y -= 1;
     }
     for (var i = 0; i < MenuItems.Count; i++)
     {
         if (MenuGrid == i)
         {
             MenuItems[i].Highlight();
         }
         else
         {
             MenuItems[i].Dim();
         }
     }
     if (manager.A.Pressed)
     {
         if (CurrentMenuItem is UIMenu)
         {
             manager.Activate(CurrentMenuItem);
         }
         else
         {
             Trigger();
         }
     }
     else if (manager.B.Pressed)
     {
         CancelAndDeactivate(manager);
     }
 }