本文整理汇总了C++中C_TFPlayer::IsHLTV方法的典型用法代码示例。如果您正苦于以下问题:C++ C_TFPlayer::IsHLTV方法的具体用法?C++ C_TFPlayer::IsHLTV怎么用?C++ C_TFPlayer::IsHLTV使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C_TFPlayer
的用法示例。
在下文中一共展示了C_TFPlayer::IsHLTV方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: UpdateReinforcements
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CTFSpectatorGUI::UpdateReinforcements( void )
{
if( !m_pReinforcementsLabel )
return;
C_TFPlayer *pPlayer = C_TFPlayer::GetLocalTFPlayer();
if ( !pPlayer || pPlayer->IsHLTV() ||
(pPlayer->GetTeamNumber() != TF_TEAM_RED && pPlayer->GetTeamNumber() != TF_TEAM_BLUE && pPlayer->GetTeamNumber() != TF_TEAM_GREEN && pPlayer->GetTeamNumber() != TF_TEAM_YELLOW) ||
( pPlayer->m_Shared.GetState() != TF_STATE_OBSERVER ) && ( pPlayer->m_Shared.GetState() != TF_STATE_DYING ) ||
( pPlayer->GetObserverMode() == OBS_MODE_FREEZECAM ) )
{
m_pReinforcementsLabel->SetVisible( false );
return;
}
wchar_t wLabel[128];
if ( TFGameRules()->InStalemate() )
{
g_pVGuiLocalize->ConstructString( wLabel, sizeof( wLabel ), g_pVGuiLocalize->Find( "#game_respawntime_stalemate" ), 0 );
}
else if ( TFGameRules()->State_Get() == GR_STATE_TEAM_WIN )
{
// a team has won the round
g_pVGuiLocalize->ConstructString( wLabel, sizeof( wLabel ), g_pVGuiLocalize->Find( "#game_respawntime_next_round" ), 0 );
}
else
{
float flNextRespawn = TFGameRules()->GetNextRespawnWave( pPlayer->GetTeamNumber(), pPlayer );
if ( !flNextRespawn )
{
m_pReinforcementsLabel->SetVisible( false );
return;
}
int iRespawnWait = (flNextRespawn - gpGlobals->curtime);
if ( iRespawnWait <= 0 )
{
g_pVGuiLocalize->ConstructString( wLabel, sizeof( wLabel ), g_pVGuiLocalize->Find("#game_respawntime_now" ), 0 );
}
else if ( iRespawnWait <= 1.0 )
{
g_pVGuiLocalize->ConstructString( wLabel, sizeof( wLabel ), g_pVGuiLocalize->Find("#game_respawntime_in_sec" ), 0 );
}
else
{
char szSecs[6];
Q_snprintf( szSecs, sizeof(szSecs), "%d", iRespawnWait );
wchar_t wSecs[4];
g_pVGuiLocalize->ConvertANSIToUnicode(szSecs, wSecs, sizeof(wSecs));
g_pVGuiLocalize->ConstructString( wLabel, sizeof( wLabel ), g_pVGuiLocalize->Find("#game_respawntime_in_secs" ), 1, wSecs );
}
}
m_pReinforcementsLabel->SetVisible( true );
m_pReinforcementsLabel->SetText( wLabel, true );
}