Beispiel #1
0
        public InputController()
        {
            m_DragArgs = new DragArgs();

            m_LastMouseState = Mouse.GetState();
            m_LastKeyboardState = Keyboard.GetState();
        }
Beispiel #2
0
 public void OnDrag(DragArgs e)
 {
     int deltaY = e.CurrentY - m_iDragY;
     m_iDragY = e.CurrentY;
     m_iScrollOffset -= deltaY;
     if( m_iScrollOffset < 0 )
         m_iScrollOffset = 0;
     if( m_iScrollOffset > m_iScrollMaximum )
         m_iScrollOffset = m_iScrollMaximum;
 }
Beispiel #3
0
 public override void DragBegin(DragArgs args)
 {
     base.DragBegin(args);
 }
 public override void DragBegin(DragArgs args)
 {
     m_DragY = (float)args.StartY;
     m_bDragging = true;
 }
Beispiel #5
0
 public virtual void DragBegin(DragArgs args)
 {
 }
 public void DragBegin(DragArgs args)
 {
     m_DragY = (float)args.StartY;
 }
Beispiel #7
0
        private void M_Input_OnClick(object sender, DragArgs e)
        {
            if( e.Abort )
                return;

            int iX = e.CurrentX;
            int iY = e.CurrentY;

            if (m_MessageBox != null)
            {
                MessageBoxResult res = m_MessageBox.HandleClick(iX, iY);
                if (res != MessageBoxResult.NoResult)
                {
                    DoMessageBoxResult(res);
                }
            }
            else if (m_EndScreen != null)
            {
                if (!m_EndScreen.HandleClick(iX, iY))
                {
                    m_EndScreen = null;
                }
            }
            else if (m_PauseMenu != null)
            {
                if (!m_PauseMenu.HandleClick(iX, iY))
                {
                    switch (m_PauseMenu.m_iSelection)
                    {
                        case 0: // Resume Game
                            UnPause();
                            break;
                        case 1: // Reset Puzzle
                            m_Puzzle.Reset();
                            UnHideAllClues();
                            UnPause();
                            break;
                        case 2: // Unhide Clues
                            UnHideAllClues();
                            UnPause();
                            break;
                        case 3: // Buy Coins
                            break;
                        case 4: // Save & Exit
                            SavePuzzle();
                            Game.GotoScene(new HubScene(Game));
                            break;
                    }
                }
            }
            else
            {
                foreach (UIPanel p in m_UIPanels)
                {
                    if (p.Contains(e.CurrentX, e.CurrentY))
                    {
                        p.Click(e.CurrentX, e.CurrentY);
                        break;
                    }
                }
            }
        }
Beispiel #8
0
 public override void DragEnd(DragArgs args)
 {
     m_bDragging = false;
 }
Beispiel #9
0
 public override void DragBegin(DragArgs args)
 {
     m_DragX     = (float)args.StartX;
     m_bDragging = true;
 }
Beispiel #10
0
 protected void Invoke_OnDragEnd(object sender, DragArgs args)
 {
     OnDragEnd?.Invoke(sender, args);
 }
Beispiel #11
0
 protected void Invoke_OnClick(object sender, DragArgs args)
 {
     OnClick?.Invoke(sender, args);
 }
Beispiel #12
0
 protected void Invoke_OnDragBegin(object sender, DragArgs args)
 {
     OnDragBegin?.Invoke(sender, args);
 }
Beispiel #13
0
        private void M_Input_OnClick(object sender, DragArgs e)
        {
            if (e.Abort)
            {
                return;
            }

            int iX = e.CurrentX;
            int iY = e.CurrentY;

            if (m_MessageBox != null)
            {
                MessageBoxResult res = m_MessageBox.HandleClick(iX, iY);
                if (res != MessageBoxResult.NoResult)
                {
                    DoMessageBoxResult(res);
                }
            }
            else if (m_CoinsDialog != null)
            {
                if (m_CoinsDialog.HandleClick(e.CurrentX, e.CurrentY))
                {
                    return;
                }
                m_CoinsDialog = null;
            }
            else if (m_EndScreen != null)
            {
                if (!m_EndScreen.HandleClick(iX, iY))
                {
                    m_EndScreen = null;
                }
            }
            else if (m_PauseMenu != null)
            {
                if (!m_PauseMenu.HandleClick(iX, iY))
                {
                    switch (m_PauseMenu.m_iSelection)
                    {
                    case 0:     // Resume Game
                        UnPause();
                        break;

                    case 1:     // Reset Puzzle
                        m_Puzzle.Reset();
                        UnHideAllClues();
                        UnPause();
                        break;

                    case 2:     // Unhide Clues
                        UnHideAllClues();
                        UnPause();
                        break;

                    case 3:     // Buy Coins
                        m_CoinsDialog = new BuyCoinsModal();
                        break;

                    case 4:     // Options
                        break;

                    case 5:     // Save & Exit
                        UnPause();
                        SavePuzzle();
                        Game.GotoScene(new HubScene(Game));
                        break;
                    }
                }
            }
            else
            {
                foreach (UIPanel p in m_UIPanels)
                {
                    if (p.Contains(e.CurrentX, e.CurrentY))
                    {
                        p.Click(e.CurrentX, e.CurrentY);
                        break;
                    }
                }
            }
        }
Beispiel #14
0
 public override void DragEnd(DragArgs args)
 {
     base.DragEnd(args);
 }
Beispiel #15
0
 public void OnDragBegin(DragArgs e)
 {
     m_iDragY = e.StartY;
 }
Beispiel #16
0
 public virtual void DragBegin(DragArgs args)
 {
 }
Beispiel #17
0
 public void OnDragEnd(DragArgs e)
 {
 }
Beispiel #18
0
 public virtual void DragEnd(DragArgs args)
 {
 }
Beispiel #19
0
 public void Drag(DragArgs args)
 {
     float deltaY = m_DragY - args.CurrentY;
     m_DragY = args.CurrentY;
     if (deltaY != 0)
     {
         m_FloorScrollPosition -= deltaY;
         if (m_FloorScrollPosition < m_ScrollMin)
             m_FloorScrollPosition = m_ScrollMin;
         if (m_FloorScrollPosition > 0)
             m_FloorScrollPosition = 0;
     }
 }
Beispiel #20
0
 private void IC_OnClick(object sender, DragArgs e)
 {
     e.Abort = m_Tutorial.HandleClick(e.CurrentX, e.CurrentY);
 }
Beispiel #21
0
 private void M_Input_OnDragEnd(object sender, DragArgs e)
 {
     if (m_PauseMenu != null)
     {
         m_PauseMenu.OnDragEnd(e);
     }
     else if (m_UIPanels != null)
     {
         foreach (UIPanel p in m_UIPanels)
         {
             if (p.Rect.Contains(e.StartX, e.StartY))
             {
                 p.DragEnd(e);
                 break;
             }
         }
     }
 }
Beispiel #22
0
        public override void Drag(DragArgs args)
        {
            if (m_bDragging && m_bCanScroll)
            {
                float delta = m_DragX - args.CurrentX;
                m_DragX = args.CurrentX;

                if (delta != 0)
                {
                    m_ScrollPosition -= delta;
                    if (m_ScrollPosition < m_ScrollMin)
                        m_ScrollPosition = m_ScrollMin;
                    if (m_ScrollPosition > m_ScrollMax)
                        m_ScrollPosition = m_ScrollMax;
                }
            }
        }
Beispiel #23
0
 public virtual void DragEnd(DragArgs args)
 {
 }
Beispiel #24
0
        private void IC_OnClick(object sender, DragArgs e)
        {
            if( e.Abort )
                return;

            if (m_FloorSelect != null)
            {
                if( !m_FloorSelect.HandleClick(e.CurrentX, e.CurrentY) )
                    m_FloorSelect = null;
            }
            else
            {
                foreach (Tower t in m_Towers)
                {
                    if (t.Click(e.CurrentX, e.CurrentY))
                    {
                        //ActivateTower(t);
                        Game.Tutorial.FinishPiece(TutorialSystem.TutorialPiece.ClickTower);
                        m_FloorSelect = new FloorSelectDialog(t.Size - 3, Game.ScreenWidth, Game.ScreenHeight, Game);
                        break;
                    }
                }
            }
        }
        public override void Drag(DragArgs args)
        {
            if (m_bDragging)
            {
                float deltaY = m_DragY - args.CurrentY;
                m_DragY = args.CurrentY;

                if (deltaY != 0)
                {
                    m_ScrollPosition -= deltaY;
                    if (m_ScrollPosition < m_ScrollMin)
                        m_ScrollPosition = m_ScrollMin;
                    if (m_ScrollPosition > m_ScrollMax)
                        m_ScrollPosition = m_ScrollMax;
                }
            }
        }
Beispiel #26
0
 private void IC_OnDragBegin(object sender, DragArgs e)
 {
     if( m_FloorSelect != null )
         m_FloorSelect.DragBegin(e);
 }
 public override void DragEnd(DragArgs args)
 {
     m_bDragging = false;
 }
Beispiel #28
0
 private void IC_OnClick(object sender, DragArgs e)
 {
     e.Abort = m_Tutorial.HandleClick(e.CurrentX, e.CurrentY);
 }