本文整理汇总了C++中BaseModHybridButton::GetCurrentState方法的典型用法代码示例。如果您正苦于以下问题:C++ BaseModHybridButton::GetCurrentState方法的具体用法?C++ BaseModHybridButton::GetCurrentState怎么用?C++ BaseModHybridButton::GetCurrentState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BaseModHybridButton
的用法示例。
在下文中一共展示了BaseModHybridButton::GetCurrentState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: NavigateTo
void QuickJoinPanel::NavigateTo()
{
BaseClass::NavigateTo();
SetHasMouseover( true );
BaseModHybridButton *title = dynamic_cast< BaseModHybridButton* >( FindChildByName( "LblTitle" ) );
if ( title )
{
title->SetNavUp( GetNavUp() );
title->SetNavDown( GetNavDown() );
if ( m_bHasMouseover && title->IsVisible() && ( title->GetCurrentState() == BaseModHybridButton::Enabled || title->GetCurrentState() == BaseModHybridButton::Disabled ) )
{
title->NavigateTo();
}
}
#ifdef _X360
m_GplQuickJoinList->NavigateTo();
#endif
}
示例2: OnMousePressed
void GameModes::OnMousePressed( vgui::MouseCode code )
{
BaseClass::OnMousePressed( code );
if ( code != MOUSE_LEFT )
return;
if ( IsScrollBusy() )
return;
int iPosX;
int iPosY;
input()->GetCursorPos( iPosX, iPosY );
ScreenToLocal( iPosX, iPosY );
if ( m_nSubPics )
{
bool bRightScroll = false;
bool bLeftScroll = false;
int nSubPic = 0;
if ( ( iPosX >= m_nPicOffsetX && iPosX <= m_nPicOffsetX + m_nPicWidth ) &&
( iPosY >= 0 && iPosY <= m_nPicHeight ) )
{
BaseModHybridButton *pHybridButton = GetHybridButton( m_nActive );
if ( pHybridButton && pHybridButton->GetCurrentState() != BaseModHybridButton::Open )
{
// open it
if ( pHybridButton->IsEnabled() )
{
pHybridButton->DoClick();
}
}
}
else if ( ( iPosX >= m_nLeftArrowX && iPosX <= m_nLeftArrowX + m_nArrowWidth ) &&
( iPosY >= m_nLeftArrowY && iPosY <= m_nLeftArrowY + m_nArrowHeight ) )
{
bLeftScroll = true;
}
else if ( ( iPosX >= m_nRightArrowX && iPosX <= m_nRightArrowX + m_nArrowWidth ) &&
( iPosY >= m_nRightArrowY && iPosY <= m_nRightArrowY + m_nArrowHeight ) )
{
bRightScroll = true;
}
else
{
// determine if sub pic selected
if ( iPosY >= m_nSubPicY && iPosY <= m_nSubPicY + m_nSubPicHeight )
{
int x = m_nSubPicX;
for ( int i = 1; i <= m_nSubPics; i++ )
{
if ( iPosX >= x && iPosX <= x + m_nSubPicWidth )
{
nSubPic = i;
break;
}
x += m_nSubPicWidth + m_nSubPicGap;
}
}
}
if ( bLeftScroll || bRightScroll || nSubPic )
{
// close any active flyout
if ( FlyoutMenu::GetActiveMenu() )
{
FlyoutMenu::CloseActiveMenu( this );
}
if ( bLeftScroll )
{
ScrollLeft();
}
else if ( bRightScroll )
{
ScrollRight();
}
else if ( nSubPic )
{
ScrollRight( nSubPic );
}
}
}
}
示例3: PaintBackground
void GameModes::PaintBackground()
{
if ( !m_GameModeInfos.Count() )
return;
BaseModHybridButton *pHybridButton = m_GameModeInfos[m_nActive].m_pHybridButton;
bool bHasFocus = pHybridButton->HasFocus() ||
( pHybridButton->GetCurrentState() == BaseModHybridButton::Focus ) ||
( pHybridButton->GetCurrentState() == BaseModHybridButton::FocusDisabled );
bool bIsOpen = ( pHybridButton->GetCurrentState() == BaseModHybridButton::Open );
// update scroll
// varies between [0..1] or [1..0]
float t = 0;
if ( m_startScrollTime )
{
float rate = ( m_nScrollMultipleCount >= 1 ) ? 8.0f : 5.0f;
t = ( Plat_FloatTime() - m_startScrollTime ) * rate;
if ( t >= 1.0f )
{
// finished, scroll is circular warp around
t = 1.0f;
m_startScrollTime = 0;
int nNewActive = 0;
if ( m_bLeftScroll )
{
nNewActive = ( m_nActive + 1 ) % m_GameModeInfos.Count();
}
else
{
nNewActive = ( m_nActive - 1 + m_GameModeInfos.Count() ) % m_GameModeInfos.Count();
}
SetActiveGameMode( nNewActive, bHasFocus );
if ( --m_nScrollMultipleCount > 0 )
{
m_startScrollTime = Plat_FloatTime();
t = 0;
}
}
}
int panelWidth, panelHeight;
GetSize( panelWidth, panelHeight );
// need this to see panel bounds during debugging
//vgui::surface()->DrawSetColor( Color( 255, 0, 0, 255 ) );
//vgui::surface()->DrawFilledRect( 0, 0, panelWidth, panelHeight );
// the main pic and all the subpics
int nPicCount = 1 + m_nSubPics;
if ( m_startScrollTime && m_bLeftScroll )
{
// scrolling means one extra sub pic must be drawn at the far right edge
// either coming/going
nPicCount++;
}
int nOffscreenSubPicX = m_nPicOffsetX - m_nSubPicOffsetX - m_nSubPicWidth;
int nOffscreenSubPicY = m_nSubPicY;
int nOffscreenSubPicW = m_nSubPicWidth;
int nOffscreenSubPicH = m_nSubPicHeight;
int nActivePicX = m_nPicOffsetX;
int nActivePicY = 0;
int nActivePicW = m_nPicWidth;
int nActivePicH = m_nPicHeight;
float nActiveAngle = 0; //-3;
int x, y;
int w, h;
int iPrevActiveMode = ( m_nActive - 1 + m_GameModeInfos.Count() ) % m_GameModeInfos.Count();
int iNextActiveMode = ( m_nActive + 1 ) % m_GameModeInfos.Count();
// center the vertical smear
y = nActivePicY + nActivePicH + m_nMenuTitleY + ( m_nMenuTitleActualTall - m_nMenuTitleTall )/2;
vgui::surface()->DrawSetColor( m_smearColor );
DrawSmearBackgroundFade(
m_nMenuTitleX - ( 0.30f * m_nMenuTitleX ),
y,
m_nSubPicX + m_nSubPics * ( m_nSubPicWidth + m_nSubPicGap ),
y + m_nMenuTitleTall );
// cyclical carousel
// the first pic to be drawn is the active main pic, followed by all the sub pics
for ( int i = 0; i < nPicCount; i++ )
{
int iGameMode = ( m_nActive + i ) % m_GameModeInfos.Count();
// in between scrolling, this image transition gets handled by specialized lerp drawing
bool bSkipSubPicDraw = m_startScrollTime && ( m_bLeftScroll && ( iGameMode == iNextActiveMode ) );
if ( !i )
{
// active pic
x = nActivePicX;
y = nActivePicY;
w = nActivePicW;
//.........这里部分代码省略.........