Пример #1
0
void ATheHUD::SetNextAbility( Abilities nextAbility )
{
  NextAbility = nextAbility;

  // depending on the action style, set color
  switch( nextAbility )
  {
    case Abilities::Attack:
      SetCursorStyle( CrossHairs, FLinearColor::Red );
      break;
    case Abilities::Movement:
      SetCursorStyle( CrossHairs, FLinearColor::Blue );
      break;
    case Abilities::Stop:
      for( int i = 0; i < Selected.size(); i++ )
        Selected[i]->Stop();
      break;
    case Abilities::HoldGround:
      for( int i = 0; i < Selected.size(); i++ )
        Selected[i]->HoldGround();
      break;
    case Abilities::NotSet:
      SetPointer();
      break;
    default:
      error( FS( "Unrecognized ability %d", (int)NextAbility ) );
      break;
  }
}
Пример #2
0
void MainFrame::mouseMoveEvent(QMouseEvent *event)
{
    if(!m_bLeftBtnPress)
    {
        m_eDirection = PointValid(event->x(),event->y());
        SetCursorStyle(m_eDirection);
    }
    else
    {
        int nXGlobal = event->globalX();
        int nYGlobal = event->globalY();
        SetDrayMove(nXGlobal,nYGlobal,m_eDirection);
        m_ptPressGlobal =QPoint(nXGlobal,nYGlobal);
    }
}
Пример #3
0
void FortyCanvas::OnMouseEvent(wxMouseEvent& event)
{
    int mouseX = (int)event.GetX();
    int mouseY = (int)event.GetY();

    wxClientDC dc(this);
    PrepareDC(dc);
    dc.SetFont(* m_font);

    if (event.LeftDClick())
    {
        if (m_leftBtnDown)
        {
            m_leftBtnDown = false;
            ReleaseMouse();
            m_game->LButtonUp(dc, mouseX, mouseY);
        }
        m_game->LButtonDblClk(dc, mouseX, mouseY);
    }
    else if (event.LeftDown())
    {
        if (!m_leftBtnDown)
        {
            m_leftBtnDown = true;
            CaptureMouse();
            m_game->LButtonDown(dc, mouseX, mouseY);
        }
    }
    else if (event.LeftUp())
    {
        if (m_leftBtnDown)
        {
            m_leftBtnDown = false;
            ReleaseMouse();
            m_game->LButtonUp(dc, mouseX, mouseY);
        }
    }
    else if (event.RightDown() && !event.LeftIsDown())
    {
        // only allow right button undo if m_rightBtnUndo is true
        if (m_rightBtnUndo)
        {
            if (event.ControlDown() || event.ShiftDown())
            {
                m_game->Redo(dc);
            }
            else
            {
                m_game->Undo(dc);
            }
        }
    }
    else if (event.Dragging())
    {
        m_game->MouseMove(dc, mouseX, mouseY);
    }

    if (!event.LeftIsDown())
    {
        SetCursorStyle(mouseX, mouseY);
    }
}
Пример #4
0
void ATheHUD::SetPointer()
{
  SetCursorStyle( CursorType::Hand, FLinearColor(1,1,1,1) );
}
Пример #5
0
void ATheHUD::SetHitCursor()
{
  SetCursorStyle( CursorType::CrossHairs, EmptyCrosshairColor );
}