Ejemplo n.º 1
0
 public override bool GamePadButtonDown(GameTime gameTime, GamePadButtonEventArgs e)
 {
     var selected = Game.Client.HotbarSelection;
     switch (e.Button)
     {
         case Buttons.LeftShoulder:
             selected--;
             if (selected < 0)
                 selected = 8;
             if (selected > 8)
                 selected = 0;
             Game.Client.HotbarSelection = selected;
             break;
         case Buttons.RightShoulder:
             selected++;
             if (selected < 0)
                 selected = 8;
             if (selected > 8)
                 selected = 0;
             Game.Client.HotbarSelection = selected;
             break;
         case Buttons.A:
             if (Math.Floor(Game.Client.Position.Y) == Game.Client.Position.Y)
                 Game.Client.Velocity += TrueCraft.API.Vector3.Up * 0.3;
             break;
     }
     return false;
 }
Ejemplo n.º 2
0
 /// <summary>
 /// GamePadButton down event handler -- added solely to work-around problem in "Back" button handling
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RefAppPlayer_GamePadButtonDown(object sender, GamePadButtonEventArgs e)
 {
     if (GamePadButton.Back == e.Button)
     {
         // Work-around problem in MediaTransport.cs in the ADK Platform that neglects to set this.
         e.Handled = true;
     }
 }
Ejemplo n.º 3
0
 /// <summary>
 /// GamePadButton down event handler -- added solely to work-around problem in "Back" button handling
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void RefAppPlayer_GamePadButtonDown(object sender, GamePadButtonEventArgs e)
 {
     if (GamePadButton.Back == e.Button)
     {
         // Work-around problem in MediaTransport.cs in the ADK Platform that neglects to set this.
         e.Handled = true;
     }
 }
Ejemplo n.º 4
0
 private void FullScreenPlayer_GamePadButtonDown(object sender, GamePadButtonEventArgs e)
 {
     if (e.Button == GamePadButton.X)
     {
         if (NavigationService.CanGoBack)
         {
             NavigationService.GoBack();
         }
     }
 }
Ejemplo n.º 5
0
 private void OnGamePadButtonDown(object sender, GamePadButtonEventArgs e)
 {
     foreach (var module in InputModules)
     {
         var input = module as IInputModule;
         if (input != null)
         {
             if (input.GamePadButtonDown(GameTime, e))
                 break;
         }
     }
 }
Ejemplo n.º 6
0
        public override bool GamePadButtonDown(GameTime gameTime, GamePadButtonEventArgs e)
        {
            var selected = Game.Client.HotBarSelection;

            switch (e.Button)
            {
            case Buttons.LeftShoulder:
                selected--;
                if (selected < 0)
                {
                    selected = 8;
                }
                if (selected > 8)
                {
                    selected = 0;
                }
                Game.Client.HotBarSelection = selected;
                break;

            case Buttons.RightShoulder:
                selected++;
                if (selected < 0)
                {
                    selected = 8;
                }
                if (selected > 8)
                {
                    selected = 0;
                }
                Game.Client.HotBarSelection = selected;
                break;

            case Buttons.A:
                if (Math.Floor(Game.Client.Position.Y) == Game.Client.Position.Y)
                {
                    Game.Client.Velocity += Directions.Up * 0.3f;
                }
                break;
            }

            return(false);
        }
Ejemplo n.º 7
0
        private void OnGamePadButtonDown(object sender, GamePadButtonEventArgs e)
        {
            if (!IsActive)
            {
                return;
            }

            foreach (var module in InputModules)
            {
                if (!(module is IInputModule input))
                {
                    continue;
                }

                if (input.GamePadButtonDown(GameTime, e))
                {
                    break;
                }
            }
        }
 void LayoutRoot_GamePadButtonDown(object sender, GamePadButtonEventArgs e)
 {
     GamePadButtonDown += new EventHandler<GamePadButtonEventArgs>(HLSPlayerPage_GamePadButtonDown);
 }
 void HLSPlayerPage_GamePadButtonDown(object sender, GamePadButtonEventArgs e)
 {
 }
Ejemplo n.º 10
0
 private void OnGamePadButtonUp(object sender, GamePadButtonEventArgs e)
 {
     foreach (var module in InputModules)
     {
         var input = module as IInputModule;
         if (input != null)
         {
             if (input.GamePadButtonUp(GameTime, e))
                 break;
         }
     }
 }
 private void FullScreenPlayer_GamePadButtonDown(object sender, GamePadButtonEventArgs e)
 {
     if (e.Button == GamePadButton.X)
     {
         if (NavigationService.CanGoBack)
         {
             NavigationService.GoBack();
         }
     }
 }
Ejemplo n.º 12
0
 /// <summary>
 /// Raises the ButtonUp event. This is automatically raised by an appropriately configured
 /// GamePadEvents object, but this allows for programmatic raising of events.
 /// </summary>
 public void OnButtonUp(object sender, GamePadButtonEventArgs args)
 {
     if (ButtonUp != null) { ButtonUp(sender, args); }
 }
Ejemplo n.º 13
0
 public virtual bool GamePadButtonUp(GameTime gameTime, GamePadButtonEventArgs e)
 {
     return(false);
 }