Merge in xonotic/xonotic-data.pk3dir.git: debugger/tdm_netscore
git-manager created issue #1768 on 2013-09-04T23:28:02Z:
Purpose of the branch:
Add a scoreboard column which subtracts deaths from kills to get "net frags(kills)".
This column is called "sum" and is disabled by default.
Repository: xonotic/xonotic-data.pk3dir.git Commit: f111e54b Branch: debugger/tdm_netscore
Merge commands:
cd data/xonotic-data.pk3dir
git checkout master
git reset --hard origin/master
git pull && git diff 'f111e54b35268d60a0c32ba8ff85fe63834c6c7c'..'origin/debugger/tdm_netscore'
# please check that the diff you just saw did not contain anything complex that
# needs a new merge request, and review these changes
git merge --edit --log --no-ff 'origin/debugger/tdm_netscore'
# please make sure this merge worked, and if not, fix merge conflicts and git
# commit BEFORE the next command
#
# also, THIS is the point to do final pre-merge testing
#
# use git reset --hard origin/master to bail out
git push && git push --delete origin 'debugger/tdm_netscore'
Diffstat:
qcsrc/client/main.qh | 1 +
qcsrc/client/scoreboard.qc | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 0 deletions(-)
Revision log:
commit f111e54b35268d60a0c32ba8ff85fe63834c6c7c
Merge: dd919fd 13ffcda
Author: Debugger
Commit: Debugger
Merge branch 'master' into debugger/tdm_netscore
commit dd919fdd8256ce5a92843d969b7eaea34c0c5da0
Author: Debugger
Commit: Debugger
rename net into sum
commit d4e13cadd731a8764512df63cbfcbef20623c364
Author: Debugger
Commit: Debugger
removing an autocvar I forgot; branch is ready to be merged
commit aaee1bb25fc551aec9e8065a37121165d35e8435
Author: Debugger
Commit: Debugger
removed matchend sound (wrong commit in here)
commit 66d4b44693087e463d847d1e1b7bd2f9475eb179
Author: Debugger
Commit: Debugger
disable 'net' by default
commit 2f6e771bf6c03c2315877312581880405f1c8918
Author: Debugger
Commit: Debugger
wrong calculation fixed
commit 45310d9d3e4d0c34970ab93663d73aabae91091b
Author: Debugger
Commit: Debugger
simplified, parallel to SP_FRAGS now
commit 453802ddaf5974ed257b3df194850389c9d2978c
Author: Debugger
Commit: Debugger
small bugfix
commit 29618b4f64a9220b09629105888f6b6d36bb7ca3
Author: Debugger
Commit: Debugger
new default scoreboard for tdm
commit 25c8b89b42ad5d90114186caa6a2375ff7636585
Author: Debugger
Commit: Debugger
removed unnecessary 'num1' declaration
commit 988657118628d5cbd9025f6f570b53ddd8028b58
Author: Debugger
Commit: Debugger
replaced the 's by 's
commit 147dd83699388f7e5f142006b04d0f7ed42bc642
Author: Debugger
Commit: Debugger
added a 'net' column to the tdm scoreboard (enabled by default)
commit 31c6e3f115904862cf14a78af4701392e9230907
Author: Debugger
Commit: Debugger
added a sound when the match ends
User agreed to the license.
Diff:
diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh
index 10a3b16..815c20a 100644
--- a/qcsrc/client/main.qh
+++ b/qcsrc/client/main.qh
@@ -54,6 +54,7 @@ float gametype;
#define SP_CLRATIO -5
#define SP_PL -6
#define SP_FRAGS -7
+#define SP_SUM -8
#define SP_SEPARATOR -100
diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc
index 6544c73..339c8b2 100644
--- a/qcsrc/client/scoreboard.qc
+++ b/qcsrc/client/scoreboard.qc
@@ -36,6 +36,7 @@ string TranslateScoresLabel(string l)
case "lives": return CTX(_("SCO^lives"));
case "losses": return CTX(_("SCO^losses"));
case "name": return CTX(_("SCO^name"));
+ case "sum": return CTX(_("SCO^sum"));
case "nick": return CTX(_("SCO^nick"));
case "objectives": return CTX(_("SCO^objectives"));
case "pickups": return CTX(_("SCO^pickups"));
@@ -263,6 +264,7 @@ void Cmd_HUD_Help()
print(_("^3suicides^7 Number of suicides\n"));
print(_("^3frags^7 kills - suicides\n"));
print(_("^3kd^7 The kill-death ratio\n"));
+ print(_("^3sum^7 frags - deaths\n"));
print(_("^3caps^7 How often a flag (CTF) or a key (KeyHunt) was captured\n"));
print(_("^3pickups^7 How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
print(_("^3captime^7 Time of fastest cap (CTF)\n"));
@@ -304,6 +306,7 @@ string HUD_DefaultColumnLayout()
return strcat( // fteqcc sucks
"ping pl name | ",
"-teams,race,lms/kills +freezetag/kills -teams,lms/deaths +freezetag/deaths -teams,lms,race,ka/suicides +freezetag/suicides -race,dm,tdm,ka,freezetag/frags ", // tdm already has this in "score"
+ "+tdm/kills +tdm/deaths +tdm/suicides ",
"+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns ",
"+lms/lives +lms/rank ",
"+kh/caps +kh/pushes +kh/destroyed ",
@@ -387,6 +390,8 @@ void Cmd_HUD_SetFields(float argc)
hud_field[hud_num_fields] = SP_PL;
} else if(str == "kd" || str == "kdr" || str == "kdratio" || str == "k/d") {
hud_field[hud_num_fields] = SP_KDRATIO;
+ } else if(str == "sum" || str == "diff" || str == "f-d") {
+ hud_field[hud_num_fields] = SP_SUM;
} else if(str == "name" || str == "nick") {
hud_field[hud_num_fields] = SP_NAME;
have_name = 1;
@@ -582,6 +587,19 @@ string HUD_GetField(entity pl, float field)
str = sprintf("%.1f", num/denom);
return str;
+ case SP_SUM:
+ f = pl.(scores[SP_KILLS]);
+ f -= pl.(scores[SP_DEATHS]);
+
+ if(f > 0) {
+ hud_field_rgb = '0 1 0';
+ } else if(f == 0) {
+ hud_field_rgb = '1 1 1';
+ } else {
+ hud_field_rgb = '1 0 0';
+ }
+ return ftos(f);
+
default:
tmp = pl.(scores[field]);
f = scores_flags[field];