summaryrefslogtreecommitdiffstats
path: root/TemplePushing.c4s/Script.c
diff options
context:
space:
mode:
authorJan <>2015-02-18 15:13:22 +0100
committerJan <_>2015-07-10 18:46:32 +0200
commit3d77bdfe24b3169627f58f945afbc44992e30a04 (patch)
treec6d61851a8bc5cfe198594ca54717f7031aabbef /TemplePushing.c4s/Script.c
parent6afb3c02f851f27a8aee478059a7eb9bd3ec4120 (diff)
downloadtempelschubsen-3d77bdfe24b3169627f58f945afbc44992e30a04.tar.gz
tempelschubsen-3d77bdfe24b3169627f58f945afbc44992e30a04.zip
Move leavers to the bottom of the scoreboard
Diffstat (limited to 'TemplePushing.c4s/Script.c')
-rw-r--r--TemplePushing.c4s/Script.c14
1 files 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("<c %x>Team %s</c>", GetTeamColor(team), GetTeamName(team)), 1);
+ SetScoreboardData(TeamRow(team), SBRD_NameCol, Format("<c %x>Team %s</c>", 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