本文整理汇总了C++中C_BaseCombatWeapon::HandleInput方法的典型用法代码示例。如果您正苦于以下问题:C++ C_BaseCombatWeapon::HandleInput方法的具体用法?C++ C_BaseCombatWeapon::HandleInput怎么用?C++ C_BaseCombatWeapon::HandleInput使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_BaseCombatWeapon
的用法示例。
在下文中一共展示了C_BaseCombatWeapon::HandleInput方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Think
//-----------------------------------------------------------------------------
// Purpose: Think
//-----------------------------------------------------------------------------
void CHud::Think(void)
{
// Determine the visibility of all hud elements
for ( int i = 0; i < m_HudList.Size(); i++ )
{
// Visible?
bool visible = m_HudList[i]->ShouldDraw();
m_HudList[i]->SetActive( visible );
// If it's a vgui panel, hide/show as appropriate
vgui::Panel *pPanel = dynamic_cast<vgui::Panel*>(m_HudList[i]);
if ( pPanel && pPanel->IsVisible() != visible )
{
pPanel->SetVisible( visible );
}
else if ( !pPanel )
{
// All HUD elements should now derive from vgui!!!
Assert( 0 );
}
if ( visible )
{
m_HudList[i]->ProcessInput();
}
}
// Let the active weapon at the keybits
C_BaseCombatWeapon *pWeapon = GetActiveWeapon();
if ( pWeapon )
{
pWeapon->HandleInput();
}
}
示例2: Think
//-----------------------------------------------------------------------------
// Purpose: Think
//-----------------------------------------------------------------------------
void CHud::Think(void)
{
#if defined( REPLAY_ENABLED )
// Don't draw this
extern IEngineClientReplay *g_EngineClientReplay;
const bool bPlayingReplay = g_pEngineClientReplay && g_pEngineClientReplay->IsPlayingReplayDemo();
#endif
// Determine the visibility of all hud elements
for ( int i = 0; i < m_HudList.Size(); i++ )
{
// Visible?
bool visible = m_HudList[i]->ShouldDraw();
#if defined( REPLAY_ENABLED )
visible = visible && !bPlayingReplay;
#endif
m_HudList[i]->SetActive( visible );
// If it's a vgui panel, hide/show as appropriate
vgui::Panel *pPanel = dynamic_cast<vgui::Panel*>(m_HudList[i]);
if ( pPanel && pPanel->IsVisible() != visible )
{
pPanel->SetVisible( visible );
}
else if ( !pPanel )
{
// All HUD elements should now derive from vgui!!!
Assert( 0 );
}
if ( visible )
{
m_HudList[i]->ProcessInput();
}
}
// Let the active weapon at the keybits
C_BaseCombatWeapon *pWeapon = GetActiveWeapon();
if ( pWeapon )
{
pWeapon->HandleInput();
}
if ( ( m_flScreenShotTime > 0 ) && ( m_flScreenShotTime < gpGlobals->curtime ) )
{
if ( !IsX360() )
{
engine->ClientCmd( "screenshot" );
}
m_flScreenShotTime = -1;
}
}