From 5abaad16b78af41557ce571e13e2c2f8ce9b60da Mon Sep 17 00:00:00 2001 From: sauerbraten Date: Fri, 27 Nov 2020 04:09:14 +0100 Subject: [PATCH] add patch to clean up scoreboard --- Makefile | 9 +- README.md | 8 + patches/clean_scoreboard.patch | 406 ++++++++++++++++++ ...{macos-builds.patch => macos_builds.patch} | 0 patches/weaponstats.patch | 26 +- src/Makefile | 1 + src/engine/rendertext.cpp | 4 +- src/fpsgame/scoreboard.cpp | 177 +++----- src/shared/colors.h | 14 + 9 files changed, 516 insertions(+), 129 deletions(-) create mode 100644 patches/clean_scoreboard.patch rename patches/{macos-builds.patch => macos_builds.patch} (100%) create mode 100644 src/shared/colors.h diff --git a/Makefile b/Makefile index 66c8b25..2e60e03 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ build: update-src apply-patches install: cd src && make install + cp -R data ~/.p1xbraten/ clean: cd src && make clean @@ -14,16 +15,18 @@ clean: apply-patches: $(PATCH) < patches/moviehud.patch + $(PATCH) < patches/clean_scoreboard.patch dos2unix src/vcpp/sauerbraten.vcxproj $(PATCH) < patches/weaponstats.patch unix2dos src/vcpp/sauerbraten.vcxproj - $(PATCH) < patches/macos-builds.patch + $(PATCH) < patches/macos_builds.patch undo-patches: - $(PATCH) --reverse < patches/macos-builds.patch + $(PATCH) --reverse < patches/macos_builds.patch dos2unix src/vcpp/sauerbraten.vcxproj $(PATCH) --reverse < patches/weaponstats.patch unix2dos src/vcpp/sauerbraten.vcxproj + $(PATCH) --reverse < patches/clean_scoreboard.patch $(PATCH) --reverse < patches/moviehud.patch clean-sauer: check-env @@ -32,7 +35,7 @@ clean-sauer: check-env update-src: clean-sauer rm --recursive --force src/ - rsync --recursive --times --exclude=".*" $(SAUER_DIR)/src . + rsync --recursive --ignore-times --times --exclude=".*" $(SAUER_DIR)/src . check-env: ifndef SAUER_DIR diff --git a/README.md b/README.md index fd276c7..6d2cc3e 100644 --- a/README.md +++ b/README.md @@ -59,3 +59,11 @@ make install - `showkpd`: when 1, shows the players' frags/death ratio - `showaccuracy`: when 1, shows the players' overall accuracy - `showdamage`: when 1, shows the players' overall damage dealt; when 2, shows the players' overall net damage (= dealt - received) + +### [clean_scoreboard.patch](./patches/clean_scoreboard.patch) + +- filename says it all: + + ![ectf](https://i.imgur.com/6DXW4Pj.jpg) + ![duel](https://i.imgur.com/cbGUTxk.jpg) + ![multiple teams](https://i.imgur.com/aC8rHms.jpg) \ No newline at end of file diff --git a/patches/clean_scoreboard.patch b/patches/clean_scoreboard.patch new file mode 100644 index 0000000..6979b57 --- /dev/null +++ b/patches/clean_scoreboard.patch @@ -0,0 +1,406 @@ +Index: src/Makefile +=================================================================== +--- src/Makefile (revision 6353) ++++ src/Makefile (working copy) +@@ -498,6 +498,7 @@ + fpsgame/scoreboard.o: shared/geom.h shared/ents.h shared/command.h + fpsgame/scoreboard.o: shared/glexts.h shared/glemu.h shared/iengine.h + fpsgame/scoreboard.o: shared/igame.h fpsgame/ai.h ++fpsgame/scoreboard.o: shared/colors.h + fpsgame/server.o: fpsgame/game.h shared/cube.h shared/tools.h shared/geom.h + fpsgame/server.o: shared/ents.h shared/command.h shared/glexts.h + fpsgame/server.o: shared/glemu.h shared/iengine.h shared/igame.h fpsgame/ai.h +Index: src/engine/rendertext.cpp +=================================================================== +--- src/engine/rendertext.cpp (revision 6353) ++++ src/engine/rendertext.cpp (working copy) +@@ -222,9 +222,9 @@ + switch(c) + { + case '0': color = bvec( 64, 255, 128); break; // green: player talk +- case '1': color = bvec( 96, 160, 255); break; // blue: "echo" command ++ case '1': color = bvec( 46, 130, 255); break; // blue: "echo" command + case '2': color = bvec(255, 192, 64); break; // yellow: gameplay messages +- case '3': color = bvec(255, 64, 64); break; // red: important errors ++ case '3': color = bvec(237, 43, 44); break; // red: important errors + case '4': color = bvec(128, 128, 128); break; // gray + case '5': color = bvec(192, 64, 192); break; // magenta + case '6': color = bvec(255, 128, 0); break; // orange +Index: src/fpsgame/scoreboard.cpp +=================================================================== +--- src/fpsgame/scoreboard.cpp (revision 6353) ++++ src/fpsgame/scoreboard.cpp (working copy) +@@ -1,5 +1,6 @@ + // creation of scoreboard + #include "game.h" ++#include "colors.h" + + namespace game + { +@@ -7,7 +8,7 @@ + VARP(showservinfo, 0, 1, 1); + VARP(showclientnum, 0, 0, 1); + VARP(showpj, 0, 0, 1); +- VARP(showping, 0, 1, 2); ++ VARP(showping, 0, 1, 1); + VARP(showspectators, 0, 1, 1); + VARP(showspectatorping, 0, 0, 1); + VARP(highlightscore, 0, 1, 1); +@@ -140,10 +141,10 @@ + { + if(d->privilege) + { +- color = d->privilege>=PRIV_ADMIN ? 0xFF8000 : (d->privilege>=PRIV_AUTH ? 0xC040C0 : 0x40FF80); ++ color = d->privilege>=PRIV_ADMIN ? COL_ADMIN : (d->privilege>=PRIV_AUTH ? COL_AUTH : COL_MASTER); + if(d->state==CS_DEAD) color = (color>>1)&0x7F7F7F; + } +- else if(d->state==CS_DEAD) color = 0x606060; ++ else if(d->state==CS_DEAD) color = (COL_WHITE>>1)&0x7F7F7F; + return color; + } + +@@ -155,23 +156,22 @@ + string hostname; + if(enet_address_get_host_ip(address, hostname, sizeof(hostname)) >= 0) + { +- if(servinfo[0]) g.titlef("%.25s", 0xFFFF80, NULL, servinfo); +- else g.titlef("%s:%d", 0xFFFF80, NULL, hostname, address->port); ++ if(servinfo[0]) g.titlef("%.25s", COL_YELLOW, NULL, servinfo); ++ else g.titlef("%s:%d", COL_YELLOW, NULL, hostname, address->port); + } + } + + g.pushlist(); + g.spring(); +- g.text(server::modename(gamemode), 0xFFFF80); +- g.separator(); ++ g.text(server::modename(gamemode), COL_WHITE); ++ g.space(3); + const char *mname = getclientmap(); +- g.text(mname[0] ? mname : "[new map]", 0xFFFF80); ++ g.text(mname[0] ? mname : "[new map]", COL_WHITE); + extern int gamespeed; +- if(gamespeed != 100) { g.separator(); g.textf("%d.%02dx", 0xFFFF80, NULL, gamespeed/100, gamespeed%100); } + if(m_timed && mname[0] && (maplimit >= 0 || intermission)) + { +- g.separator(); +- if(intermission) g.text("intermission", 0xFFFF80); ++ g.space(3); ++ if(intermission) g.text("intermission", COL_WHITE); + else + { + int secs = max(maplimit-lastmillis+999, 0)/1000, mins = secs/60; +@@ -178,15 +178,16 @@ + secs %= 60; + g.pushlist(); + g.strut(mins >= 10 ? 4.5f : 3.5f); +- g.textf("%d:%02d", 0xFFFF80, NULL, mins, secs); ++ g.textf("%d:%02d", COL_WHITE, NULL, mins, secs); + g.poplist(); + } + } +- if(ispaused()) { g.separator(); g.text("paused", 0xFFFF80); } ++ if(gamespeed != 100) { g.space(3); g.textf("%d.%02dx", COL_GRAY, NULL, gamespeed/100, gamespeed%100); } ++ if(ispaused()) { g.space(3); g.text("paused", COL_GRAY); } + g.spring(); + g.poplist(); + +- g.separator(); ++ g.space(.5); + + int numgroups = groupplayers(); + loopk(numgroups) +@@ -194,8 +195,7 @@ + if((k%2)==0) g.pushlist(); // horizontal + + scoregroup &sg = *groups[k]; +- int bgcolor = sg.team && m_teammode ? (isteam(player1->team, sg.team) ? 0x3030C0 : 0xC03030) : 0, +- fgcolor = 0xFFFF80; ++ int teamcolor = sg.team && m_teammode ? (isteam(player1->team, sg.team) ? COL_BLUE : COL_RED) : 0; + + g.pushlist(); // vertical + g.pushlist(); // horizontal +@@ -207,45 +207,35 @@ + b; \ + } + +- g.pushlist(); + if(sg.team && m_teammode) + { ++ g.pushlist(); // vertical ++ if(sg.score>=10000) g.textf("%s: WIN", teamcolor, NULL, sg.team); ++ else g.textf("%s: %d", teamcolor, NULL, sg.team, sg.score); ++ g.pushlist(); // horizontal ++ } ++ + g.pushlist(); +- g.background(bgcolor, numgroups>1 ? 3 : 5); +- g.strut(1); +- g.poplist(); +- } +- g.text("", 0, " "); ++ g.text("name", COL_GRAY); ++ g.strut(12); + loopscoregroup(o, + { + if(o==player1 && highlightscore && (multiplayer(false) || demoplayback || players.length() > 1)) + { + g.pushlist(); +- g.background(0x808080, numgroups>1 ? 3 : 5); ++ g.background(COL_BACKGROUND, numgroups>1 ? 3 : 5); + } +- const playermodelinfo &mdl = getplayermodelinfo(o); +- const char *icon = sg.team && m_teammode ? (isteam(player1->team, sg.team) ? mdl.blueicon : mdl.redicon) : mdl.ffaicon; +- g.text("", 0, icon); ++ g.textf("%s ", statuscolor(o, COL_WHITE), NULL, colorname(o)); + if(o==player1 && highlightscore && (multiplayer(false) || demoplayback || players.length() > 1)) g.poplist(); + }); + g.poplist(); + +- if(sg.team && m_teammode) +- { +- g.pushlist(); // vertical +- +- if(sg.score>=10000) g.textf("%s: WIN", fgcolor, NULL, sg.team); +- else g.textf("%s: %d", fgcolor, NULL, sg.team, sg.score); +- +- g.pushlist(); // horizontal +- } +- + if(!cmode || !cmode->hidefrags() || !hidefrags) + { + g.pushlist(); + g.strut(6); +- g.text("frags", fgcolor); +- loopscoregroup(o, g.textf("%d", 0xFFFFDD, NULL, o->frags)); ++ g.text("frags", COL_GRAY); ++ loopscoregroup(o, g.textf("%d", COL_WHITE, NULL, o->frags)); + g.poplist(); + } + +@@ -252,90 +242,51 @@ + if(showdeaths) + { + g.pushlist(); +- g.strut(6); +- g.text("deaths", fgcolor); +- loopscoregroup(o, g.textf("%d", 0xFFFFDD, NULL, o->deaths)); ++ g.strut(7); ++ g.text("deaths", COL_GRAY); ++ loopscoregroup(o, g.textf("%d", COL_WHITE, NULL, o->deaths)); + g.poplist(); + } + +- g.pushlist(); +- g.text("name", fgcolor); +- g.strut(12); +- loopscoregroup(o, +- { +- g.textf("%s ", statuscolor(o, 0xFFFFDD), NULL, colorname(o)); +- }); +- g.poplist(); +- + if(multiplayer(false) || demoplayback) + { + if(showpj || showping) g.space(1); + +- if(showpj && showping <= 1) ++ if(showpj) + { + g.pushlist(); + g.strut(6); +- g.text("pj", fgcolor); ++ g.text("pj", COL_GRAY); + loopscoregroup(o, + { +- if(o->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); +- else g.textf("%d", 0xFFFFDD, NULL, o->plag); ++ if(o->state==CS_LAGGED) g.text("LAG", COL_WHITE); ++ else g.textf("%d", COL_WHITE, NULL, o->plag); + }); + g.poplist(); + } + +- if(showping > 1) ++ if(showping) + { + g.pushlist(); ++ g.text("ping", COL_GRAY); + g.strut(6); +- +- g.pushlist(); +- g.text("ping", fgcolor); +- g.space(1); +- g.spring(); +- g.text("pj", fgcolor); +- g.poplist(); +- + loopscoregroup(o, + { + fpsent *p = o->ownernum >= 0 ? getclient(o->ownernum) : o; + if(!p) p = o; +- g.pushlist(); +- if(p->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); +- else +- { +- g.textf("%d", 0xFFFFDD, NULL, p->ping); +- g.space(1); +- g.spring(); +- g.textf("%d", 0xFFFFDD, NULL, o->plag); +- } +- g.poplist(); +- ++ if(!showpj && p->state==CS_LAGGED) g.text("LAG", COL_WHITE); ++ else g.textf("%d", COL_WHITE, NULL, p->ping); + }); + g.poplist(); + } +- else if(showping) +- { +- g.pushlist(); +- g.text("ping", fgcolor); +- g.strut(6); +- loopscoregroup(o, +- { +- fpsent *p = o->ownernum >= 0 ? getclient(o->ownernum) : o; +- if(!p) p = o; +- if(!showpj && p->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); +- else g.textf("%d", 0xFFFFDD, NULL, p->ping); +- }); +- g.poplist(); + } +- } + + if(showclientnum || player1->privilege>=PRIV_MASTER) + { + g.space(1); + g.pushlist(); +- g.text("cn", fgcolor); +- loopscoregroup(o, g.textf("%d", 0xFFFFDD, NULL, o->clientnum)); ++ g.text("cn", COL_GRAY); ++ loopscoregroup(o, g.textf("%d", COL_WHITE, NULL, o->clientnum)); + g.poplist(); + } + +@@ -349,8 +300,12 @@ + g.poplist(); // vertical + + if(k+1ownernum >= 0 ? getclient(o->ownernum) : o; + if(!p) p = o; +- if(p->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); +- else g.textf("%d", 0xFFFFDD, NULL, p->ping); ++ if(p->state==CS_LAGGED) g.text("LAG", COL_WHITE); ++ else g.textf("%d", COL_WHITE, NULL, p->ping); + } + g.poplist(); + } +@@ -393,8 +348,8 @@ + + g.space(1); + g.pushlist(); +- g.text("cn", 0xFFFF80); +- loopv(spectators) g.textf("%d", 0xFFFFDD, NULL, spectators[i]->clientnum); ++ g.text("cn", COL_GRAY); ++ loopv(spectators) g.textf("%d", COL_WHITE, NULL, spectators[i]->clientnum); + g.poplist(); + + g.poplist(); +@@ -401,21 +356,21 @@ + } + else + { +- g.textf("%d spectator%s", 0xFFFF80, " ", spectators.length(), spectators.length()!=1 ? "s" : ""); ++ g.textf("%d spectator%s", COL_GRAY, " ", spectators.length(), spectators.length()!=1 ? "s" : ""); + loopv(spectators) + { + if((i%3)==0) + { + g.pushlist(); +- g.text("", 0xFFFFDD, "spectator"); ++ g.text("", COL_WHITE, 0); + } + fpsent *o = spectators[i]; + if(o==player1 && highlightscore) + { + g.pushlist(); +- g.background(0x808080); ++ g.background(COL_BACKGROUND); + } +- g.text(colorname(o), statuscolor(o, 0xFFFFDD)); ++ g.text(colorname(o), statuscolor(o, COL_WHITE)); + if(o==player1 && highlightscore) g.poplist(); + if(i+1 teaminfos; -@@ -258,6 +261,38 @@ +@@ -248,6 +251,38 @@ g.poplist(); } @@ -349,8 +349,8 @@ Index: src/fpsgame/scoreboard.cpp + { + g.pushlist(); + g.strut(5); -+ g.text("kpd", fgcolor); -+ loopscoregroup(o, g.textf("%.1f", 0xFFFFDD, NULL, (float)o->frags/max(1, o->deaths))); ++ g.text("kpd", COL_GRAY); ++ loopscoregroup(o, g.textf("%.1f", COL_WHITE, NULL, (float)o->frags/max(1, o->deaths))); + g.poplist(); + } + @@ -358,8 +358,8 @@ Index: src/fpsgame/scoreboard.cpp + { + g.pushlist(); + g.strut(5); -+ g.text("acc", fgcolor); -+ loopscoregroup(o, g.textf("%.0f%%", 0xFFFFDD, NULL, playeraccuracy(o))); ++ g.text("acc", COL_GRAY); ++ loopscoregroup(o, g.textf("%.0f%%", COL_WHITE, NULL, playeraccuracy(o))); + g.poplist(); + } + @@ -367,16 +367,16 @@ Index: src/fpsgame/scoreboard.cpp + { + g.pushlist(); + g.strut(6); -+ g.text("dmg", fgcolor); ++ g.text("dmg", COL_GRAY); + loopscoregroup(o, { + float dmg = (float) showdamage == 1 ? playerdamage(o, DMG_DEALT) : playernetdamage(o); + const char *fmt = "%.0f"; + if(fabs(dmg) > 1000.0f) { fmt = "%.1fk"; dmg = dmg/1000.0f; } -+ g.textf(fmt, 0xFFFFDD, NULL, dmg); ++ g.textf(fmt, COL_WHITE, NULL, dmg); + }); + g.poplist(); + } + - g.pushlist(); - g.text("name", fgcolor); - g.strut(12); + if(multiplayer(false) || demoplayback) + { + if(showpj || showping) g.space(1); diff --git a/src/Makefile b/src/Makefile index 04738e5..3ca61ba 100644 --- a/src/Makefile +++ b/src/Makefile @@ -504,6 +504,7 @@ fpsgame/scoreboard.o: fpsgame/game.h shared/cube.h shared/tools.h fpsgame/scoreboard.o: shared/geom.h shared/ents.h shared/command.h fpsgame/scoreboard.o: shared/glexts.h shared/glemu.h shared/iengine.h fpsgame/scoreboard.o: shared/igame.h fpsgame/ai.h +fpsgame/scoreboard.o: shared/colors.h fpsgame/server.o: fpsgame/game.h shared/cube.h shared/tools.h shared/geom.h fpsgame/server.o: shared/ents.h shared/command.h shared/glexts.h fpsgame/server.o: shared/glemu.h shared/iengine.h shared/igame.h fpsgame/ai.h diff --git a/src/engine/rendertext.cpp b/src/engine/rendertext.cpp index 44ad136..0801646 100644 --- a/src/engine/rendertext.cpp +++ b/src/engine/rendertext.cpp @@ -222,9 +222,9 @@ static void text_color(char c, char *stack, int size, int &sp, bvec color, int a switch(c) { case '0': color = bvec( 64, 255, 128); break; // green: player talk - case '1': color = bvec( 96, 160, 255); break; // blue: "echo" command + case '1': color = bvec( 46, 130, 255); break; // blue: "echo" command case '2': color = bvec(255, 192, 64); break; // yellow: gameplay messages - case '3': color = bvec(255, 64, 64); break; // red: important errors + case '3': color = bvec(237, 43, 44); break; // red: important errors case '4': color = bvec(128, 128, 128); break; // gray case '5': color = bvec(192, 64, 192); break; // magenta case '6': color = bvec(255, 128, 0); break; // orange diff --git a/src/fpsgame/scoreboard.cpp b/src/fpsgame/scoreboard.cpp index 0144ca5..82b51aa 100644 --- a/src/fpsgame/scoreboard.cpp +++ b/src/fpsgame/scoreboard.cpp @@ -1,5 +1,6 @@ // creation of scoreboard #include "game.h" +#include "colors.h" namespace game { @@ -7,7 +8,7 @@ namespace game VARP(showservinfo, 0, 1, 1); VARP(showclientnum, 0, 0, 1); VARP(showpj, 0, 0, 1); - VARP(showping, 0, 1, 2); + VARP(showping, 0, 1, 1); VARP(showspectators, 0, 1, 1); VARP(showspectatorping, 0, 0, 1); VARP(highlightscore, 0, 1, 1); @@ -143,10 +144,10 @@ namespace game { if(d->privilege) { - color = d->privilege>=PRIV_ADMIN ? 0xFF8000 : (d->privilege>=PRIV_AUTH ? 0xC040C0 : 0x40FF80); + color = d->privilege>=PRIV_ADMIN ? COL_ADMIN : (d->privilege>=PRIV_AUTH ? COL_AUTH : COL_MASTER); if(d->state==CS_DEAD) color = (color>>1)&0x7F7F7F; } - else if(d->state==CS_DEAD) color = 0x606060; + else if(d->state==CS_DEAD) color = (COL_WHITE>>1)&0x7F7F7F; return color; } @@ -158,38 +159,38 @@ namespace game string hostname; if(enet_address_get_host_ip(address, hostname, sizeof(hostname)) >= 0) { - if(servinfo[0]) g.titlef("%.25s", 0xFFFF80, NULL, servinfo); - else g.titlef("%s:%d", 0xFFFF80, NULL, hostname, address->port); + if(servinfo[0]) g.titlef("%.25s", COL_YELLOW, NULL, servinfo); + else g.titlef("%s:%d", COL_YELLOW, NULL, hostname, address->port); } } g.pushlist(); g.spring(); - g.text(server::modename(gamemode), 0xFFFF80); - g.separator(); + g.text(server::modename(gamemode), COL_WHITE); + g.space(3); const char *mname = getclientmap(); - g.text(mname[0] ? mname : "[new map]", 0xFFFF80); + g.text(mname[0] ? mname : "[new map]", COL_WHITE); extern int gamespeed; - if(gamespeed != 100) { g.separator(); g.textf("%d.%02dx", 0xFFFF80, NULL, gamespeed/100, gamespeed%100); } if(m_timed && mname[0] && (maplimit >= 0 || intermission)) { - g.separator(); - if(intermission) g.text("intermission", 0xFFFF80); + g.space(3); + if(intermission) g.text("intermission", COL_WHITE); else { int secs = max(maplimit-lastmillis+999, 0)/1000, mins = secs/60; secs %= 60; g.pushlist(); g.strut(mins >= 10 ? 4.5f : 3.5f); - g.textf("%d:%02d", 0xFFFF80, NULL, mins, secs); + g.textf("%d:%02d", COL_WHITE, NULL, mins, secs); g.poplist(); } } - if(ispaused()) { g.separator(); g.text("paused", 0xFFFF80); } + if(gamespeed != 100) { g.space(3); g.textf("%d.%02dx", COL_GRAY, NULL, gamespeed/100, gamespeed%100); } + if(ispaused()) { g.space(3); g.text("paused", COL_GRAY); } g.spring(); g.poplist(); - g.separator(); + g.space(.5); int numgroups = groupplayers(); loopk(numgroups) @@ -197,8 +198,7 @@ namespace game if((k%2)==0) g.pushlist(); // horizontal scoregroup &sg = *groups[k]; - int bgcolor = sg.team && m_teammode ? (isteam(player1->team, sg.team) ? 0x3030C0 : 0xC03030) : 0, - fgcolor = 0xFFFF80; + int teamcolor = sg.team && m_teammode ? (isteam(player1->team, sg.team) ? COL_BLUE : COL_RED) : 0; g.pushlist(); // vertical g.pushlist(); // horizontal @@ -210,54 +210,44 @@ namespace game b; \ } - g.pushlist(); if(sg.team && m_teammode) { - g.pushlist(); - g.background(bgcolor, numgroups>1 ? 3 : 5); - g.strut(1); - g.poplist(); + g.pushlist(); // vertical + if(sg.score>=10000) g.textf("%s: WIN", teamcolor, NULL, sg.team); + else g.textf("%s: %d", teamcolor, NULL, sg.team, sg.score); + g.pushlist(); // horizontal } - g.text("", 0, " "); + + g.pushlist(); + g.text("name", COL_GRAY); + g.strut(12); loopscoregroup(o, { if(o==player1 && highlightscore && (multiplayer(false) || demoplayback || players.length() > 1)) { g.pushlist(); - g.background(0x808080, numgroups>1 ? 3 : 5); + g.background(COL_BACKGROUND, numgroups>1 ? 3 : 5); } - const playermodelinfo &mdl = getplayermodelinfo(o); - const char *icon = sg.team && m_teammode ? (isteam(player1->team, sg.team) ? mdl.blueicon : mdl.redicon) : mdl.ffaicon; - g.text("", 0, icon); + g.textf("%s ", statuscolor(o, COL_WHITE), NULL, colorname(o)); if(o==player1 && highlightscore && (multiplayer(false) || demoplayback || players.length() > 1)) g.poplist(); }); g.poplist(); - if(sg.team && m_teammode) - { - g.pushlist(); // vertical - - if(sg.score>=10000) g.textf("%s: WIN", fgcolor, NULL, sg.team); - else g.textf("%s: %d", fgcolor, NULL, sg.team, sg.score); - - g.pushlist(); // horizontal - } - if(!cmode || !cmode->hidefrags() || !hidefrags) { g.pushlist(); g.strut(6); - g.text("frags", fgcolor); - loopscoregroup(o, g.textf("%d", 0xFFFFDD, NULL, o->frags)); + g.text("frags", COL_GRAY); + loopscoregroup(o, g.textf("%d", COL_WHITE, NULL, o->frags)); g.poplist(); } if(showdeaths) { g.pushlist(); - g.strut(6); - g.text("deaths", fgcolor); - loopscoregroup(o, g.textf("%d", 0xFFFFDD, NULL, o->deaths)); + g.strut(7); + g.text("deaths", COL_GRAY); + loopscoregroup(o, g.textf("%d", COL_WHITE, NULL, o->deaths)); g.poplist(); } @@ -265,8 +255,8 @@ namespace game { g.pushlist(); g.strut(5); - g.text("kpd", fgcolor); - loopscoregroup(o, g.textf("%.1f", 0xFFFFDD, NULL, (float)o->frags/max(1, o->deaths))); + g.text("kpd", COL_GRAY); + loopscoregroup(o, g.textf("%.1f", COL_WHITE, NULL, (float)o->frags/max(1, o->deaths))); g.poplist(); } @@ -274,8 +264,8 @@ namespace game { g.pushlist(); g.strut(5); - g.text("acc", fgcolor); - loopscoregroup(o, g.textf("%.0f%%", 0xFFFFDD, NULL, playeraccuracy(o))); + g.text("acc", COL_GRAY); + loopscoregroup(o, g.textf("%.0f%%", COL_WHITE, NULL, playeraccuracy(o))); g.poplist(); } @@ -283,94 +273,55 @@ namespace game { g.pushlist(); g.strut(6); - g.text("dmg", fgcolor); + g.text("dmg", COL_GRAY); loopscoregroup(o, { float dmg = (float) showdamage == 1 ? playerdamage(o, DMG_DEALT) : playernetdamage(o); const char *fmt = "%.0f"; if(fabs(dmg) > 1000.0f) { fmt = "%.1fk"; dmg = dmg/1000.0f; } - g.textf(fmt, 0xFFFFDD, NULL, dmg); + g.textf(fmt, COL_WHITE, NULL, dmg); }); g.poplist(); } - g.pushlist(); - g.text("name", fgcolor); - g.strut(12); - loopscoregroup(o, - { - g.textf("%s ", statuscolor(o, 0xFFFFDD), NULL, colorname(o)); - }); - g.poplist(); - if(multiplayer(false) || demoplayback) { if(showpj || showping) g.space(1); - if(showpj && showping <= 1) + if(showpj) { g.pushlist(); g.strut(6); - g.text("pj", fgcolor); + g.text("pj", COL_GRAY); loopscoregroup(o, { - if(o->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); - else g.textf("%d", 0xFFFFDD, NULL, o->plag); + if(o->state==CS_LAGGED) g.text("LAG", COL_WHITE); + else g.textf("%d", COL_WHITE, NULL, o->plag); }); g.poplist(); } - if(showping > 1) + if(showping) { g.pushlist(); + g.text("ping", COL_GRAY); g.strut(6); - - g.pushlist(); - g.text("ping", fgcolor); - g.space(1); - g.spring(); - g.text("pj", fgcolor); - g.poplist(); - loopscoregroup(o, { fpsent *p = o->ownernum >= 0 ? getclient(o->ownernum) : o; if(!p) p = o; - g.pushlist(); - if(p->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); - else - { - g.textf("%d", 0xFFFFDD, NULL, p->ping); - g.space(1); - g.spring(); - g.textf("%d", 0xFFFFDD, NULL, o->plag); - } - g.poplist(); - + if(!showpj && p->state==CS_LAGGED) g.text("LAG", COL_WHITE); + else g.textf("%d", COL_WHITE, NULL, p->ping); }); g.poplist(); } - else if(showping) - { - g.pushlist(); - g.text("ping", fgcolor); - g.strut(6); - loopscoregroup(o, - { - fpsent *p = o->ownernum >= 0 ? getclient(o->ownernum) : o; - if(!p) p = o; - if(!showpj && p->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); - else g.textf("%d", 0xFFFFDD, NULL, p->ping); - }); - g.poplist(); } - } if(showclientnum || player1->privilege>=PRIV_MASTER) { g.space(1); g.pushlist(); - g.text("cn", fgcolor); - loopscoregroup(o, g.textf("%d", 0xFFFFDD, NULL, o->clientnum)); + g.text("cn", COL_GRAY); + loopscoregroup(o, g.textf("%d", COL_WHITE, NULL, o->clientnum)); g.poplist(); } @@ -384,7 +335,11 @@ namespace game g.poplist(); // vertical if(k+1ownernum >= 0 ? getclient(o->ownernum) : o; if(!p) p = o; - if(p->state==CS_LAGGED) g.text("LAG", 0xFFFFDD); - else g.textf("%d", 0xFFFFDD, NULL, p->ping); + if(p->state==CS_LAGGED) g.text("LAG", COL_WHITE); + else g.textf("%d", COL_WHITE, NULL, p->ping); } g.poplist(); } g.space(1); g.pushlist(); - g.text("cn", 0xFFFF80); - loopv(spectators) g.textf("%d", 0xFFFFDD, NULL, spectators[i]->clientnum); + g.text("cn", COL_GRAY); + loopv(spectators) g.textf("%d", COL_WHITE, NULL, spectators[i]->clientnum); g.poplist(); g.poplist(); } else { - g.textf("%d spectator%s", 0xFFFF80, " ", spectators.length(), spectators.length()!=1 ? "s" : ""); + g.textf("%d spectator%s", COL_GRAY, " ", spectators.length(), spectators.length()!=1 ? "s" : ""); loopv(spectators) { if((i%3)==0) { g.pushlist(); - g.text("", 0xFFFFDD, "spectator"); + g.text("", COL_WHITE, 0); } fpsent *o = spectators[i]; if(o==player1 && highlightscore) { g.pushlist(); - g.background(0x808080); + g.background(COL_BACKGROUND); } - g.text(colorname(o), statuscolor(o, 0xFFFFDD)); + g.text(colorname(o), statuscolor(o, COL_WHITE)); if(o==player1 && highlightscore) g.poplist(); if(i+1