From 3d77bdfe24b3169627f58f945afbc44992e30a04 Mon Sep 17 00:00:00 2001 From: Jan <> Date: Wed, 18 Feb 2015 15:13:22 +0100 Subject: Move leavers to the bottom of the scoreboard --- TemplePushing.c4s/Script.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/TemplePushing.c4s/Script.c b/TemplePushing.c4s/Script.c index c32a0ea..e7aee92 100644 --- a/TemplePushing.c4s/Script.c +++ b/TemplePushing.c4s/Script.c @@ -6,6 +6,8 @@ static const MODE_Classic = 0, MODE_Magic = 1, MODE_Festive = 2, MODE_Apocalypti static const SBRD_FirstRow = 0; static const SBRD_NameCol = 0, SBRD_RelaunchesCol = 1, SBRD_ScoreCol = 2; +static const SORT_NAMECOL_Title = 0, SORT_NAMECOL_Team = 1, SORT_NAMECOL_Player = 2, SORT_NAMECOL_Leaver = 3; + static const MaxTeamCount = 2; static section, mode; @@ -60,10 +62,10 @@ func InitializePlayer(int player) var team = GetPlayerTeam(player); if (team) { - SetScoreboardData(TeamRow(team), SBRD_NameCol, Format("Team %s", GetTeamColor(team), GetTeamName(team)), 1); + SetScoreboardData(TeamRow(team), SBRD_NameCol, Format("Team %s", GetTeamColor(team), GetTeamName(team)), SORT_NAMECOL_Team); } } - SetScoreboardData(PlayerRow(player), SBRD_NameCol, GetTaggedPlayerName(player), 2); + SetScoreboardData(PlayerRow(player), SBRD_NameCol, GetTaggedPlayerName(player), SORT_NAMECOL_Player); UpdateScoreboard(player); LaunchClonk(player, GetCrew(player)); } @@ -118,7 +120,11 @@ func UpdateScoreboard(int player, bool leaver) // Normal and deathmatch mode: Show player score if (leaver) + { text = "{{SLVR}}"; + // Move leaver to the bottom of the list + SetScoreboardData(PlayerRow(player), SBRD_NameCol, GetTaggedPlayerName(player), SORT_NAMECOL_Leaver); + } else text = Format("%d", playerScore[playerID]); @@ -237,7 +243,7 @@ func StartGame(object menu, string message) CreateObject(APCE, 0, 0, NO_OWNER); } - SetScoreboardData(SBRD_Caption, SBRD_NameCol, " "); // Make sure the name column gets created first + SetScoreboardData(SBRD_Caption, SBRD_NameCol, " ", SORT_NAMECOL_Title); // Make sure the name column gets created first SetScoreboardData(SBRD_Caption, SBRD_ScoreCol, "{{SKIL}}"); // Deathmatch? @@ -245,7 +251,7 @@ func StartGame(object menu, string message) { Log("Creating deathmatch rule"); CreateObject(DTHM, 0, 0, NO_OWNER); - SetScoreboardData(SBRD_FirstRow, SBRD_NameCol, "$WinScore$", 0); + SetScoreboardData(SBRD_FirstRow, SBRD_NameCol, "$WinScore$", SORT_NAMECOL_Title); SetScoreboardData(SBRD_FirstRow, SBRD_ScoreCol, Format("%d $Kills$", deathmatchWinScore)); } else -- cgit v1.2.3-54-g00ecf