void asw_show_xp_f()
{
	C_ASW_Player *pPlayer = C_ASW_Player::GetLocalASWPlayer();
	if ( pPlayer )
	{
		Msg( "pPlayer->GetLevel() = %d\n", pPlayer->GetLevel() );
		Msg( "pPlayer->GetExperience() = %d\n", pPlayer->GetExperience() );
		Msg( "pPlayer->GetExperienceBeforeDebrief() = %d\n", pPlayer->GetExperienceBeforeDebrief() );
	}
}
Example #2
0
int CASW_Briefing::GetCommanderXP( int nLobbySlot )
{
	if ( nLobbySlot < 0 || nLobbySlot >= NUM_BRIEFING_LOBBY_SLOTS )
		return -1;

	UpdateLobbySlotMapping();

	C_ASW_Player *pPlayer = m_LobbySlotMapping[ nLobbySlot ].m_hPlayer.Get();
	if ( !pPlayer )
		return -1;

	return pPlayer->GetExperience();
}
void MissionCompletePlayerStatsLine::UpdateLabels()
{
	C_ASW_Game_Resource* pGameResource = ASWGameResource();
	if (!pGameResource)
		return;

	if ( m_iPlayerIndex < 1 || m_iPlayerIndex>gpGlobals->maxClients )
	{
		m_pNameLabel->SetText("");
		if ( m_pMedalArea )
		{
			m_pMedalArea->SetProfileIndex( -1 );
		}

		m_wszCurrentName[ 0 ] = L'\0';
		return;
	}

	C_ASW_Player *pPlayer = dynamic_cast<C_ASW_Player*>( UTIL_PlayerByIndex( m_iPlayerIndex ) );
	if ( !pPlayer )
		return;

	wchar_t wszPlayerName[ 64 ];
	g_pVGuiLocalize->ConvertANSIToUnicode( g_PR->GetPlayerName( m_iPlayerIndex ), wszPlayerName, sizeof( wszPlayerName ) );

	wchar_t wszPlayerStatus[ 64 ];
	wszPlayerStatus[ 0 ] = L'\0';
	if ( m_iPlayerIndex == pGameResource->GetLeaderEntIndex() )
	{				
		V_wcsncpy( wszPlayerStatus, g_pVGuiLocalize->Find( "#asw_stats_player_status_leader" ), sizeof( wszPlayerStatus ) );
	}
	else if ( pGameResource->IsPlayerReady(m_iPlayerIndex) )
	{
		V_wcsncpy( wszPlayerStatus, g_pVGuiLocalize->Find( "#asw_stats_player_status_ready" ), sizeof( wszPlayerStatus ) );
	}

	char szPlayerXP[ 64 ];
	V_snprintf( szPlayerXP, sizeof( szPlayerXP ), "%d", pPlayer->GetExperience() );
	wchar_t wszPlayerXP[ 64 ];
	g_pVGuiLocalize->ConvertANSIToUnicode( szPlayerXP, wszPlayerXP, sizeof( wszPlayerXP ) );

	g_pVGuiLocalize->ConstructString( m_wszCurrentName, sizeof( m_wszCurrentName ), g_pVGuiLocalize->Find( "#asw_stats_player_name" ), 3, wszPlayerName, wszPlayerStatus, wszPlayerXP );
	m_pNameLabel->SetText( m_wszCurrentName );

	if ( m_pMedalArea )
	{
		m_pMedalArea->SetProfileIndex( m_iPlayerIndex - 1 );
	}

	SetBgColor( m_pBGColor );		
}