本文整理汇总了C++中CClientWeapon::GetState方法的典型用法代码示例。如果您正苦于以下问题:C++ CClientWeapon::GetState方法的具体用法?C++ CClientWeapon::GetState怎么用?C++ CClientWeapon::GetState使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CClientWeapon
的用法示例。
在下文中一共展示了CClientWeapon::GetState方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Open
bool CAmmoChooser::Open()
{
// Don't allow the chooser to be opened if we're selecting/deselecting a
// weapon...
CClientWeapon *pClientWeapon = g_pClientWeaponMgr->GetCurrentClientWeapon();
WeaponState eState = pClientWeapon->GetState();
if (W_DESELECT == eState || W_SELECT == eState) return false;
if (m_bIsOpen)
return true;
m_hAmmo = pClientWeapon->GetAmmoRecord();
if( m_hAmmo == pClientWeapon->GetNextAvailableAmmo() )
{
m_hAmmo = NULL;
m_bIsOpen = false;
return false;
}
m_bIsOpen = true;
m_AutoCloseTimer.Start(kfDelayTime);
g_pHUDMgr->QueueUpdate(kHUDChooser);
return true;
}
示例2: Render
void CHUDAmmo::Render()
{
if( g_vtHUDAmmoRender.GetFloat( ) < 1.0f )
return;
bool bWeaponsEnabled = g_pClientWeaponMgr->WeaponsEnabled();
CClientWeapon* pClientWeapon = g_pClientWeaponMgr->GetCurrentClientWeapon();
if (!pClientWeapon || !bWeaponsEnabled) return;
if (!m_bDraw || pClientWeapon->GetState() == W_DESELECT) return;
SetRenderState();
if (!m_bInfinite)
{
m_Text.Render();
}
//render icon here
if (m_hIconTexture)
{
g_pDrawPrim->SetTexture(m_hIconTexture);
g_pDrawPrim->DrawPrim(&m_IconPoly,1);
}
}
示例3: GetCurrentClientWeapon
// GRENADE PROTOTYPE
WeaponState CClientWeaponMgr::GetCurrentWeaponState() const
{
CClientWeapon* pWpn = GetCurrentClientWeapon();
if (!pWpn) return W_INACTIVE;
return pWpn->GetState();
}