本文整理汇总了C++中CASW_Marine_Resource::GetDisplayName方法的典型用法代码示例。如果您正苦于以下问题:C++ CASW_Marine_Resource::GetDisplayName方法的具体用法?C++ CASW_Marine_Resource::GetDisplayName怎么用?C++ CASW_Marine_Resource::GetDisplayName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CASW_Marine_Resource
的用法示例。
在下文中一共展示了CASW_Marine_Resource::GetDisplayName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetPlayerNames
void StatsReport::SetPlayerNames( void )
{
C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer();
if ( !pPlayer )
return;
int nMarine = 0;
C_ASW_Game_Resource *pGameResource = ASWGameResource();
for ( int i = 0; i < pGameResource->GetMaxMarineResources() && nMarine < ASW_STATS_REPORT_MAX_PLAYERS; i++ )
{
CASW_Marine_Resource *pMR = pGameResource->GetMarineResource( i );
if ( pMR )
{
C_ASW_Player *pCommander = pMR->GetCommander();
Color color = getColorPerIndex(pMR->GetCommanderIndex());
if ( pPlayer != pCommander )
{
color[ 3 ] = 128;
}
m_pStatGraphPlayer->m_pStatGraphs[ nMarine ]->SetLineColor( color );
m_pPlayerNames[ nMarine ]->SetFgColor( color );
wchar_t wszMarineName[ 32 ];
pMR->GetDisplayName( wszMarineName, sizeof( wszMarineName ) );
m_pPlayerNames[ nMarine ]->SetText( wszMarineName );
if ( gpGlobals->maxClients == 1 )
{
// Don't need these in singleplayer
m_pAvatarImages[ nMarine ]->SetVisible( false );
m_pReadyCheckImages[ nMarine ]->SetVisible( false );
}
else
{
#if !defined(NO_STEAM)
CSteamID steamID;
if ( pCommander )
{
player_info_t pi;
if ( engine->GetPlayerInfo( pCommander->entindex(), &pi ) )
{
if ( pi.friendsID )
{
CSteamID steamIDForPlayer( pi.friendsID, 1, steamapicontext->SteamUtils()->GetConnectedUniverse(), k_EAccountTypeIndividual );
steamID = steamIDForPlayer;
}
}
}
if ( steamID.IsValid() )
{
m_pAvatarImages[ nMarine ]->SetAvatarBySteamID( &steamID );
int wide, tall;
m_pAvatarImages[ nMarine ]->GetSize( wide, tall );
CAvatarImage *pImage = static_cast< CAvatarImage* >( m_pAvatarImages[ nMarine ]->GetImage() );
if ( pImage )
{
pImage->SetAvatarSize( wide, tall );
pImage->SetPos( -AVATAR_INDENT_X, -AVATAR_INDENT_Y );
}
}
#endif
}
nMarine++;
}
}
while ( nMarine < ASW_STATS_REPORT_MAX_PLAYERS )
{
m_pAvatarImages[ nMarine ]->SetVisible( false );
m_pReadyCheckImages[ nMarine ]->SetVisible( false );
nMarine++;
}
}