From 9f73903503ed9c851cbc23a99cd57c4e410d8e95 Mon Sep 17 00:00:00 2001 From: div0 Date: Wed, 12 Jul 2006 18:18:12 +0000 Subject: [PATCH] better coloring for "set _scoreboard 1" git-svn-id: svn://svn.icculus.org/nexuiz/trunk@1757 f962a42d-fe04-0410-a3ab-8c8b0445ebaa --- data/qcsrc/server/g_world.qc | 25 ++++++++++++------------- 1 file changed, 12 insertions(+), 13 deletions(-) diff --git a/data/qcsrc/server/g_world.qc b/data/qcsrc/server/g_world.qc index 7cf798e37..7d876b001 100644 --- a/data/qcsrc/server/g_world.qc +++ b/data/qcsrc/server/g_world.qc @@ -1098,7 +1098,7 @@ float(float fraglimit) WinningCondition_MaxTeamMax = return WinningConditionBase_Teamplay(fraglimit); } -void PrintScoreboardFor(float whichteam) +void PrintScoreboardFor(string name, string colorcode, float whichteam) { entity head; float fragtotal; @@ -1110,8 +1110,11 @@ void PrintScoreboardFor(float whichteam) { if(!whichteam || head.team == whichteam) { - fragtotal = fragtotal + head.frags; + if(name != "") + if(!found) + ServerConsoleEcho(strcat(" ", colorcode, name, ":"), FALSE); found = TRUE; + fragtotal = fragtotal + head.frags; s = ftos(head.frags); s = strcat(s, "/", ftos(head.deaths)); s = strcat(s, " @ ", ftos(head.ping)); @@ -1119,12 +1122,12 @@ void PrintScoreboardFor(float whichteam) s = strcat(s, "botms"); else s = strcat(s, "ms"); - ServerConsoleEcho(strcat(" ", head.netname, "^7 (", s, ")"), TRUE); + ServerConsoleEcho(strcat(" ", colorcode, head.netname, colorcode, " (", s, ")"), TRUE); } head = find(head, classname, "player"); } if(whichteam && found) - ServerConsoleEcho(strcat(" (total: ", ftos(fragtotal), ")"), FALSE); + ServerConsoleEcho(strcat(colorcode, " (total: ", ftos(fragtotal), ")"), FALSE); } void PrintScoreboard() @@ -1132,18 +1135,14 @@ void PrintScoreboard() ServerConsoleEcho("Scoreboard:", FALSE); if(teams_matter) { - ServerConsoleEcho(" Red:", FALSE); - PrintScoreboardFor(COLOR_TEAM1); - ServerConsoleEcho(" Blue:", FALSE); - PrintScoreboardFor(COLOR_TEAM2); - ServerConsoleEcho(" Pink:", FALSE); - PrintScoreboardFor(COLOR_TEAM3); - ServerConsoleEcho(" Yellow:", FALSE); - PrintScoreboardFor(COLOR_TEAM4); + PrintScoreboardFor("Red", "^1", COLOR_TEAM1); + PrintScoreboardFor("Blue", "^4", COLOR_TEAM2); + PrintScoreboardFor("Pink", "^6", COLOR_TEAM3); + PrintScoreboardFor("Yellow", "^3", COLOR_TEAM4); } else { - PrintScoreboardFor(0); + PrintScoreboardFor("", "^7", 0); } ServerConsoleEcho(".", FALSE); } -- 2.39.2