//*****************************************************************************
//
// COLUMN BLOCKS
//
//*****************************************************************************\

Column "Points"
{
	AddFlag NOSPECTATORS
	AddFlag ALWAYSUSESHORTESTWIDTH

	DisplayName = "Points"
	Alignment = Right
	EarnType = Points
	GameType = TeamGame
	ShortName = "Pnts"
	Size = 24
}

Column "Deaths"
{
	AddFlag NOSPECTATORS
	AddFlag ALWAYSUSESHORTESTWIDTH

	DisplayName = "Deaths"
	Alignment = Right
	EarnType = Points
	GameType = TeamGame
	ShortName = "Dths"
	Size = 24
}


Column "Touches"
{
	AddFlag NOSPECTATORS
	AddFlag ALWAYSUSESHORTESTWIDTH
	
	DisplayName = "Touches"
	Alignment = Right
	GameType = TeamGame
	ShortName = "Tchs"
	Size = 24
}

Column "FlagReturns"
{
	AddFlag NOSPECTATORS
	AddFlag ALWAYSUSESHORTESTWIDTH
	
	DisplayName = "Returns"
	Alignment = Right
	GameType = TeamGame
	ShortName = "Rtrns"
	Size = 24
}


//Column "PowerupGrabs"
//{
//	AddFlag NOSPECTATORS
//	AddFlag ALWAYSUSESHORTESTWIDTH
	
//	Alignment = Right
//	GameType = Deathmatch, TeamGame
//	DisplayName = "POW"
//	ShortName = "POW"
//	Size = 24
//}

//Column "PlayerDamage"
//{

//	DisplayName = "DMG"
//	ShortName = "DMG"
//	AddFlag NOSPECTATORS
//	AddFlag ALWAYSUSESHORTESTWIDTH
	
//	Alignment = Right
//	GameType = Deathmatch, TeamGame
//	ShortName = ""
//	Size = 24
//}

CompositeColumn "ReadyToGoAndStatusIcons"
{
	AddFlag DONTSHOWHEADER
	AddFlag ALWAYSUSESHORTESTWIDTH

	Columns = "ReadyToGoIcon", "StatusIcon"
	GapBetweenColumns = 4
}

CompositeColumn "Player"
{
	Columns = "PlayerColor", "JoinQueue", "Name"
	GapBetweenColumns = 4
	Size = 200
}

//CompositeColumn "ComboSpreeInfo"
//{
	// Columns = "SpreeStreak", "ComboStreak", "SpreeNum"
//	GapBetweenColumns = 4
//	Size = 200
//}

//*****************************************************************************
//
// SCOREBOARD BLOCK
//
//*****************************************************************************

Scoreboard
{
	MainHeader
	{
		MultiLineBlock( horizontalalign = center )
		{
			DrawString( value = "Rankings", font = "BigFont", textcolor = "Red", bottompadding = 6 )

			// [AK] Draw the name of the server if we're in an online game.
			IfOnlineGame( true )
			{
				DrawString( value = cvar( sv_hostname ), textcolor = "Grey", bottompadding = 1 )
			}

			// [AK] Draw the name of the current game mode and level.
			DrawString( value = gamemode + " - " + levellump + ": " + levelname, textcolor = "Gold", bottompadding = 1 )

			// Draw the time, frags, points, or kills we have left until the level ends.
			DrawString( value = limitstrings, textcolor = "Grey", bottompadding = 1 )

			// Draw the team scores and their relation (tied, red leads, etc).
			IfPlayersOnTeams( true ) && IfEarnType( Frags, Points, Wins )
			{
				DrawString( value = pointstring, textcolor = "Grey", bottompadding = 1 )
			}
			// Draw my rank and my frags, points, etc. Don't draw it if we're in the intermission.
			Else IfIntermission( false ) && IfShouldShowRank( true )
			{
				DrawString( value = placestring, textcolor = "Grey", bottompadding = 1 )
			}

			// [JS] Intermission countdown display.
			IfIntermission( true ) && IfOnlineGame( true ) && IfCVar( cl_intermissiontimer == true )
			{
				DrawString( value = "Entering " + nextlevellump + ": " + nextlevelname + " in " + intermissiontimeleft + " second(s)", textcolor = "Green" )
			}
		}
	}

	TeamHeader
	{
		MultiLineBlock( verticalalign = center )
		{
			RowBlock( )
			{
				DrawTexture( value = teamlogo, rightpadding = 2 )

				MultiLineBlock( )
				{
					DrawString( value = teamname, font = "BigFont", textcolor = teamtextcolor, bottompadding = 1 )

					IfPlayersHaveLives( false )
					{
						DrawString( value = "Total Players: " + teamplayercount, textcolor = teamtextcolor, bottompadding = 1 )
					}
					Else
					{
						DrawString( value = "Players Alive: " + teamliveplayercount + "/" + teamplayercount, textcolor = teamtextcolor, bottompadding = 1 )
					}
				}
			}

			// [AK] Use a width of INT_MAX to ensure this color box stretches across the entire margin.
			DrawColor( value = teamcolor, width = 2147483648, height = 1, bottompadding = 2 )
		}

		MultiLineBlock( horizontalalign = right, verticalalign = center, bottompadding = 4 )
		{
			IfEarnType( Frags, Points, Wins )
			{
				IfEarnType( Frags )
				{
					DrawString( value = "Frags: " + teamfragcount, font = "BigFont", textcolor = teamtextcolor )
				}
				Else
				{
					IfEarnType( Points )
					{
						DrawString( value = "Points: " + teampointcount, font = "BigFont", textcolor = teamtextcolor, bottompadding = 1 )
					}
					Else
					{
						DrawString( value = "Wins: " + teamwincount, font = "BigFont", textcolor = teamtextcolor, bottompadding = 1 )
					}

					DrawString( value = "Frags: " + teamfragcount, textcolor = teamtextcolor )
				}
			}
		}
	}

	SpectatorHeader
	{
		MultiLineBlock( verticalalign = center )
		{
			DrawString( value = "Spectators (" + spectatorcount + ")", textcolor = "Grey", bottompadding = 1 )

			// [AK] Use a width of INT_MAX to ensure this color box stretches across the entire margin.
			DrawColor( value = "DD DD DD", width = 2147483648, height = 1, bottompadding = 2 )
		}
	}

	HeaderFont = "SmallFont"
	RowFont = "SmallFont"
	BackgroundColor = "00 00 00"
	BackgroundAmount = 0.5
	BackgroundBorderSize = 4
	LightRowBackgroundColor = "40 40 40"
	DarkRowBackgroundColor = "20 20 20"
	LocalRowBackgroundColor = "80 80 80"
	ContentAlpha = 1.0
	RowBackgroundAmount = 0.65
	DeadPlayerTextAlpha = 0.35
	DeadPlayerRowBackgroundAmount = 0
	GapBetweenHeaderAndRows = 2
	GapBetweenColumns = 2
	GapBetweenRows = 2
	ColumnPadding = 1
	HeaderHeight = -2
	RowHeight = -2
	ColumnOrder = "BotSkillIcon", "Index", "ReadyToGoAndStatusIcons", "ArtifactIcon", "PlayerIcon", "CountryFlag", "Player", "Vote", "Handicap", "Wins", "Points", "Frags", "Deaths", "Touches", "FlagReturns", "Ping", "Time"
	RankOrder = "Points", "Frags", "Deaths"

	AddFlag SeparateDeadSpectators
}
