// Stuff to do, if the features get added:
// sorting, using JmTics column (which is ugly, but can't currently be sorted on when disabled...)
// hiding/showing columns at runtime, so columns are always visible based on mode, instead of just showing up when data is set
// 	(also allows using non-string column types for stuff like team points)
// Also, Survival Maze support would be nice, but who cares.

Column "JmSoloTime"
{
	DisplayName = "Time"
	ShortName = "Time"
	Alignment = Right
	Size = 40
	CVar = _jm_scoreboard_showsolotime
}

Column "JmPoints"
{
	DisplayName = "Points"
	ShortName = "Pts"
	Alignment = Right
	Size = 18
	CVar = _jm_scoreboard_showteampoints
}

Column "JmRunBest"
{
	DisplayName = "Best"
	ShortName = "Best"
	Alignment = Right
	Size = 55
	CVar = _jm_scoreboard_showjmrtimes
}

Column "JmRunCurrent"
{
	DisplayName = "Current"
	ShortName = "Cur"
	Alignment = Right
	Size = 55
	CVar = _jm_scoreboard_showjmrtimes
}

Column "JmPBRank"
{
	AddFlag DONTSHOWHEADER
	
	Size = 20
}

Column "JmPBTime"
{
	AddFlag DONTSHOWHEADER
	
	Size = 50
}

CompositeColumn "JmPB"
{
	Columns = "JmPBRank", "JmPBTime"
	CVar = _jm_scoreboard_showpb
	DisplayName = "Rank"
	ShortName = "PB"
	Size = 70
	Alignment = Left
}

// Internal. Hopefully we can use this for sorting...
Column "JmTics"
{
	AddFlag ALWAYSUSESHORTESTWIDTH
	AddFlag REVERSEORDER
	AddFlag SORTWHENDISABLED
	CVar = _jm_scoreboard_showticsort
}

// Zan overrides
Column "Kills"
{
	DisplayName = "K"
	ShortName = "K"
}

Column "Deaths"
{
	DisplayName = "D"
	ShortName = "D"
}

Column "Secrets"
{
	DisplayName = "S"
	ShortName = "S"
}

Column "Time"
{
	DisplayName = "T"
	ShortName = "T"
}

Column "Ping"
{
	DisplayName = "P"
	ShortName = "P"
}

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 = 4 )
			}

			// [AK] Draw the name of the current game mode and level.
			DrawString( value = levellump + ": " + levelname, textcolor = "Gold", bottompadding = 1 )
			
			IfCvar( jm_mm_paths > 1 )
			{
				DrawString( value = "Route " + cvar( _jm_scoreboard_route ), textcolor = "Gold", bottompadding = 1 )
			}
			
			// JM stuff
			DrawString( value = "Author: " + cvar( jm_mm_author ), textcolor = "Gold", bottompadding = 1 )
			
			DrawString( value = "Difficulty: " + cvar( _jm_scoreboard_difficulty ), textcolor = "Gold", bottompadding = 4 )

			// 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 )
						}
					}
				}
			}
			// 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" )
					}
				}
			}
		}
	}

	ColumnOrder = "JmTics", "JmPB", "Index", "ReadyToGoAndStatusIcons", "CountryFlag", "Player", "Vote", "JmSoloTime", "JmRunCurrent", "JmRunBest", "JmPoints", "Kills", "Damage", "Deaths", "Lives", "Secrets", "Time", "Ping"
	RankOrder = "JmTics", "JmPoints"
}
