本文整理汇总了C++中CHandle::AddFlag方法的典型用法代码示例。如果您正苦于以下问题:C++ CHandle::AddFlag方法的具体用法?C++ CHandle::AddFlag怎么用?C++ CHandle::AddFlag使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CHandle
的用法示例。
在下文中一共展示了CHandle::AddFlag方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: InputActivate
//------------------------------------------------------------------------------
// Purpose :
//------------------------------------------------------------------------------
void CGameUI::InputActivate( inputdata_t &inputdata )
{
// If already in use, ignore activatation by others
if (( m_player.Get() != NULL ) && ( m_player.Get() != inputdata.pActivator ))
{
return;
}
if ( inputdata.pActivator && inputdata.pActivator->IsPlayer() )
{
m_player = (CBasePlayer *)inputdata.pActivator;
m_playerOn.FireOutput( inputdata.pActivator, this, 0 );
// Turn the hud off
SetNextThink( gpGlobals->curtime );
// Disable player motion
if (FBitSet(m_spawnflags, SF_GAMEUI_FREEZE_PLAYER))
{
m_player->AddFlag( FL_ATCONTROLS );
}
if (FBitSet(m_spawnflags, SF_GAMEUI_HIDE_WEAPON))
{
m_player->m_Local.m_iHideHUD |= HIDEHUD_WEAPONS;
if ( m_player->GetActiveWeapon() )
{
m_hSaveWeapon = m_player->GetActiveWeapon();
m_player->GetActiveWeapon()->Holster();
m_player->ClearActiveWeapon();
m_player->HideViewModels();
}
}
}
m_bForceUpdate = true;
}
示例2: InputActivate
//------------------------------------------------------------------------------
// Purpose :
//------------------------------------------------------------------------------
void CGameUI::InputActivate( inputdata_t &inputdata )
{
CBasePlayer *pPlayer;
// Determine if we're specifying this as an override parameter
if ( inputdata.value.StringID() != NULL_STRING )
{
CBaseEntity *pEntity = gEntList.FindEntityByName( NULL, inputdata.value.String(), this, inputdata.pActivator, inputdata.pCaller );
if ( pEntity == NULL || pEntity->IsPlayer() == false )
{
Warning( "%s InputActivate: entity %s not found or is not a player!\n", STRING(GetEntityName()), inputdata.value.String() );
return;
}
pPlayer = ToBasePlayer( pEntity );
}
else
{
// Otherwise try to use the activator
if ( inputdata.pActivator == NULL || inputdata.pActivator->IsPlayer() == false )
{
Warning( "%s InputActivate: invalid or missing !activator!\n", STRING(GetEntityName()), inputdata.value.String() );
return;
}
pPlayer = ToBasePlayer( inputdata.pActivator );
}
// If another player is already using these controls3, ignore this activation
if ( m_player.Get() != NULL && pPlayer != m_player.Get() )
{
// TODO: We could allow this by calling Deactivate() at this point and continuing on -- jdw
return;
}
// Setup our internal data
m_player = pPlayer;
m_playerOn.FireOutput( pPlayer, this, 0 );
// Turn the hud off
SetNextThink( gpGlobals->curtime );
// Disable player's motion
if ( FBitSet( m_spawnflags, SF_GAMEUI_FREEZE_PLAYER ) )
{
m_player->AddFlag( FL_ATCONTROLS );
}
// Store off and hide the currently held weapon
if ( FBitSet( m_spawnflags, SF_GAMEUI_HIDE_WEAPON ) )
{
m_player->m_Local.m_iHideHUD |= HIDEHUD_WEAPONSELECTION;
if ( m_player->GetActiveWeapon() )
{
m_hSaveWeapon = m_player->GetActiveWeapon();
m_player->GetActiveWeapon()->Holster();
m_player->ClearActiveWeapon();
m_player->HideViewModels();
}
}
// We must update our state
m_bForceUpdate = true;
}