/// <summary>
        /// tp01_ButtonStateChange - ButtonStateChange event handler
        /// </summary>
        /// <param name="device">GenericBase</param>
        /// <param name="args">ButtonEventArgs</param>
        void tp01_ButtonStateChange(GenericBase device, ButtonEventArgs args)
        {
            try
            {
                eButtonName  btnName  = args.Button.Name;
                uint         btnNum   = args.Button.Number;
                eButtonState btnState = args.Button.State;

                if (btnState == eButtonState.Pressed)
                {
                    buttonPanelUtility.ExecuteButtonAction(btnName);

                    if (btnNum > 4)
                    {
                        buttonPanelUtility.SetButtonFb(btnNum, true);
                    }
                    else if (btnNum == 1 || btnNum == 4)
                    {
                        buttonPanelUtility.ToggleFeedback(btnNum);
                    }
                    else if (btnNum == 2)
                    {
                        buttonPanelUtility.DecrementVolumeBar(655);
                    }
                    else if (btnNum == 3)
                    {
                        buttonPanelUtility.IncrementVolumeBar(655);
                    }
                }
            }
            catch (Exception e)
            {
                Debug.Log(">>> Error in tp01_ButtonStateChange: " + e.Message, Debug.ErrorLevel.Error, true);
            }
        }
Example #2
0
 public void MoveUp(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         movement.Y = -1.0f;
     }
 }
Example #3
0
 public void GotoNextScene(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         bChange = true;
     }
 }
Example #4
0
 public void MoveDown(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.PRESSED)
     {
         movement.Y = 1.0f;
     }
 }
Example #5
0
 public void EnableCameraSpring(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.PRESSED)
     {
         cameraSpringEnabled = !cameraSpringEnabled;
     }
 }
 public void StopGame(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         Exit();
     }
 }
Example #7
0
 public void Down(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         velocity.Y = amount.X;
     }
 }
Example #8
0
        public void MoveTowardUnoccupiedMapArea(eButtonState buttonState, Vector2 mouseLocation)
        {
            if (buttonState == eButtonState.DOWN)
            {
                if (gameTime == null)
                {
                    return;
                }

                float elapsedTime = (float)gameTime.ElapsedGameTime.TotalSeconds;

                if (Utilities.IsVectorInsideWindow(mouseLocation, Resources.GraphicsDevice))
                {
                    lastMouseLocation = mouseLocation;

                    //calculate the direction in which to move
                    Vector2 direction = mouseLocation - Position;
                    direction.Normalize();

                    //float distance = Vector2.Distance(Position, mouseLocation);
                    direction = direction * speed * elapsedTime;

                    Velocity = direction;

                    canAttack = isCloseEnoughToAttack = false;
                }
            }
        }
Example #9
0
 public void ExitGame(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         this.Exit();
     }
 }
Example #10
0
 // Use this for initialization
 protected override void Start()
 {
     base.Start();
     tiledata = GetComponent <TileData>();
     Assert.IsNotNull(tiledata, "A HandButton require a TileData component!");
     currentState = (eButtonState)tiledata.Tile.paramContainer.GetIntParam("state");
 }
Example #11
0
 public void fire(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         FireShot();
     }
 }
Example #12
0
 public void PrevMenuSelect(eButtonState buttonState)
 {
     if (buttonState == eButtonState.DOWN && !isTransitioning)
     {
         if (prevMenuID != String.Empty && prevMenuID != currentMenuID)
         {
             if (clone.Count > 0)
             {
                 clone.Remove(clone[clone.Count - 1]);
             }
             currentMenuID = prevMenuID;
             menu.ID       = currentMenuID;
         }
         else if (!prevMenuID.Contains("Gameplay"))
         {
             currentMenuID = prevMenuID = "Content/Load/Menu/GameplayMenu.xml";
             menu.ID       = currentMenuID;
             menu.Active   = true;
             clone.Clear();
         }
         else if (IsActive)
         {
             Activate(buttonState);
         }
     }
 }
Example #13
0
 public void SelectDown(eButtonState buttonState)
 {
     if (buttonState == eButtonState.DOWN)
     {
         menu.ItemNumber++;
     }
 }
Example #14
0
 public void SelectUp(eButtonState buttonState)
 {
     if (buttonState == eButtonState.DOWN)
     {
         menu.ItemNumber--;
     }
 }
Example #15
0
        private void ContinueGame(eButtonState buttonState, Vector2 amount)
        {
            // Perform the appropriate action to advance the game and
            // to get the player back to playing.
            if (buttonState == eButtonState.DOWN)
            {
                if (!level.Player.IsAlive)
                {
                    level.StartNewLife();
                }
                else if (level.TimeRemaining == TimeSpan.Zero)
                {
                    if (level.ReachedExit)
                    {
                        levelIndex = level.LevelToLoad;
                        LoadNextLevel(levelIndex);
                    }
                    else
                    {
                        ReloadCurrentLevel();
                    }
                }
            }

            wasContinuePressed = buttonState == eButtonState.DOWN;
        }
Example #16
0
 private void MakePlayerAttack(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         level.PlayerAttack();
     }
 }
Example #17
0
 private void MovePlayerToRight(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         level.MovePlayerRight();
     }
 }
Example #18
0
 public void MoveLeft(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.PRESSED)
     {
         movement.X = -1.0f;
     }
 }
 public void TurnRight(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         RotationAmount.X = -1.0f;
     }
 }
Example #20
0
 public void Left(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         velocity.X = -amount.X;
     }
 }
Example #21
0
        private void CastSpell(eButtonState buttonState, Vector2 amount)
        {
            // Cast a spell if the player is alive
            if (buttonState == eButtonState.PRESSED && player.Health > 0)
            {
                // Loop through the active spell
                for (int i = 0; i < currentSpell.Count; i++)
                {
                    // If it's not casted, then choose this one
                    if (currentSpell[i].SpellCasted == false)
                    {
                        // If player has any magic points left
                        if (player.Magic >= currentSpell[i].MPCost)
                        {
                            currentSpell[i].SpellCasted = true;

                            // Decrease the magic points by the cost of spell
                            player.Magic -= currentSpell[i].MPCost;
                        }

                        break;
                    }
                }
            }
        }
Example #22
0
 private void ChangeMap2(eButtonState buttonState)
 {
     if (buttonState == eButtonState.DOWN)
     {
         world.ChangeMap("Room1");
     }
 }
Example #23
0
 public void OnStopGame(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.PRESSED)
     {
         Exit();
     }
 }
Example #24
0
 private void ChangeScreen(eButtonState buttonstate)
 {
     if (buttonstate == eButtonState.DOWN)
     {
         ScreenManager.Instance.ChangeScreens("TitleScreen");
     }
 }
Example #25
0
 public void Jump(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         isJumping = true;
     }
 }
Example #26
0
 private void MakePlayerShoot(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.PRESSED)
     {
         level.MakePlayerShoot();
     }
 }
Example #27
0
 public void MoveRight(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN || buttonState == eButtonState.PRESSED)
     {
         playerController.MoveRight(1.0f);
     }
 }
Example #28
0
 private void OnGoToNextScreen(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.PRESSED)
     {
         nextScreenCalled++;
         spacePressed = true;
     }
 }
	void SetState(eButtonState state)
	{
		if (State != state)
		{
			TimeInState = 0;
		}
		State = state;
	}
Example #30
0
 public void EnterNumber9(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN && special > 0)
     {
         special--;
         playerController.SpecialAttack(9);
     }
 }
Example #31
0
    // push button event handler. callback fuction.
    void PushButton(GameObject ButtonPressed)
    {
        if (ButtonPressed == transform.parent.gameObject){

            if (!Disabled){
                if(State == eButtonState.Off){
                    State = eButtonState.On;
                } else{
                    State = eButtonState.Off;
                }

            }

            cMessenger<MonoBehaviour>.Invoke("linkedButton", this);

        };
    }
Example #32
0
    //**関数***************************************************************************
    //    概要	:	状態変更
    //*********************************************************************************
    public void SetState(eButtonState eButtonState)
    {
        m_nState = (int)eButtonState;

        switch (eButtonState)
        {
        case eButtonState.DEFAULT:
            gameObject.GetComponent<CObj2D>().SetColor(DEFAULT_COLOR);
            break;

         		case eButtonState.ACTIVE:
            gameObject.GetComponent<CObj2D>().SetColor(ACTIVE_COLOR);
            break;

        case eButtonState.UNUSE:
            gameObject.GetComponent<CObj2D>().SetColor(UNUSE_COLOR);
            break;

        default:
            Debug.Log("CButton Set State Error");
            break;
        }
    }
Example #33
0
 public void fire(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         FireShot();
     }
 }
Example #34
0
 public void Down(eButtonState buttonState, Vector2 amount)
 {
     if (buttonState == eButtonState.DOWN)
     {
         playerSprite.Velocity += new Vector2(0, 1);
     }
     else
     {
         playerSprite.Velocity += new Vector2(0, 0);
     }
 }
Example #35
0
 //--------------------------------------------------------------------------------
 protected override void OnMouseEnter(System.EventArgs e)
 {
   m_State = eButtonState.MouseOver;
   this.Invalidate();
   base.OnMouseEnter(e);
 }
Example #36
0
 //--------------------------------------------------------------------------------
 protected override void OnMouseDown(System.Windows.Forms.MouseEventArgs e)
 {
   m_State = eButtonState.Down;
   this.Invalidate();
   base.OnMouseDown(e);
 }
Example #37
0
 //--------------------------------------------------------------------------------
 protected override void OnMouseDown(MouseEventArgs e)
 {
     m_State = eButtonState.Down;
       Invalidate();
       base.OnMouseDown(e);
 }
Example #38
0
 //--------------------------------------------------------------------------------
 protected override void OnMouseUp(MouseEventArgs e)
 {
     m_State = eButtonState.MouseOver;
       Invalidate();
       base.OnMouseUp(e);
 }
Example #39
0
 //--------------------------------------------------------------------------------
 protected override void OnMouseLeave(EventArgs e)
 {
     m_State = eButtonState.Normal;
       Invalidate();
       base.OnMouseLeave(e);
 }