Пример #1
0
static void DrawStatus(player_t * CPlayer, int x, int y)
{
	char tempstr[50];
	
	if (hud_showscore)
	{
		mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->Score);
		DrawStatLine(x, y, "Sc:", tempstr);
	}
	
	if (hud_showstats)
	{
		mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->accuracy);
		DrawStatLine(x, y, "Ac:", tempstr);
		mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->stamina);
		DrawStatLine(x, y, "St:", tempstr);
	}
	
	if (!deathmatch)
	{
		// FIXME: ZDoom doesn't preserve the player's stat counters across hubs so this doesn't
		// work in cooperative hub games
		if (hud_showsecrets)
		{
			mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->secretcount : level.found_secrets, level.total_secrets);
			DrawStatLine(x, y, "S:", tempstr);
		}
		
		if (hud_showitems)
		{
			mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->itemcount : level.found_items, level.total_items);
			DrawStatLine(x, y, "I:", tempstr);
		}
		
		if (hud_showmonsters)
		{
			mysnprintf(tempstr, countof(tempstr), "%i/%i ", multiplayer? CPlayer->killcount : level.killed_monsters, level.total_monsters);
			DrawStatLine(x, y, "K:", tempstr);
		}
	}
}
Пример #2
0
static void DrawStatus(player_t * CPlayer, int x, int y)
{
	char tempstr[50];
	
	if (hud_showscore)
	{
		mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->Score);
		DrawStatLine(x, y, "Sc:", tempstr);
	}
	
	if (hud_showstats)
	{
		mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->accuracy);
		DrawStatLine(x, y, "Ac:", tempstr);
		mysnprintf(tempstr, countof(tempstr), "%i ", CPlayer->mo->stamina);
		DrawStatLine(x, y, "St:", tempstr);
	}
	
	// [TP] Zandronum needs a different check here.
	//if (!deathmatch)
	if ( GAMEMODE_GetCurrentFlags() & GMF_COOPERATIVE )
	{
		// FIXME: ZDoom doesn't preserve the player's stat counters across hubs so this doesn't
		// work in cooperative hub games
		if (hud_showsecrets)
		{
			mysnprintf(tempstr, countof(tempstr), "%i/%i ", (NETWORK_GetState( ) != NETSTATE_SINGLE) ? CPlayer->secretcount : level.found_secrets, level.total_secrets);
			DrawStatLine(x, y, "S:", tempstr);
		}
		
		if (hud_showitems)
		{
			mysnprintf(tempstr, countof(tempstr), "%i/%i ", (NETWORK_GetState( ) != NETSTATE_SINGLE ) ? CPlayer->itemcount : level.found_items, level.total_items);
			DrawStatLine(x, y, "I:", tempstr);
		}
		
		if (hud_showmonsters)
		{
			mysnprintf(tempstr, countof(tempstr), "%i/%i ", (NETWORK_GetState( ) != NETSTATE_SINGLE) ? CPlayer->killcount : level.killed_monsters, level.total_monsters);
			DrawStatLine(x, y, "K:", tempstr);
		}
	}

	// [TP] Draw rank and spread
	if (( hud_showdmstats ) && ( SCOREBOARD_ShouldDrawRank( CPlayer - players )))
	{
		FString stat;

		// [TP] Let's use the scoreboard's color here, I guess?
		// I suppose the scoreboard and hud should always show the same player.
		switch ( SCOREBOARD_GetRank() )
		{
			case 0: stat = TEXTCOLOR_BLUE; break;
			case 1: stat = TEXTCOLOR_RED; break;
			case 2: stat = TEXTCOLOR_GREEN; break;
		}

		stat += SCOREBOARD_SpellOrdinal( SCOREBOARD_GetRank() );

		// [TP] Indicate tied status with an asterisk
		if ( SCOREBOARD_IsTied( CPlayer - players ))
			stat += "*";

		stat.AppendFormat (" (%s%ld)", ( SCOREBOARD_GetSpread() > 0 ? "+" : "" ),
			SCOREBOARD_GetSpread() );
		DrawStatLine( x, y, "", stat );
	}
}