Patches #1673

Merge in xonotic/xonotic-data.pk3dir.git: debugger/tdm_netscore

Added by git-manager about 1 year ago. Updated 2 months ago.

Status:ResolvedStart date:06/13/2013
Priority:NormalDue date:
Assignee:Samual% Done:

100%

Category:-
Target version:Xonotic - 0.8

Description

Purpose of the branch:

Adding a 'net' score to the scoreboard (hidden by default) while improving the default tdm scoreboard slightly (adding 'deaths').

Repository: xonotic/xonotic-data.pk3dir.git
Commit: d4e13cadd731a8764512df63cbfcbef20623c364
Branch: debugger/tdm_netscore

Merge commands:

cd data/xonotic-data.pk3dir
git checkout master
git reset --hard origin/master
git pull && git diff 'd4e13cadd731a8764512df63cbfcbef20623c364'..'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 --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 d4e13cadd731a8764512df63cbfcbef20623c364
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    removing an autocvar I forgot; branch is ready to be merged

commit aaee1bb25fc551aec9e8065a37121165d35e8435
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    removed matchend sound (wrong commit in here)

commit 66d4b44693087e463d847d1e1b7bd2f9475eb179
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    disable 'net' by default

commit 2f6e771bf6c03c2315877312581880405f1c8918
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    wrong calculation fixed

commit 45310d9d3e4d0c34970ab93663d73aabae91091b
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    simplified, parallel to SP_FRAGS now

commit 453802ddaf5974ed257b3df194850389c9d2978c
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    small bugfix

commit 29618b4f64a9220b09629105888f6b6d36bb7ca3
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    new default scoreboard for tdm

commit 25c8b89b42ad5d90114186caa6a2375ff7636585
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    removed unnecessary 'num1' declaration

commit 988657118628d5cbd9025f6f570b53ddd8028b58
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    replaced the <tab>'s by <space>'s

commit 147dd83699388f7e5f142006b04d0f7ed42bc642
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    added a 'net' column to the tdm scoreboard (enabled by default)

commit 31c6e3f115904862cf14a78af4701392e9230907
Author: Debugger <pyngot@hotmail.com>
Commit: Debugger <pyngot@hotmail.com>

    added a sound when the match ends

User agreed to the GPLv2+.

Diff:

diff --git a/qcsrc/client/main.qh b/qcsrc/client/main.qh
index 8369a5f..8cb8c77 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_NET -8

 #define SP_SEPARATOR -100

diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc
index 2ec7db0..3982a99 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 "net": return CTX(_("SCO^net"));
         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(_("^3net^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 == "net" || str == "net" || str == "net" || str == "f-d") {
+            hud_field[hud_num_fields] = SP_NET;
         } 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_NET:
+            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];

History

#1 Updated by Debugger about 1 year ago

  • Assignee set to Samual
  • Target version set to 0.8

#2 Updated by Mirio 2 months ago

  • Status changed from New to Resolved
  • % Done changed from 0 to 100

Also available in: Atom PDF